root / hw / pl110.c @ 6597ebbb
History | View | Annotate | Download (9 kB)
1 | 5fafdf24 | ths | /*
|
---|---|---|---|
2 | bdd5003a | pbrook | * Arm PrimeCell PL110 Color LCD Controller
|
3 | bdd5003a | pbrook | *
|
4 | 2e9bdce5 | Paul Brook | * Copyright (c) 2005-2009 CodeSourcery.
|
5 | bdd5003a | pbrook | * Written by Paul Brook
|
6 | bdd5003a | pbrook | *
|
7 | bdd5003a | pbrook | * This code is licenced under the GNU LGPL
|
8 | bdd5003a | pbrook | */
|
9 | bdd5003a | pbrook | |
10 | 2e9bdce5 | Paul Brook | #include "sysbus.h" |
11 | 87ecb68b | pbrook | #include "console.h" |
12 | 714fa308 | pbrook | #include "framebuffer.h" |
13 | bdd5003a | pbrook | |
14 | bdd5003a | pbrook | #define PL110_CR_EN 0x001 |
15 | e9c05b42 | balrog | #define PL110_CR_BGR 0x100 |
16 | bdd5003a | pbrook | #define PL110_CR_BEBO 0x200 |
17 | bdd5003a | pbrook | #define PL110_CR_BEPO 0x400 |
18 | bdd5003a | pbrook | #define PL110_CR_PWR 0x800 |
19 | bdd5003a | pbrook | |
20 | bdd5003a | pbrook | enum pl110_bppmode
|
21 | bdd5003a | pbrook | { |
22 | bdd5003a | pbrook | BPP_1, |
23 | bdd5003a | pbrook | BPP_2, |
24 | bdd5003a | pbrook | BPP_4, |
25 | bdd5003a | pbrook | BPP_8, |
26 | bdd5003a | pbrook | BPP_16, |
27 | bdd5003a | pbrook | BPP_32 |
28 | bdd5003a | pbrook | }; |
29 | bdd5003a | pbrook | |
30 | bdd5003a | pbrook | typedef struct { |
31 | 2e9bdce5 | Paul Brook | SysBusDevice busdev; |
32 | bdd5003a | pbrook | DisplayState *ds; |
33 | c60e08d9 | pbrook | |
34 | cdbdb648 | pbrook | /* The Versatile/PB uses a slightly modified PL110 controller. */
|
35 | cdbdb648 | pbrook | int versatile;
|
36 | bdd5003a | pbrook | uint32_t timing[4];
|
37 | bdd5003a | pbrook | uint32_t cr; |
38 | bdd5003a | pbrook | uint32_t upbase; |
39 | bdd5003a | pbrook | uint32_t lpbase; |
40 | bdd5003a | pbrook | uint32_t int_status; |
41 | bdd5003a | pbrook | uint32_t int_mask; |
42 | bdd5003a | pbrook | int cols;
|
43 | bdd5003a | pbrook | int rows;
|
44 | bdd5003a | pbrook | enum pl110_bppmode bpp;
|
45 | bdd5003a | pbrook | int invalidate;
|
46 | bdd5003a | pbrook | uint32_t pallette[256];
|
47 | bdd5003a | pbrook | uint32_t raw_pallette[128];
|
48 | d537cf6c | pbrook | qemu_irq irq; |
49 | bdd5003a | pbrook | } pl110_state; |
50 | bdd5003a | pbrook | |
51 | bdd5003a | pbrook | static const unsigned char pl110_id[] = |
52 | bdd5003a | pbrook | { 0x10, 0x11, 0x04, 0x00, 0x0d, 0xf0, 0x05, 0xb1 }; |
53 | bdd5003a | pbrook | |
54 | cdbdb648 | pbrook | /* The Arm documentation (DDI0224C) says the CLDC on the Versatile board
|
55 | cdbdb648 | pbrook | has a different ID. However Linux only looks for the normal ID. */
|
56 | cdbdb648 | pbrook | #if 0
|
57 | cdbdb648 | pbrook | static const unsigned char pl110_versatile_id[] =
|
58 | cdbdb648 | pbrook | { 0x93, 0x10, 0x04, 0x00, 0x0d, 0xf0, 0x05, 0xb1 };
|
59 | cdbdb648 | pbrook | #else
|
60 | cdbdb648 | pbrook | #define pl110_versatile_id pl110_id
|
61 | cdbdb648 | pbrook | #endif
|
62 | cdbdb648 | pbrook | |
63 | 602dafcf | pbrook | #include "pixel_ops.h" |
64 | bdd5003a | pbrook | |
65 | bdd5003a | pbrook | #define BITS 8 |
66 | bdd5003a | pbrook | #include "pl110_template.h" |
67 | bdd5003a | pbrook | #define BITS 15 |
68 | bdd5003a | pbrook | #include "pl110_template.h" |
69 | bdd5003a | pbrook | #define BITS 16 |
70 | bdd5003a | pbrook | #include "pl110_template.h" |
71 | bdd5003a | pbrook | #define BITS 24 |
72 | bdd5003a | pbrook | #include "pl110_template.h" |
73 | bdd5003a | pbrook | #define BITS 32 |
74 | bdd5003a | pbrook | #include "pl110_template.h" |
75 | bdd5003a | pbrook | |
76 | bdd5003a | pbrook | static int pl110_enabled(pl110_state *s) |
77 | bdd5003a | pbrook | { |
78 | bdd5003a | pbrook | return (s->cr & PL110_CR_EN) && (s->cr & PL110_CR_PWR);
|
79 | bdd5003a | pbrook | } |
80 | bdd5003a | pbrook | |
81 | 95219897 | pbrook | static void pl110_update_display(void *opaque) |
82 | bdd5003a | pbrook | { |
83 | bdd5003a | pbrook | pl110_state *s = (pl110_state *)opaque; |
84 | bdd5003a | pbrook | drawfn* fntable; |
85 | bdd5003a | pbrook | drawfn fn; |
86 | bdd5003a | pbrook | int dest_width;
|
87 | bdd5003a | pbrook | int src_width;
|
88 | e9c05b42 | balrog | int bpp_offset;
|
89 | 714fa308 | pbrook | int first;
|
90 | 714fa308 | pbrook | int last;
|
91 | bdd5003a | pbrook | |
92 | bdd5003a | pbrook | if (!pl110_enabled(s))
|
93 | bdd5003a | pbrook | return;
|
94 | 3b46e624 | ths | |
95 | 0e1f5a0c | aliguori | switch (ds_get_bits_per_pixel(s->ds)) {
|
96 | af2f6733 | pbrook | case 0: |
97 | af2f6733 | pbrook | return;
|
98 | bdd5003a | pbrook | case 8: |
99 | bdd5003a | pbrook | fntable = pl110_draw_fn_8; |
100 | bdd5003a | pbrook | dest_width = 1;
|
101 | bdd5003a | pbrook | break;
|
102 | bdd5003a | pbrook | case 15: |
103 | bdd5003a | pbrook | fntable = pl110_draw_fn_15; |
104 | bdd5003a | pbrook | dest_width = 2;
|
105 | bdd5003a | pbrook | break;
|
106 | bdd5003a | pbrook | case 16: |
107 | bdd5003a | pbrook | fntable = pl110_draw_fn_16; |
108 | bdd5003a | pbrook | dest_width = 2;
|
109 | bdd5003a | pbrook | break;
|
110 | bdd5003a | pbrook | case 24: |
111 | bdd5003a | pbrook | fntable = pl110_draw_fn_24; |
112 | bdd5003a | pbrook | dest_width = 3;
|
113 | bdd5003a | pbrook | break;
|
114 | bdd5003a | pbrook | case 32: |
115 | bdd5003a | pbrook | fntable = pl110_draw_fn_32; |
116 | bdd5003a | pbrook | dest_width = 4;
|
117 | bdd5003a | pbrook | break;
|
118 | bdd5003a | pbrook | default:
|
119 | af2f6733 | pbrook | fprintf(stderr, "pl110: Bad color depth\n");
|
120 | bdd5003a | pbrook | exit(1);
|
121 | bdd5003a | pbrook | } |
122 | e9c05b42 | balrog | if (s->cr & PL110_CR_BGR)
|
123 | e9c05b42 | balrog | bpp_offset = 0;
|
124 | e9c05b42 | balrog | else
|
125 | e9c05b42 | balrog | bpp_offset = 18;
|
126 | e9c05b42 | balrog | |
127 | bdd5003a | pbrook | if (s->cr & PL110_CR_BEBO)
|
128 | e9c05b42 | balrog | fn = fntable[s->bpp + 6 + bpp_offset];
|
129 | bdd5003a | pbrook | else if (s->cr & PL110_CR_BEPO) |
130 | e9c05b42 | balrog | fn = fntable[s->bpp + 12 + bpp_offset];
|
131 | bdd5003a | pbrook | else
|
132 | e9c05b42 | balrog | fn = fntable[s->bpp + bpp_offset]; |
133 | 3b46e624 | ths | |
134 | bdd5003a | pbrook | src_width = s->cols; |
135 | bdd5003a | pbrook | switch (s->bpp) {
|
136 | bdd5003a | pbrook | case BPP_1:
|
137 | bdd5003a | pbrook | src_width >>= 3;
|
138 | bdd5003a | pbrook | break;
|
139 | bdd5003a | pbrook | case BPP_2:
|
140 | bdd5003a | pbrook | src_width >>= 2;
|
141 | bdd5003a | pbrook | break;
|
142 | bdd5003a | pbrook | case BPP_4:
|
143 | bdd5003a | pbrook | src_width >>= 1;
|
144 | bdd5003a | pbrook | break;
|
145 | bdd5003a | pbrook | case BPP_8:
|
146 | bdd5003a | pbrook | break;
|
147 | bdd5003a | pbrook | case BPP_16:
|
148 | bdd5003a | pbrook | src_width <<= 1;
|
149 | bdd5003a | pbrook | break;
|
150 | bdd5003a | pbrook | case BPP_32:
|
151 | bdd5003a | pbrook | src_width <<= 2;
|
152 | bdd5003a | pbrook | break;
|
153 | bdd5003a | pbrook | } |
154 | bdd5003a | pbrook | dest_width *= s->cols; |
155 | 714fa308 | pbrook | first = 0;
|
156 | 714fa308 | pbrook | framebuffer_update_display(s->ds, |
157 | 714fa308 | pbrook | s->upbase, s->cols, s->rows, |
158 | 714fa308 | pbrook | src_width, dest_width, 0,
|
159 | 714fa308 | pbrook | s->invalidate, |
160 | 714fa308 | pbrook | fn, s->pallette, |
161 | 714fa308 | pbrook | &first, &last); |
162 | 714fa308 | pbrook | if (first >= 0) { |
163 | 714fa308 | pbrook | dpy_update(s->ds, 0, first, s->cols, last - first + 1); |
164 | bdd5003a | pbrook | } |
165 | bdd5003a | pbrook | s->invalidate = 0;
|
166 | bdd5003a | pbrook | } |
167 | bdd5003a | pbrook | |
168 | 95219897 | pbrook | static void pl110_invalidate_display(void * opaque) |
169 | bdd5003a | pbrook | { |
170 | bdd5003a | pbrook | pl110_state *s = (pl110_state *)opaque; |
171 | bdd5003a | pbrook | s->invalidate = 1;
|
172 | bfdb3629 | Blue Swirl | if (pl110_enabled(s)) {
|
173 | bfdb3629 | Blue Swirl | qemu_console_resize(s->ds, s->cols, s->rows); |
174 | bfdb3629 | Blue Swirl | } |
175 | bdd5003a | pbrook | } |
176 | bdd5003a | pbrook | |
177 | bdd5003a | pbrook | static void pl110_update_pallette(pl110_state *s, int n) |
178 | bdd5003a | pbrook | { |
179 | bdd5003a | pbrook | int i;
|
180 | bdd5003a | pbrook | uint32_t raw; |
181 | bdd5003a | pbrook | unsigned int r, g, b; |
182 | bdd5003a | pbrook | |
183 | bdd5003a | pbrook | raw = s->raw_pallette[n]; |
184 | bdd5003a | pbrook | n <<= 1;
|
185 | bdd5003a | pbrook | for (i = 0; i < 2; i++) { |
186 | bdd5003a | pbrook | r = (raw & 0x1f) << 3; |
187 | bdd5003a | pbrook | raw >>= 5;
|
188 | bdd5003a | pbrook | g = (raw & 0x1f) << 3; |
189 | bdd5003a | pbrook | raw >>= 5;
|
190 | bdd5003a | pbrook | b = (raw & 0x1f) << 3; |
191 | bdd5003a | pbrook | /* The I bit is ignored. */
|
192 | bdd5003a | pbrook | raw >>= 6;
|
193 | 0e1f5a0c | aliguori | switch (ds_get_bits_per_pixel(s->ds)) {
|
194 | bdd5003a | pbrook | case 8: |
195 | bdd5003a | pbrook | s->pallette[n] = rgb_to_pixel8(r, g, b); |
196 | bdd5003a | pbrook | break;
|
197 | bdd5003a | pbrook | case 15: |
198 | bdd5003a | pbrook | s->pallette[n] = rgb_to_pixel15(r, g, b); |
199 | bdd5003a | pbrook | break;
|
200 | bdd5003a | pbrook | case 16: |
201 | bdd5003a | pbrook | s->pallette[n] = rgb_to_pixel16(r, g, b); |
202 | bdd5003a | pbrook | break;
|
203 | bdd5003a | pbrook | case 24: |
204 | bdd5003a | pbrook | case 32: |
205 | bdd5003a | pbrook | s->pallette[n] = rgb_to_pixel32(r, g, b); |
206 | bdd5003a | pbrook | break;
|
207 | bdd5003a | pbrook | } |
208 | bdd5003a | pbrook | n++; |
209 | bdd5003a | pbrook | } |
210 | bdd5003a | pbrook | } |
211 | bdd5003a | pbrook | |
212 | bdd5003a | pbrook | static void pl110_resize(pl110_state *s, int width, int height) |
213 | bdd5003a | pbrook | { |
214 | bdd5003a | pbrook | if (width != s->cols || height != s->rows) {
|
215 | bdd5003a | pbrook | if (pl110_enabled(s)) {
|
216 | 3023f332 | aliguori | qemu_console_resize(s->ds, width, height); |
217 | bdd5003a | pbrook | } |
218 | bdd5003a | pbrook | } |
219 | bdd5003a | pbrook | s->cols = width; |
220 | bdd5003a | pbrook | s->rows = height; |
221 | bdd5003a | pbrook | } |
222 | bdd5003a | pbrook | |
223 | bdd5003a | pbrook | /* Update interrupts. */
|
224 | bdd5003a | pbrook | static void pl110_update(pl110_state *s) |
225 | bdd5003a | pbrook | { |
226 | bdd5003a | pbrook | /* TODO: Implement interrupts. */
|
227 | bdd5003a | pbrook | } |
228 | bdd5003a | pbrook | |
229 | bdd5003a | pbrook | static uint32_t pl110_read(void *opaque, target_phys_addr_t offset) |
230 | bdd5003a | pbrook | { |
231 | bdd5003a | pbrook | pl110_state *s = (pl110_state *)opaque; |
232 | bdd5003a | pbrook | |
233 | bdd5003a | pbrook | if (offset >= 0xfe0 && offset < 0x1000) { |
234 | cdbdb648 | pbrook | if (s->versatile)
|
235 | cdbdb648 | pbrook | return pl110_versatile_id[(offset - 0xfe0) >> 2]; |
236 | cdbdb648 | pbrook | else
|
237 | cdbdb648 | pbrook | return pl110_id[(offset - 0xfe0) >> 2]; |
238 | bdd5003a | pbrook | } |
239 | bdd5003a | pbrook | if (offset >= 0x200 && offset < 0x400) { |
240 | bdd5003a | pbrook | return s->raw_pallette[(offset - 0x200) >> 2]; |
241 | bdd5003a | pbrook | } |
242 | bdd5003a | pbrook | switch (offset >> 2) { |
243 | bdd5003a | pbrook | case 0: /* LCDTiming0 */ |
244 | bdd5003a | pbrook | return s->timing[0]; |
245 | bdd5003a | pbrook | case 1: /* LCDTiming1 */ |
246 | bdd5003a | pbrook | return s->timing[1]; |
247 | bdd5003a | pbrook | case 2: /* LCDTiming2 */ |
248 | bdd5003a | pbrook | return s->timing[2]; |
249 | bdd5003a | pbrook | case 3: /* LCDTiming3 */ |
250 | bdd5003a | pbrook | return s->timing[3]; |
251 | bdd5003a | pbrook | case 4: /* LCDUPBASE */ |
252 | bdd5003a | pbrook | return s->upbase;
|
253 | bdd5003a | pbrook | case 5: /* LCDLPBASE */ |
254 | bdd5003a | pbrook | return s->lpbase;
|
255 | bdd5003a | pbrook | case 6: /* LCDIMSC */ |
256 | 64075cd7 | pbrook | if (s->versatile)
|
257 | 64075cd7 | pbrook | return s->cr;
|
258 | bdd5003a | pbrook | return s->int_mask;
|
259 | bdd5003a | pbrook | case 7: /* LCDControl */ |
260 | 64075cd7 | pbrook | if (s->versatile)
|
261 | 64075cd7 | pbrook | return s->int_mask;
|
262 | bdd5003a | pbrook | return s->cr;
|
263 | bdd5003a | pbrook | case 8: /* LCDRIS */ |
264 | bdd5003a | pbrook | return s->int_status;
|
265 | bdd5003a | pbrook | case 9: /* LCDMIS */ |
266 | bdd5003a | pbrook | return s->int_status & s->int_mask;
|
267 | bdd5003a | pbrook | case 11: /* LCDUPCURR */ |
268 | bdd5003a | pbrook | /* TODO: Implement vertical refresh. */
|
269 | bdd5003a | pbrook | return s->upbase;
|
270 | bdd5003a | pbrook | case 12: /* LCDLPCURR */ |
271 | bdd5003a | pbrook | return s->lpbase;
|
272 | bdd5003a | pbrook | default:
|
273 | 2ac71179 | Paul Brook | hw_error("pl110_read: Bad offset %x\n", (int)offset); |
274 | bdd5003a | pbrook | return 0; |
275 | bdd5003a | pbrook | } |
276 | bdd5003a | pbrook | } |
277 | bdd5003a | pbrook | |
278 | bdd5003a | pbrook | static void pl110_write(void *opaque, target_phys_addr_t offset, |
279 | bdd5003a | pbrook | uint32_t val) |
280 | bdd5003a | pbrook | { |
281 | bdd5003a | pbrook | pl110_state *s = (pl110_state *)opaque; |
282 | bdd5003a | pbrook | int n;
|
283 | bdd5003a | pbrook | |
284 | bdd5003a | pbrook | /* For simplicity invalidate the display whenever a control register
|
285 | bdd5003a | pbrook | is writen to. */
|
286 | bdd5003a | pbrook | s->invalidate = 1;
|
287 | bdd5003a | pbrook | if (offset >= 0x200 && offset < 0x400) { |
288 | bdd5003a | pbrook | /* Pallette. */
|
289 | bdd5003a | pbrook | n = (offset - 0x200) >> 2; |
290 | bdd5003a | pbrook | s->raw_pallette[(offset - 0x200) >> 2] = val; |
291 | bdd5003a | pbrook | pl110_update_pallette(s, n); |
292 | e10c2bfb | pbrook | return;
|
293 | bdd5003a | pbrook | } |
294 | bdd5003a | pbrook | switch (offset >> 2) { |
295 | bdd5003a | pbrook | case 0: /* LCDTiming0 */ |
296 | bdd5003a | pbrook | s->timing[0] = val;
|
297 | bdd5003a | pbrook | n = ((val & 0xfc) + 4) * 4; |
298 | bdd5003a | pbrook | pl110_resize(s, n, s->rows); |
299 | bdd5003a | pbrook | break;
|
300 | bdd5003a | pbrook | case 1: /* LCDTiming1 */ |
301 | bdd5003a | pbrook | s->timing[1] = val;
|
302 | bdd5003a | pbrook | n = (val & 0x3ff) + 1; |
303 | bdd5003a | pbrook | pl110_resize(s, s->cols, n); |
304 | bdd5003a | pbrook | break;
|
305 | bdd5003a | pbrook | case 2: /* LCDTiming2 */ |
306 | bdd5003a | pbrook | s->timing[2] = val;
|
307 | bdd5003a | pbrook | break;
|
308 | bdd5003a | pbrook | case 3: /* LCDTiming3 */ |
309 | bdd5003a | pbrook | s->timing[3] = val;
|
310 | bdd5003a | pbrook | break;
|
311 | bdd5003a | pbrook | case 4: /* LCDUPBASE */ |
312 | bdd5003a | pbrook | s->upbase = val; |
313 | bdd5003a | pbrook | break;
|
314 | bdd5003a | pbrook | case 5: /* LCDLPBASE */ |
315 | bdd5003a | pbrook | s->lpbase = val; |
316 | bdd5003a | pbrook | break;
|
317 | bdd5003a | pbrook | case 6: /* LCDIMSC */ |
318 | cdbdb648 | pbrook | if (s->versatile)
|
319 | cdbdb648 | pbrook | goto control;
|
320 | cdbdb648 | pbrook | imsc:
|
321 | bdd5003a | pbrook | s->int_mask = val; |
322 | bdd5003a | pbrook | pl110_update(s); |
323 | bdd5003a | pbrook | break;
|
324 | bdd5003a | pbrook | case 7: /* LCDControl */ |
325 | cdbdb648 | pbrook | if (s->versatile)
|
326 | cdbdb648 | pbrook | goto imsc;
|
327 | cdbdb648 | pbrook | control:
|
328 | bdd5003a | pbrook | s->cr = val; |
329 | bdd5003a | pbrook | s->bpp = (val >> 1) & 7; |
330 | bdd5003a | pbrook | if (pl110_enabled(s)) {
|
331 | 3023f332 | aliguori | qemu_console_resize(s->ds, s->cols, s->rows); |
332 | bdd5003a | pbrook | } |
333 | bdd5003a | pbrook | break;
|
334 | bdd5003a | pbrook | case 10: /* LCDICR */ |
335 | bdd5003a | pbrook | s->int_status &= ~val; |
336 | bdd5003a | pbrook | pl110_update(s); |
337 | bdd5003a | pbrook | break;
|
338 | bdd5003a | pbrook | default:
|
339 | 2ac71179 | Paul Brook | hw_error("pl110_write: Bad offset %x\n", (int)offset); |
340 | bdd5003a | pbrook | } |
341 | bdd5003a | pbrook | } |
342 | bdd5003a | pbrook | |
343 | d60efc6b | Blue Swirl | static CPUReadMemoryFunc * const pl110_readfn[] = { |
344 | bdd5003a | pbrook | pl110_read, |
345 | bdd5003a | pbrook | pl110_read, |
346 | bdd5003a | pbrook | pl110_read |
347 | bdd5003a | pbrook | }; |
348 | bdd5003a | pbrook | |
349 | d60efc6b | Blue Swirl | static CPUWriteMemoryFunc * const pl110_writefn[] = { |
350 | bdd5003a | pbrook | pl110_write, |
351 | bdd5003a | pbrook | pl110_write, |
352 | bdd5003a | pbrook | pl110_write |
353 | bdd5003a | pbrook | }; |
354 | bdd5003a | pbrook | |
355 | 81a322d4 | Gerd Hoffmann | static int pl110_init(SysBusDevice *dev) |
356 | bdd5003a | pbrook | { |
357 | 2e9bdce5 | Paul Brook | pl110_state *s = FROM_SYSBUS(pl110_state, dev); |
358 | bdd5003a | pbrook | int iomemtype;
|
359 | bdd5003a | pbrook | |
360 | 1eed09cb | Avi Kivity | iomemtype = cpu_register_io_memory(pl110_readfn, |
361 | bdd5003a | pbrook | pl110_writefn, s); |
362 | 2e9bdce5 | Paul Brook | sysbus_init_mmio(dev, 0x1000, iomemtype);
|
363 | 2e9bdce5 | Paul Brook | sysbus_init_irq(dev, &s->irq); |
364 | 3023f332 | aliguori | s->ds = graphic_console_init(pl110_update_display, |
365 | 3023f332 | aliguori | pl110_invalidate_display, |
366 | 3023f332 | aliguori | NULL, NULL, s); |
367 | bdd5003a | pbrook | /* ??? Save/restore. */
|
368 | 81a322d4 | Gerd Hoffmann | return 0; |
369 | bdd5003a | pbrook | } |
370 | 2e9bdce5 | Paul Brook | |
371 | 81a322d4 | Gerd Hoffmann | static int pl110_versatile_init(SysBusDevice *dev) |
372 | 2e9bdce5 | Paul Brook | { |
373 | 2e9bdce5 | Paul Brook | pl110_state *s = FROM_SYSBUS(pl110_state, dev); |
374 | 2e9bdce5 | Paul Brook | s->versatile = 1;
|
375 | 81a322d4 | Gerd Hoffmann | return pl110_init(dev);
|
376 | 2e9bdce5 | Paul Brook | } |
377 | 2e9bdce5 | Paul Brook | |
378 | 2e9bdce5 | Paul Brook | static void pl110_register_devices(void) |
379 | 2e9bdce5 | Paul Brook | { |
380 | 2e9bdce5 | Paul Brook | sysbus_register_dev("pl110", sizeof(pl110_state), pl110_init); |
381 | 2e9bdce5 | Paul Brook | sysbus_register_dev("pl110_versatile", sizeof(pl110_state), |
382 | 2e9bdce5 | Paul Brook | pl110_versatile_init); |
383 | 2e9bdce5 | Paul Brook | } |
384 | 2e9bdce5 | Paul Brook | |
385 | 2e9bdce5 | Paul Brook | device_init(pl110_register_devices) |