2 * Marvell MV88W8618 / Freecom MusicPal emulation.
4 * Copyright (c) 2008 Jan Kiszka
6 * This code is licenced under the GNU GPL v2.
16 #include "qemu-timer.h"
20 #include "audio/audio.h"
23 #define MP_MISC_BASE 0x80002000
24 #define MP_MISC_SIZE 0x00001000
26 #define MP_ETH_BASE 0x80008000
27 #define MP_ETH_SIZE 0x00001000
29 #define MP_WLAN_BASE 0x8000C000
30 #define MP_WLAN_SIZE 0x00000800
32 #define MP_UART1_BASE 0x8000C840
33 #define MP_UART2_BASE 0x8000C940
35 #define MP_GPIO_BASE 0x8000D000
36 #define MP_GPIO_SIZE 0x00001000
38 #define MP_FLASHCFG_BASE 0x90006000
39 #define MP_FLASHCFG_SIZE 0x00001000
41 #define MP_AUDIO_BASE 0x90007000
42 #define MP_AUDIO_SIZE 0x00001000
44 #define MP_PIC_BASE 0x90008000
45 #define MP_PIC_SIZE 0x00001000
47 #define MP_PIT_BASE 0x90009000
48 #define MP_PIT_SIZE 0x00001000
50 #define MP_LCD_BASE 0x9000c000
51 #define MP_LCD_SIZE 0x00001000
53 #define MP_SRAM_BASE 0xC0000000
54 #define MP_SRAM_SIZE 0x00020000
56 #define MP_RAM_DEFAULT_SIZE 32*1024*1024
57 #define MP_FLASH_SIZE_MAX 32*1024*1024
59 #define MP_TIMER1_IRQ 4
60 #define MP_TIMER2_IRQ 5
61 #define MP_TIMER3_IRQ 6
62 #define MP_TIMER4_IRQ 7
65 #define MP_UART1_IRQ 11
66 #define MP_UART2_IRQ 11
67 #define MP_GPIO_IRQ 12
69 #define MP_AUDIO_IRQ 30
71 static uint32_t gpio_in_state
= 0xffffffff;
72 static uint32_t gpio_isr
;
73 static uint32_t gpio_out_state
;
74 static ram_addr_t sram_off
;
76 typedef enum i2c_state
{
99 typedef struct i2c_interface
{
108 static void i2c_enter_stop(i2c_interface
*i2c
)
110 if (i2c
->current_addr
>= 0)
111 i2c_end_transfer(i2c
->bus
);
112 i2c
->current_addr
= -1;
113 i2c
->state
= STOPPED
;
116 static void i2c_state_update(i2c_interface
*i2c
, int data
, int clock
)
121 switch (i2c
->state
) {
123 if (data
== 0 && i2c
->last_data
== 1 && clock
== 1)
124 i2c
->state
= INITIALIZING
;
128 if (clock
== 0 && i2c
->last_clock
== 1 && data
== 0)
129 i2c
->state
= SENDING_BIT7
;
134 case SENDING_BIT7
... SENDING_BIT0
:
135 if (clock
== 0 && i2c
->last_clock
== 1) {
136 i2c
->buffer
= (i2c
->buffer
<< 1) | data
;
137 i2c
->state
++; /* will end up in WAITING_FOR_ACK */
138 } else if (data
== 1 && i2c
->last_data
== 0 && clock
== 1)
142 case WAITING_FOR_ACK
:
143 if (clock
== 0 && i2c
->last_clock
== 1) {
144 if (i2c
->current_addr
< 0) {
145 i2c
->current_addr
= i2c
->buffer
;
146 i2c_start_transfer(i2c
->bus
, i2c
->current_addr
& 0xfe,
149 i2c_send(i2c
->bus
, i2c
->buffer
);
150 if (i2c
->current_addr
& 1) {
151 i2c
->state
= RECEIVING_BIT7
;
152 i2c
->buffer
= i2c_recv(i2c
->bus
);
154 i2c
->state
= SENDING_BIT7
;
155 } else if (data
== 1 && i2c
->last_data
== 0 && clock
== 1)
159 case RECEIVING_BIT7
... RECEIVING_BIT0
:
160 if (clock
== 0 && i2c
->last_clock
== 1) {
161 i2c
->state
++; /* will end up in SENDING_ACK */
163 } else if (data
== 1 && i2c
->last_data
== 0 && clock
== 1)
168 if (clock
== 0 && i2c
->last_clock
== 1) {
169 i2c
->state
= RECEIVING_BIT7
;
171 i2c
->buffer
= i2c_recv(i2c
->bus
);
174 } else if (data
== 1 && i2c
->last_data
== 0 && clock
== 1)
179 i2c
->last_data
= data
;
180 i2c
->last_clock
= clock
;
183 static int i2c_get_data(i2c_interface
*i2c
)
188 switch (i2c
->state
) {
189 case RECEIVING_BIT7
... RECEIVING_BIT0
:
190 return (i2c
->buffer
>> 7);
192 case WAITING_FOR_ACK
:
198 static i2c_interface
*mixer_i2c
;
202 /* Audio register offsets */
203 #define MP_AUDIO_PLAYBACK_MODE 0x00
204 #define MP_AUDIO_CLOCK_DIV 0x18
205 #define MP_AUDIO_IRQ_STATUS 0x20
206 #define MP_AUDIO_IRQ_ENABLE 0x24
207 #define MP_AUDIO_TX_START_LO 0x28
208 #define MP_AUDIO_TX_THRESHOLD 0x2C
209 #define MP_AUDIO_TX_STATUS 0x38
210 #define MP_AUDIO_TX_START_HI 0x40
212 /* Status register and IRQ enable bits */
213 #define MP_AUDIO_TX_HALF (1 << 6)
214 #define MP_AUDIO_TX_FULL (1 << 7)
216 /* Playback mode bits */
217 #define MP_AUDIO_16BIT_SAMPLE (1 << 0)
218 #define MP_AUDIO_PLAYBACK_EN (1 << 7)
219 #define MP_AUDIO_CLOCK_24MHZ (1 << 9)
220 #define MP_AUDIO_MONO (1 << 14)
222 /* Wolfson 8750 I2C address */
223 #define MP_WM_ADDR 0x34
225 static const char audio_name
[] = "mv88w8618";
227 typedef struct musicpal_audio_state
{
229 uint32_t playback_mode
;
232 unsigned long phys_buf
;
233 uint32_t target_buffer
;
234 unsigned int threshold
;
235 unsigned int play_pos
;
236 unsigned int last_free
;
239 } musicpal_audio_state
;
241 static void audio_callback(void *opaque
, int free_out
, int free_in
)
243 musicpal_audio_state
*s
= opaque
;
244 int16_t *codec_buffer
;
249 if (!(s
->playback_mode
& MP_AUDIO_PLAYBACK_EN
))
252 if (s
->playback_mode
& MP_AUDIO_16BIT_SAMPLE
)
255 if (!(s
->playback_mode
& MP_AUDIO_MONO
))
258 block_size
= s
->threshold
/2;
259 if (free_out
- s
->last_free
< block_size
)
262 if (block_size
> 4096)
265 cpu_physical_memory_read(s
->target_buffer
+ s
->play_pos
, (void *)buf
,
268 if (s
->playback_mode
& MP_AUDIO_16BIT_SAMPLE
) {
269 if (s
->playback_mode
& MP_AUDIO_MONO
) {
270 codec_buffer
= wm8750_dac_buffer(s
->wm
, block_size
>> 1);
271 for (pos
= 0; pos
< block_size
; pos
+= 2) {
272 *codec_buffer
++ = *(int16_t *)mem_buffer
;
273 *codec_buffer
++ = *(int16_t *)mem_buffer
;
277 memcpy(wm8750_dac_buffer(s
->wm
, block_size
>> 2),
278 (uint32_t *)mem_buffer
, block_size
);
280 if (s
->playback_mode
& MP_AUDIO_MONO
) {
281 codec_buffer
= wm8750_dac_buffer(s
->wm
, block_size
);
282 for (pos
= 0; pos
< block_size
; pos
++) {
283 *codec_buffer
++ = cpu_to_le16(256 * *mem_buffer
);
284 *codec_buffer
++ = cpu_to_le16(256 * *mem_buffer
++);
287 codec_buffer
= wm8750_dac_buffer(s
->wm
, block_size
>> 1);
288 for (pos
= 0; pos
< block_size
; pos
+= 2) {
289 *codec_buffer
++ = cpu_to_le16(256 * *mem_buffer
++);
290 *codec_buffer
++ = cpu_to_le16(256 * *mem_buffer
++);
294 wm8750_dac_commit(s
->wm
);
296 s
->last_free
= free_out
- block_size
;
298 if (s
->play_pos
== 0) {
299 s
->status
|= MP_AUDIO_TX_HALF
;
300 s
->play_pos
= block_size
;
302 s
->status
|= MP_AUDIO_TX_FULL
;
306 if (s
->status
& s
->irq_enable
)
307 qemu_irq_raise(s
->irq
);
310 static void musicpal_audio_clock_update(musicpal_audio_state
*s
)
314 if (s
->playback_mode
& MP_AUDIO_CLOCK_24MHZ
)
315 rate
= 24576000 / 64; /* 24.576MHz */
317 rate
= 11289600 / 64; /* 11.2896MHz */
319 rate
/= ((s
->clock_div
>> 8) & 0xff) + 1;
321 wm8750_set_bclk_in(s
->wm
, rate
);
324 static uint32_t musicpal_audio_read(void *opaque
, target_phys_addr_t offset
)
326 musicpal_audio_state
*s
= opaque
;
329 case MP_AUDIO_PLAYBACK_MODE
:
330 return s
->playback_mode
;
332 case MP_AUDIO_CLOCK_DIV
:
335 case MP_AUDIO_IRQ_STATUS
:
338 case MP_AUDIO_IRQ_ENABLE
:
339 return s
->irq_enable
;
341 case MP_AUDIO_TX_STATUS
:
342 return s
->play_pos
>> 2;
349 static void musicpal_audio_write(void *opaque
, target_phys_addr_t offset
,
352 musicpal_audio_state
*s
= opaque
;
355 case MP_AUDIO_PLAYBACK_MODE
:
356 if (value
& MP_AUDIO_PLAYBACK_EN
&&
357 !(s
->playback_mode
& MP_AUDIO_PLAYBACK_EN
)) {
362 s
->playback_mode
= value
;
363 musicpal_audio_clock_update(s
);
366 case MP_AUDIO_CLOCK_DIV
:
367 s
->clock_div
= value
;
370 musicpal_audio_clock_update(s
);
373 case MP_AUDIO_IRQ_STATUS
:
377 case MP_AUDIO_IRQ_ENABLE
:
378 s
->irq_enable
= value
;
379 if (s
->status
& s
->irq_enable
)
380 qemu_irq_raise(s
->irq
);
383 case MP_AUDIO_TX_START_LO
:
384 s
->phys_buf
= (s
->phys_buf
& 0xFFFF0000) | (value
& 0xFFFF);
385 s
->target_buffer
= s
->phys_buf
;
390 case MP_AUDIO_TX_THRESHOLD
:
391 s
->threshold
= (value
+ 1) * 4;
394 case MP_AUDIO_TX_START_HI
:
395 s
->phys_buf
= (s
->phys_buf
& 0xFFFF) | (value
<< 16);
396 s
->target_buffer
= s
->phys_buf
;
403 static void musicpal_audio_reset(void *opaque
)
405 musicpal_audio_state
*s
= opaque
;
407 s
->playback_mode
= 0;
412 static CPUReadMemoryFunc
*musicpal_audio_readfn
[] = {
418 static CPUWriteMemoryFunc
*musicpal_audio_writefn
[] = {
419 musicpal_audio_write
,
420 musicpal_audio_write
,
424 static i2c_interface
*musicpal_audio_init(qemu_irq irq
)
426 musicpal_audio_state
*s
;
430 s
= qemu_mallocz(sizeof(musicpal_audio_state
));
433 i2c
= qemu_mallocz(sizeof(i2c_interface
));
434 i2c
->bus
= i2c_init_bus(NULL
, "i2c");
435 i2c
->current_addr
= -1;
437 s
->wm
= i2c_create_slave(i2c
->bus
, "wm8750", MP_WM_ADDR
);
438 wm8750_data_req_set(s
->wm
, audio_callback
, s
);
440 iomemtype
= cpu_register_io_memory(musicpal_audio_readfn
,
441 musicpal_audio_writefn
, s
);
442 cpu_register_physical_memory(MP_AUDIO_BASE
, MP_AUDIO_SIZE
, iomemtype
);
444 qemu_register_reset(musicpal_audio_reset
, s
);
448 #else /* !HAS_AUDIO */
449 static i2c_interface
*musicpal_audio_init(qemu_irq irq
)
453 #endif /* !HAS_AUDIO */
455 /* Ethernet register offsets */
456 #define MP_ETH_SMIR 0x010
457 #define MP_ETH_PCXR 0x408
458 #define MP_ETH_SDCMR 0x448
459 #define MP_ETH_ICR 0x450
460 #define MP_ETH_IMR 0x458
461 #define MP_ETH_FRDP0 0x480
462 #define MP_ETH_FRDP1 0x484
463 #define MP_ETH_FRDP2 0x488
464 #define MP_ETH_FRDP3 0x48C
465 #define MP_ETH_CRDP0 0x4A0
466 #define MP_ETH_CRDP1 0x4A4
467 #define MP_ETH_CRDP2 0x4A8
468 #define MP_ETH_CRDP3 0x4AC
469 #define MP_ETH_CTDP0 0x4E0
470 #define MP_ETH_CTDP1 0x4E4
471 #define MP_ETH_CTDP2 0x4E8
472 #define MP_ETH_CTDP3 0x4EC
475 #define MP_ETH_SMIR_DATA 0x0000FFFF
476 #define MP_ETH_SMIR_ADDR 0x03FF0000
477 #define MP_ETH_SMIR_OPCODE (1 << 26) /* Read value */
478 #define MP_ETH_SMIR_RDVALID (1 << 27)
481 #define MP_ETH_PHY1_BMSR 0x00210000
482 #define MP_ETH_PHY1_PHYSID1 0x00410000
483 #define MP_ETH_PHY1_PHYSID2 0x00610000
485 #define MP_PHY_BMSR_LINK 0x0004
486 #define MP_PHY_BMSR_AUTONEG 0x0008
488 #define MP_PHY_88E3015 0x01410E20
490 /* TX descriptor status */
491 #define MP_ETH_TX_OWN (1 << 31)
493 /* RX descriptor status */
494 #define MP_ETH_RX_OWN (1 << 31)
496 /* Interrupt cause/mask bits */
497 #define MP_ETH_IRQ_RX_BIT 0
498 #define MP_ETH_IRQ_RX (1 << MP_ETH_IRQ_RX_BIT)
499 #define MP_ETH_IRQ_TXHI_BIT 2
500 #define MP_ETH_IRQ_TXLO_BIT 3
502 /* Port config bits */
503 #define MP_ETH_PCXR_2BSM_BIT 28 /* 2-byte incoming suffix */
505 /* SDMA command bits */
506 #define MP_ETH_CMD_TXHI (1 << 23)
507 #define MP_ETH_CMD_TXLO (1 << 22)
509 typedef struct mv88w8618_tx_desc
{
517 typedef struct mv88w8618_rx_desc
{
520 uint16_t buffer_size
;
525 typedef struct mv88w8618_eth_state
{
533 uint32_t tx_queue
[2];
534 uint32_t rx_queue
[4];
535 uint32_t frx_queue
[4];
538 } mv88w8618_eth_state
;
540 static void eth_rx_desc_put(uint32_t addr
, mv88w8618_rx_desc
*desc
)
542 cpu_to_le32s(&desc
->cmdstat
);
543 cpu_to_le16s(&desc
->bytes
);
544 cpu_to_le16s(&desc
->buffer_size
);
545 cpu_to_le32s(&desc
->buffer
);
546 cpu_to_le32s(&desc
->next
);
547 cpu_physical_memory_write(addr
, (void *)desc
, sizeof(*desc
));
550 static void eth_rx_desc_get(uint32_t addr
, mv88w8618_rx_desc
*desc
)
552 cpu_physical_memory_read(addr
, (void *)desc
, sizeof(*desc
));
553 le32_to_cpus(&desc
->cmdstat
);
554 le16_to_cpus(&desc
->bytes
);
555 le16_to_cpus(&desc
->buffer_size
);
556 le32_to_cpus(&desc
->buffer
);
557 le32_to_cpus(&desc
->next
);
560 static int eth_can_receive(VLANClientState
*vc
)
565 static ssize_t
eth_receive(VLANClientState
*vc
, const uint8_t *buf
, size_t size
)
567 mv88w8618_eth_state
*s
= vc
->opaque
;
569 mv88w8618_rx_desc desc
;
572 for (i
= 0; i
< 4; i
++) {
573 desc_addr
= s
->cur_rx
[i
];
577 eth_rx_desc_get(desc_addr
, &desc
);
578 if ((desc
.cmdstat
& MP_ETH_RX_OWN
) && desc
.buffer_size
>= size
) {
579 cpu_physical_memory_write(desc
.buffer
+ s
->vlan_header
,
581 desc
.bytes
= size
+ s
->vlan_header
;
582 desc
.cmdstat
&= ~MP_ETH_RX_OWN
;
583 s
->cur_rx
[i
] = desc
.next
;
585 s
->icr
|= MP_ETH_IRQ_RX
;
587 qemu_irq_raise(s
->irq
);
588 eth_rx_desc_put(desc_addr
, &desc
);
591 desc_addr
= desc
.next
;
592 } while (desc_addr
!= s
->rx_queue
[i
]);
597 static void eth_tx_desc_put(uint32_t addr
, mv88w8618_tx_desc
*desc
)
599 cpu_to_le32s(&desc
->cmdstat
);
600 cpu_to_le16s(&desc
->res
);
601 cpu_to_le16s(&desc
->bytes
);
602 cpu_to_le32s(&desc
->buffer
);
603 cpu_to_le32s(&desc
->next
);
604 cpu_physical_memory_write(addr
, (void *)desc
, sizeof(*desc
));
607 static void eth_tx_desc_get(uint32_t addr
, mv88w8618_tx_desc
*desc
)
609 cpu_physical_memory_read(addr
, (void *)desc
, sizeof(*desc
));
610 le32_to_cpus(&desc
->cmdstat
);
611 le16_to_cpus(&desc
->res
);
612 le16_to_cpus(&desc
->bytes
);
613 le32_to_cpus(&desc
->buffer
);
614 le32_to_cpus(&desc
->next
);
617 static void eth_send(mv88w8618_eth_state
*s
, int queue_index
)
619 uint32_t desc_addr
= s
->tx_queue
[queue_index
];
620 mv88w8618_tx_desc desc
;
626 eth_tx_desc_get(desc_addr
, &desc
);
627 if (desc
.cmdstat
& MP_ETH_TX_OWN
) {
630 cpu_physical_memory_read(desc
.buffer
, buf
, len
);
631 qemu_send_packet(s
->vc
, buf
, len
);
633 desc
.cmdstat
&= ~MP_ETH_TX_OWN
;
634 s
->icr
|= 1 << (MP_ETH_IRQ_TXLO_BIT
- queue_index
);
635 eth_tx_desc_put(desc_addr
, &desc
);
637 desc_addr
= desc
.next
;
638 } while (desc_addr
!= s
->tx_queue
[queue_index
]);
641 static uint32_t mv88w8618_eth_read(void *opaque
, target_phys_addr_t offset
)
643 mv88w8618_eth_state
*s
= opaque
;
647 if (s
->smir
& MP_ETH_SMIR_OPCODE
) {
648 switch (s
->smir
& MP_ETH_SMIR_ADDR
) {
649 case MP_ETH_PHY1_BMSR
:
650 return MP_PHY_BMSR_LINK
| MP_PHY_BMSR_AUTONEG
|
652 case MP_ETH_PHY1_PHYSID1
:
653 return (MP_PHY_88E3015
>> 16) | MP_ETH_SMIR_RDVALID
;
654 case MP_ETH_PHY1_PHYSID2
:
655 return (MP_PHY_88E3015
& 0xFFFF) | MP_ETH_SMIR_RDVALID
;
657 return MP_ETH_SMIR_RDVALID
;
668 case MP_ETH_FRDP0
... MP_ETH_FRDP3
:
669 return s
->frx_queue
[(offset
- MP_ETH_FRDP0
)/4];
671 case MP_ETH_CRDP0
... MP_ETH_CRDP3
:
672 return s
->rx_queue
[(offset
- MP_ETH_CRDP0
)/4];
674 case MP_ETH_CTDP0
... MP_ETH_CTDP3
:
675 return s
->tx_queue
[(offset
- MP_ETH_CTDP0
)/4];
682 static void mv88w8618_eth_write(void *opaque
, target_phys_addr_t offset
,
685 mv88w8618_eth_state
*s
= opaque
;
693 s
->vlan_header
= ((value
>> MP_ETH_PCXR_2BSM_BIT
) & 1) * 2;
697 if (value
& MP_ETH_CMD_TXHI
)
699 if (value
& MP_ETH_CMD_TXLO
)
701 if (value
& (MP_ETH_CMD_TXHI
| MP_ETH_CMD_TXLO
) && s
->icr
& s
->imr
)
702 qemu_irq_raise(s
->irq
);
712 qemu_irq_raise(s
->irq
);
715 case MP_ETH_FRDP0
... MP_ETH_FRDP3
:
716 s
->frx_queue
[(offset
- MP_ETH_FRDP0
)/4] = value
;
719 case MP_ETH_CRDP0
... MP_ETH_CRDP3
:
720 s
->rx_queue
[(offset
- MP_ETH_CRDP0
)/4] =
721 s
->cur_rx
[(offset
- MP_ETH_CRDP0
)/4] = value
;
724 case MP_ETH_CTDP0
... MP_ETH_CTDP3
:
725 s
->tx_queue
[(offset
- MP_ETH_CTDP0
)/4] = value
;
730 static CPUReadMemoryFunc
*mv88w8618_eth_readfn
[] = {
736 static CPUWriteMemoryFunc
*mv88w8618_eth_writefn
[] = {
742 static void eth_cleanup(VLANClientState
*vc
)
744 mv88w8618_eth_state
*s
= vc
->opaque
;
746 cpu_unregister_io_memory(s
->mmio_index
);
751 static void mv88w8618_eth_init(SysBusDevice
*dev
)
753 mv88w8618_eth_state
*s
= FROM_SYSBUS(mv88w8618_eth_state
, dev
);
755 sysbus_init_irq(dev
, &s
->irq
);
756 s
->vc
= qdev_get_vlan_client(&dev
->qdev
,
757 eth_can_receive
, eth_receive
, NULL
,
759 s
->mmio_index
= cpu_register_io_memory(mv88w8618_eth_readfn
,
760 mv88w8618_eth_writefn
, s
);
761 sysbus_init_mmio(dev
, MP_ETH_SIZE
, s
->mmio_index
);
764 /* LCD register offsets */
765 #define MP_LCD_IRQCTRL 0x180
766 #define MP_LCD_IRQSTAT 0x184
767 #define MP_LCD_SPICTRL 0x1ac
768 #define MP_LCD_INST 0x1bc
769 #define MP_LCD_DATA 0x1c0
772 #define MP_LCD_SPI_DATA 0x00100011
773 #define MP_LCD_SPI_CMD 0x00104011
774 #define MP_LCD_SPI_INVALID 0x00000000
777 #define MP_LCD_INST_SETPAGE0 0xB0
779 #define MP_LCD_INST_SETPAGE7 0xB7
781 #define MP_LCD_TEXTCOLOR 0xe0e0ff /* RRGGBB */
783 typedef struct musicpal_lcd_state
{
790 uint8_t video_ram
[128*64/8];
791 } musicpal_lcd_state
;
793 static uint32_t lcd_brightness
;
795 static uint8_t scale_lcd_color(uint8_t col
)
799 switch (lcd_brightness
) {
800 case 0x00000007: /* 0 */
803 case 0x00020000: /* 1 */
804 return (tmp
* 1) / 7;
806 case 0x00020001: /* 2 */
807 return (tmp
* 2) / 7;
809 case 0x00040000: /* 3 */
810 return (tmp
* 3) / 7;
812 case 0x00010006: /* 4 */
813 return (tmp
* 4) / 7;
815 case 0x00020005: /* 5 */
816 return (tmp
* 5) / 7;
818 case 0x00040003: /* 6 */
819 return (tmp
* 6) / 7;
821 case 0x00030004: /* 7 */
827 #define SET_LCD_PIXEL(depth, type) \
828 static inline void glue(set_lcd_pixel, depth) \
829 (musicpal_lcd_state *s, int x, int y, type col) \
832 type *pixel = &((type *) ds_get_data(s->ds))[(y * 128 * 3 + x) * 3]; \
834 for (dy = 0; dy < 3; dy++, pixel += 127 * 3) \
835 for (dx = 0; dx < 3; dx++, pixel++) \
838 SET_LCD_PIXEL(8, uint8_t)
839 SET_LCD_PIXEL(16, uint16_t)
840 SET_LCD_PIXEL(32, uint32_t)
842 #include "pixel_ops.h"
844 static void lcd_refresh(void *opaque
)
846 musicpal_lcd_state
*s
= opaque
;
849 switch (ds_get_bits_per_pixel(s
->ds
)) {
852 #define LCD_REFRESH(depth, func) \
854 col = func(scale_lcd_color((MP_LCD_TEXTCOLOR >> 16) & 0xff), \
855 scale_lcd_color((MP_LCD_TEXTCOLOR >> 8) & 0xff), \
856 scale_lcd_color(MP_LCD_TEXTCOLOR & 0xff)); \
857 for (x = 0; x < 128; x++) \
858 for (y = 0; y < 64; y++) \
859 if (s->video_ram[x + (y/8)*128] & (1 << (y % 8))) \
860 glue(set_lcd_pixel, depth)(s, x, y, col); \
862 glue(set_lcd_pixel, depth)(s, x, y, 0); \
864 LCD_REFRESH(8, rgb_to_pixel8
)
865 LCD_REFRESH(16, rgb_to_pixel16
)
866 LCD_REFRESH(32, (is_surface_bgr(s
->ds
->surface
) ?
867 rgb_to_pixel32bgr
: rgb_to_pixel32
))
869 hw_error("unsupported colour depth %i\n",
870 ds_get_bits_per_pixel(s
->ds
));
873 dpy_update(s
->ds
, 0, 0, 128*3, 64*3);
876 static void lcd_invalidate(void *opaque
)
880 static uint32_t musicpal_lcd_read(void *opaque
, target_phys_addr_t offset
)
882 musicpal_lcd_state
*s
= opaque
;
893 static void musicpal_lcd_write(void *opaque
, target_phys_addr_t offset
,
896 musicpal_lcd_state
*s
= opaque
;
904 if (value
== MP_LCD_SPI_DATA
|| value
== MP_LCD_SPI_CMD
)
907 s
->mode
= MP_LCD_SPI_INVALID
;
911 if (value
>= MP_LCD_INST_SETPAGE0
&& value
<= MP_LCD_INST_SETPAGE7
) {
912 s
->page
= value
- MP_LCD_INST_SETPAGE0
;
918 if (s
->mode
== MP_LCD_SPI_CMD
) {
919 if (value
>= MP_LCD_INST_SETPAGE0
&&
920 value
<= MP_LCD_INST_SETPAGE7
) {
921 s
->page
= value
- MP_LCD_INST_SETPAGE0
;
924 } else if (s
->mode
== MP_LCD_SPI_DATA
) {
925 s
->video_ram
[s
->page
*128 + s
->page_off
] = value
;
926 s
->page_off
= (s
->page_off
+ 1) & 127;
932 static CPUReadMemoryFunc
*musicpal_lcd_readfn
[] = {
938 static CPUWriteMemoryFunc
*musicpal_lcd_writefn
[] = {
944 static void musicpal_lcd_init(SysBusDevice
*dev
)
946 musicpal_lcd_state
*s
= FROM_SYSBUS(musicpal_lcd_state
, dev
);
949 iomemtype
= cpu_register_io_memory(musicpal_lcd_readfn
,
950 musicpal_lcd_writefn
, s
);
951 sysbus_init_mmio(dev
, MP_LCD_SIZE
, iomemtype
);
952 cpu_register_physical_memory(MP_LCD_BASE
, MP_LCD_SIZE
, iomemtype
);
954 s
->ds
= graphic_console_init(lcd_refresh
, lcd_invalidate
,
956 qemu_console_resize(s
->ds
, 128*3, 64*3);
959 /* PIC register offsets */
960 #define MP_PIC_STATUS 0x00
961 #define MP_PIC_ENABLE_SET 0x08
962 #define MP_PIC_ENABLE_CLR 0x0C
964 typedef struct mv88w8618_pic_state
970 } mv88w8618_pic_state
;
972 static void mv88w8618_pic_update(mv88w8618_pic_state
*s
)
974 qemu_set_irq(s
->parent_irq
, (s
->level
& s
->enabled
));
977 static void mv88w8618_pic_set_irq(void *opaque
, int irq
, int level
)
979 mv88w8618_pic_state
*s
= opaque
;
982 s
->level
|= 1 << irq
;
984 s
->level
&= ~(1 << irq
);
985 mv88w8618_pic_update(s
);
988 static uint32_t mv88w8618_pic_read(void *opaque
, target_phys_addr_t offset
)
990 mv88w8618_pic_state
*s
= opaque
;
994 return s
->level
& s
->enabled
;
1001 static void mv88w8618_pic_write(void *opaque
, target_phys_addr_t offset
,
1004 mv88w8618_pic_state
*s
= opaque
;
1007 case MP_PIC_ENABLE_SET
:
1008 s
->enabled
|= value
;
1011 case MP_PIC_ENABLE_CLR
:
1012 s
->enabled
&= ~value
;
1016 mv88w8618_pic_update(s
);
1019 static void mv88w8618_pic_reset(void *opaque
)
1021 mv88w8618_pic_state
*s
= opaque
;
1027 static CPUReadMemoryFunc
*mv88w8618_pic_readfn
[] = {
1033 static CPUWriteMemoryFunc
*mv88w8618_pic_writefn
[] = {
1034 mv88w8618_pic_write
,
1035 mv88w8618_pic_write
,
1039 static void mv88w8618_pic_init(SysBusDevice
*dev
)
1041 mv88w8618_pic_state
*s
= FROM_SYSBUS(mv88w8618_pic_state
, dev
);
1044 qdev_init_gpio_in(&dev
->qdev
, mv88w8618_pic_set_irq
, 32);
1045 sysbus_init_irq(dev
, &s
->parent_irq
);
1046 iomemtype
= cpu_register_io_memory(mv88w8618_pic_readfn
,
1047 mv88w8618_pic_writefn
, s
);
1048 sysbus_init_mmio(dev
, MP_PIC_SIZE
, iomemtype
);
1050 qemu_register_reset(mv88w8618_pic_reset
, s
);
1053 /* PIT register offsets */
1054 #define MP_PIT_TIMER1_LENGTH 0x00
1056 #define MP_PIT_TIMER4_LENGTH 0x0C
1057 #define MP_PIT_CONTROL 0x10
1058 #define MP_PIT_TIMER1_VALUE 0x14
1060 #define MP_PIT_TIMER4_VALUE 0x20
1061 #define MP_BOARD_RESET 0x34
1063 /* Magic board reset value (probably some watchdog behind it) */
1064 #define MP_BOARD_RESET_MAGIC 0x10000
1066 typedef struct mv88w8618_timer_state
{
1067 ptimer_state
*ptimer
;
1071 } mv88w8618_timer_state
;
1073 typedef struct mv88w8618_pit_state
{
1074 SysBusDevice busdev
;
1075 mv88w8618_timer_state timer
[4];
1077 } mv88w8618_pit_state
;
1079 static void mv88w8618_timer_tick(void *opaque
)
1081 mv88w8618_timer_state
*s
= opaque
;
1083 qemu_irq_raise(s
->irq
);
1086 static void mv88w8618_timer_init(SysBusDevice
*dev
, mv88w8618_timer_state
*s
,
1091 sysbus_init_irq(dev
, &s
->irq
);
1094 bh
= qemu_bh_new(mv88w8618_timer_tick
, s
);
1095 s
->ptimer
= ptimer_init(bh
);
1098 static uint32_t mv88w8618_pit_read(void *opaque
, target_phys_addr_t offset
)
1100 mv88w8618_pit_state
*s
= opaque
;
1101 mv88w8618_timer_state
*t
;
1104 case MP_PIT_TIMER1_VALUE
... MP_PIT_TIMER4_VALUE
:
1105 t
= &s
->timer
[(offset
-MP_PIT_TIMER1_VALUE
) >> 2];
1106 return ptimer_get_count(t
->ptimer
);
1113 static void mv88w8618_pit_write(void *opaque
, target_phys_addr_t offset
,
1116 mv88w8618_pit_state
*s
= opaque
;
1117 mv88w8618_timer_state
*t
;
1121 case MP_PIT_TIMER1_LENGTH
... MP_PIT_TIMER4_LENGTH
:
1122 t
= &s
->timer
[offset
>> 2];
1124 ptimer_set_limit(t
->ptimer
, t
->limit
, 1);
1127 case MP_PIT_CONTROL
:
1128 for (i
= 0; i
< 4; i
++) {
1131 ptimer_set_limit(t
->ptimer
, t
->limit
, 0);
1132 ptimer_set_freq(t
->ptimer
, t
->freq
);
1133 ptimer_run(t
->ptimer
, 0);
1139 case MP_BOARD_RESET
:
1140 if (value
== MP_BOARD_RESET_MAGIC
)
1141 qemu_system_reset_request();
1146 static CPUReadMemoryFunc
*mv88w8618_pit_readfn
[] = {
1152 static CPUWriteMemoryFunc
*mv88w8618_pit_writefn
[] = {
1153 mv88w8618_pit_write
,
1154 mv88w8618_pit_write
,
1158 static void mv88w8618_pit_init(SysBusDevice
*dev
)
1161 mv88w8618_pit_state
*s
= FROM_SYSBUS(mv88w8618_pit_state
, dev
);
1164 /* Letting them all run at 1 MHz is likely just a pragmatic
1165 * simplification. */
1166 for (i
= 0; i
< 4; i
++) {
1167 mv88w8618_timer_init(dev
, &s
->timer
[i
], 1000000);
1170 iomemtype
= cpu_register_io_memory(mv88w8618_pit_readfn
,
1171 mv88w8618_pit_writefn
, s
);
1172 sysbus_init_mmio(dev
, MP_PIT_SIZE
, iomemtype
);
1175 /* Flash config register offsets */
1176 #define MP_FLASHCFG_CFGR0 0x04
1178 typedef struct mv88w8618_flashcfg_state
{
1179 SysBusDevice busdev
;
1181 } mv88w8618_flashcfg_state
;
1183 static uint32_t mv88w8618_flashcfg_read(void *opaque
,
1184 target_phys_addr_t offset
)
1186 mv88w8618_flashcfg_state
*s
= opaque
;
1189 case MP_FLASHCFG_CFGR0
:
1197 static void mv88w8618_flashcfg_write(void *opaque
, target_phys_addr_t offset
,
1200 mv88w8618_flashcfg_state
*s
= opaque
;
1203 case MP_FLASHCFG_CFGR0
:
1209 static CPUReadMemoryFunc
*mv88w8618_flashcfg_readfn
[] = {
1210 mv88w8618_flashcfg_read
,
1211 mv88w8618_flashcfg_read
,
1212 mv88w8618_flashcfg_read
1215 static CPUWriteMemoryFunc
*mv88w8618_flashcfg_writefn
[] = {
1216 mv88w8618_flashcfg_write
,
1217 mv88w8618_flashcfg_write
,
1218 mv88w8618_flashcfg_write
1221 static void mv88w8618_flashcfg_init(SysBusDevice
*dev
)
1224 mv88w8618_flashcfg_state
*s
= FROM_SYSBUS(mv88w8618_flashcfg_state
, dev
);
1226 s
->cfgr0
= 0xfffe4285; /* Default as set by U-Boot for 8 MB flash */
1227 iomemtype
= cpu_register_io_memory(mv88w8618_flashcfg_readfn
,
1228 mv88w8618_flashcfg_writefn
, s
);
1229 sysbus_init_mmio(dev
, MP_FLASHCFG_SIZE
, iomemtype
);
1232 /* Misc register offsets */
1233 #define MP_MISC_BOARD_REVISION 0x18
1235 #define MP_BOARD_REVISION 0x31
1237 static uint32_t musicpal_misc_read(void *opaque
, target_phys_addr_t offset
)
1240 case MP_MISC_BOARD_REVISION
:
1241 return MP_BOARD_REVISION
;
1248 static void musicpal_misc_write(void *opaque
, target_phys_addr_t offset
,
1253 static CPUReadMemoryFunc
*musicpal_misc_readfn
[] = {
1259 static CPUWriteMemoryFunc
*musicpal_misc_writefn
[] = {
1260 musicpal_misc_write
,
1261 musicpal_misc_write
,
1262 musicpal_misc_write
,
1265 static void musicpal_misc_init(void)
1269 iomemtype
= cpu_register_io_memory(musicpal_misc_readfn
,
1270 musicpal_misc_writefn
, NULL
);
1271 cpu_register_physical_memory(MP_MISC_BASE
, MP_MISC_SIZE
, iomemtype
);
1274 /* WLAN register offsets */
1275 #define MP_WLAN_MAGIC1 0x11c
1276 #define MP_WLAN_MAGIC2 0x124
1278 static uint32_t mv88w8618_wlan_read(void *opaque
, target_phys_addr_t offset
)
1281 /* Workaround to allow loading the binary-only wlandrv.ko crap
1282 * from the original Freecom firmware. */
1283 case MP_WLAN_MAGIC1
:
1285 case MP_WLAN_MAGIC2
:
1293 static void mv88w8618_wlan_write(void *opaque
, target_phys_addr_t offset
,
1298 static CPUReadMemoryFunc
*mv88w8618_wlan_readfn
[] = {
1299 mv88w8618_wlan_read
,
1300 mv88w8618_wlan_read
,
1301 mv88w8618_wlan_read
,
1304 static CPUWriteMemoryFunc
*mv88w8618_wlan_writefn
[] = {
1305 mv88w8618_wlan_write
,
1306 mv88w8618_wlan_write
,
1307 mv88w8618_wlan_write
,
1310 static void mv88w8618_wlan_init(SysBusDevice
*dev
)
1314 iomemtype
= cpu_register_io_memory(mv88w8618_wlan_readfn
,
1315 mv88w8618_wlan_writefn
, NULL
);
1316 sysbus_init_mmio(dev
, MP_WLAN_SIZE
, iomemtype
);
1319 /* GPIO register offsets */
1320 #define MP_GPIO_OE_LO 0x008
1321 #define MP_GPIO_OUT_LO 0x00c
1322 #define MP_GPIO_IN_LO 0x010
1323 #define MP_GPIO_ISR_LO 0x020
1324 #define MP_GPIO_OE_HI 0x508
1325 #define MP_GPIO_OUT_HI 0x50c
1326 #define MP_GPIO_IN_HI 0x510
1327 #define MP_GPIO_ISR_HI 0x520
1329 /* GPIO bits & masks */
1330 #define MP_GPIO_WHEEL_VOL (1 << 8)
1331 #define MP_GPIO_WHEEL_VOL_INV (1 << 9)
1332 #define MP_GPIO_WHEEL_NAV (1 << 10)
1333 #define MP_GPIO_WHEEL_NAV_INV (1 << 11)
1334 #define MP_GPIO_LCD_BRIGHTNESS 0x00070000
1335 #define MP_GPIO_BTN_FAVORITS (1 << 19)
1336 #define MP_GPIO_BTN_MENU (1 << 20)
1337 #define MP_GPIO_BTN_VOLUME (1 << 21)
1338 #define MP_GPIO_BTN_NAVIGATION (1 << 22)
1339 #define MP_GPIO_I2C_DATA_BIT 29
1340 #define MP_GPIO_I2C_DATA (1 << MP_GPIO_I2C_DATA_BIT)
1341 #define MP_GPIO_I2C_CLOCK_BIT 30
1343 /* LCD brightness bits in GPIO_OE_HI */
1344 #define MP_OE_LCD_BRIGHTNESS 0x0007
1346 static uint32_t musicpal_gpio_read(void *opaque
, target_phys_addr_t offset
)
1349 case MP_GPIO_OE_HI
: /* used for LCD brightness control */
1350 return lcd_brightness
& MP_OE_LCD_BRIGHTNESS
;
1352 case MP_GPIO_OUT_LO
:
1353 return gpio_out_state
& 0xFFFF;
1354 case MP_GPIO_OUT_HI
:
1355 return gpio_out_state
>> 16;
1358 return gpio_in_state
& 0xFFFF;
1360 /* Update received I2C data */
1361 gpio_in_state
= (gpio_in_state
& ~MP_GPIO_I2C_DATA
) |
1362 (i2c_get_data(mixer_i2c
) << MP_GPIO_I2C_DATA_BIT
);
1363 return gpio_in_state
>> 16;
1365 case MP_GPIO_ISR_LO
:
1366 return gpio_isr
& 0xFFFF;
1367 case MP_GPIO_ISR_HI
:
1368 return gpio_isr
>> 16;
1375 static void musicpal_gpio_write(void *opaque
, target_phys_addr_t offset
,
1379 case MP_GPIO_OE_HI
: /* used for LCD brightness control */
1380 lcd_brightness
= (lcd_brightness
& MP_GPIO_LCD_BRIGHTNESS
) |
1381 (value
& MP_OE_LCD_BRIGHTNESS
);
1384 case MP_GPIO_OUT_LO
:
1385 gpio_out_state
= (gpio_out_state
& 0xFFFF0000) | (value
& 0xFFFF);
1387 case MP_GPIO_OUT_HI
:
1388 gpio_out_state
= (gpio_out_state
& 0xFFFF) | (value
<< 16);
1389 lcd_brightness
= (lcd_brightness
& 0xFFFF) |
1390 (gpio_out_state
& MP_GPIO_LCD_BRIGHTNESS
);
1391 i2c_state_update(mixer_i2c
,
1392 (gpio_out_state
>> MP_GPIO_I2C_DATA_BIT
) & 1,
1393 (gpio_out_state
>> MP_GPIO_I2C_CLOCK_BIT
) & 1);
1399 static CPUReadMemoryFunc
*musicpal_gpio_readfn
[] = {
1405 static CPUWriteMemoryFunc
*musicpal_gpio_writefn
[] = {
1406 musicpal_gpio_write
,
1407 musicpal_gpio_write
,
1408 musicpal_gpio_write
,
1411 static void musicpal_gpio_init(void)
1415 iomemtype
= cpu_register_io_memory(musicpal_gpio_readfn
,
1416 musicpal_gpio_writefn
, NULL
);
1417 cpu_register_physical_memory(MP_GPIO_BASE
, MP_GPIO_SIZE
, iomemtype
);
1420 /* Keyboard codes & masks */
1421 #define KEY_RELEASED 0x80
1422 #define KEY_CODE 0x7f
1424 #define KEYCODE_TAB 0x0f
1425 #define KEYCODE_ENTER 0x1c
1426 #define KEYCODE_F 0x21
1427 #define KEYCODE_M 0x32
1429 #define KEYCODE_EXTENDED 0xe0
1430 #define KEYCODE_UP 0x48
1431 #define KEYCODE_DOWN 0x50
1432 #define KEYCODE_LEFT 0x4b
1433 #define KEYCODE_RIGHT 0x4d
1435 static void musicpal_key_event(void *opaque
, int keycode
)
1437 qemu_irq irq
= opaque
;
1439 static int kbd_extended
;
1441 if (keycode
== KEYCODE_EXTENDED
) {
1447 switch (keycode
& KEY_CODE
) {
1449 event
= MP_GPIO_WHEEL_NAV
| MP_GPIO_WHEEL_NAV_INV
;
1453 event
= MP_GPIO_WHEEL_NAV
;
1457 event
= MP_GPIO_WHEEL_VOL
| MP_GPIO_WHEEL_VOL_INV
;
1461 event
= MP_GPIO_WHEEL_VOL
;
1465 switch (keycode
& KEY_CODE
) {
1467 event
= MP_GPIO_BTN_FAVORITS
;
1471 event
= MP_GPIO_BTN_VOLUME
;
1475 event
= MP_GPIO_BTN_NAVIGATION
;
1479 event
= MP_GPIO_BTN_MENU
;
1482 /* Do not repeat already pressed buttons */
1483 if (!(keycode
& KEY_RELEASED
) && !(gpio_in_state
& event
))
1488 if (keycode
& KEY_RELEASED
) {
1489 gpio_in_state
|= event
;
1491 gpio_in_state
&= ~event
;
1493 qemu_irq_raise(irq
);
1500 static struct arm_boot_info musicpal_binfo
= {
1501 .loader_start
= 0x0,
1505 static void musicpal_init(ram_addr_t ram_size
,
1506 const char *boot_device
,
1507 const char *kernel_filename
, const char *kernel_cmdline
,
1508 const char *initrd_filename
, const char *cpu_model
)
1516 unsigned long flash_size
;
1519 cpu_model
= "arm926";
1521 env
= cpu_init(cpu_model
);
1523 fprintf(stderr
, "Unable to find CPU definition\n");
1526 cpu_pic
= arm_pic_init_cpu(env
);
1528 /* For now we use a fixed - the original - RAM size */
1529 cpu_register_physical_memory(0, MP_RAM_DEFAULT_SIZE
,
1530 qemu_ram_alloc(MP_RAM_DEFAULT_SIZE
));
1532 sram_off
= qemu_ram_alloc(MP_SRAM_SIZE
);
1533 cpu_register_physical_memory(MP_SRAM_BASE
, MP_SRAM_SIZE
, sram_off
);
1535 dev
= sysbus_create_simple("mv88w8618_pic", MP_PIC_BASE
,
1536 cpu_pic
[ARM_PIC_CPU_IRQ
]);
1537 for (i
= 0; i
< 32; i
++) {
1538 pic
[i
] = qdev_get_gpio_in(dev
, i
);
1540 sysbus_create_varargs("mv88w8618_pit", MP_PIT_BASE
, pic
[MP_TIMER1_IRQ
],
1541 pic
[MP_TIMER2_IRQ
], pic
[MP_TIMER3_IRQ
],
1542 pic
[MP_TIMER4_IRQ
], NULL
);
1545 serial_mm_init(MP_UART1_BASE
, 2, pic
[MP_UART1_IRQ
], 1825000,
1548 serial_mm_init(MP_UART2_BASE
, 2, pic
[MP_UART2_IRQ
], 1825000,
1551 /* Register flash */
1552 index
= drive_get_index(IF_PFLASH
, 0, 0);
1554 flash_size
= bdrv_getlength(drives_table
[index
].bdrv
);
1555 if (flash_size
!= 8*1024*1024 && flash_size
!= 16*1024*1024 &&
1556 flash_size
!= 32*1024*1024) {
1557 fprintf(stderr
, "Invalid flash image size\n");
1562 * The original U-Boot accesses the flash at 0xFE000000 instead of
1563 * 0xFF800000 (if there is 8 MB flash). So remap flash access if the
1564 * image is smaller than 32 MB.
1566 pflash_cfi02_register(0-MP_FLASH_SIZE_MAX
, qemu_ram_alloc(flash_size
),
1567 drives_table
[index
].bdrv
, 0x10000,
1568 (flash_size
+ 0xffff) >> 16,
1569 MP_FLASH_SIZE_MAX
/ flash_size
,
1570 2, 0x00BF, 0x236D, 0x0000, 0x0000,
1573 sysbus_create_simple("mv88w8618_flashcfg", MP_FLASHCFG_BASE
, NULL
);
1575 sysbus_create_simple("musicpal_lcd", MP_LCD_BASE
, NULL
);
1577 qemu_add_kbd_event_handler(musicpal_key_event
, pic
[MP_GPIO_IRQ
]);
1579 qemu_check_nic_model(&nd_table
[0], "mv88w8618");
1580 dev
= qdev_create(NULL
, "mv88w8618_eth");
1581 qdev_set_netdev(dev
, &nd_table
[0]);
1583 sysbus_mmio_map(sysbus_from_qdev(dev
), 0, MP_ETH_BASE
);
1584 sysbus_connect_irq(sysbus_from_qdev(dev
), 0, pic
[MP_ETH_IRQ
]);
1586 mixer_i2c
= musicpal_audio_init(pic
[MP_AUDIO_IRQ
]);
1588 sysbus_create_simple("mv88w8618_wlan", MP_WLAN_BASE
, NULL
);
1590 musicpal_misc_init();
1591 musicpal_gpio_init();
1593 musicpal_binfo
.ram_size
= MP_RAM_DEFAULT_SIZE
;
1594 musicpal_binfo
.kernel_filename
= kernel_filename
;
1595 musicpal_binfo
.kernel_cmdline
= kernel_cmdline
;
1596 musicpal_binfo
.initrd_filename
= initrd_filename
;
1597 arm_load_kernel(env
, &musicpal_binfo
);
1600 static QEMUMachine musicpal_machine
= {
1602 .desc
= "Marvell 88w8618 / MusicPal (ARM926EJ-S)",
1603 .init
= musicpal_init
,
1606 static void musicpal_machine_init(void)
1608 qemu_register_machine(&musicpal_machine
);
1611 machine_init(musicpal_machine_init
);
1613 static void musicpal_register_devices(void)
1615 sysbus_register_dev("mv88w8618_pic", sizeof(mv88w8618_pic_state
),
1616 mv88w8618_pic_init
);
1617 sysbus_register_dev("mv88w8618_pit", sizeof(mv88w8618_pit_state
),
1618 mv88w8618_pit_init
);
1619 sysbus_register_dev("mv88w8618_flashcfg", sizeof(mv88w8618_flashcfg_state
),
1620 mv88w8618_flashcfg_init
);
1621 sysbus_register_dev("mv88w8618_eth", sizeof(mv88w8618_eth_state
),
1622 mv88w8618_eth_init
);
1623 sysbus_register_dev("mv88w8618_wlan", sizeof(SysBusDevice
),
1624 mv88w8618_wlan_init
);
1625 sysbus_register_dev("musicpal_lcd", sizeof(musicpal_lcd_state
),
1629 device_init(musicpal_register_devices
)