aboutsummaryrefslogtreecommitdiffstats
path: root/hw/sm501.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-19 09:15:50 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-19 09:15:50 +0000
commitac611340c9e21f3f9f1247a23de08d8764174b83 (patch)
tree56b2f16eefbd8fbb3f8f8fc1df468458291313ff /hw/sm501.c
parent465c9f0630efbbca3e1279817d8bfb51215d7a2b (diff)
Adds SM501 usb host emulation feature.
It makes usb keyboard available for sh4/r2d system emulation. The changes for "hw/usb-ohci.c" are as follows. - 'localmem_base' is introduced as OHCIState struct member. SM501 has a local memory, and it is used to pass and receive data with OHCI driver. OHCI driver accesses it with SH4 physical memory address, and SM501 accesses it with SM501 local address. 'localmem_base' holds where the SM501 local memory is mapped into SH4 physical address space. - Memory access functions modified to adjust address with 'localmem_base'. The functions are, ohci_read_*(), ohci_put_*(), and ohci_copy_*(). - ohci_read_hcca() and ohci_put_hcca() are introduced for more consistent implementation. For other source files, it does, - introduces usb_ohci_init_sm501(). - adds irq argument for SM501 initialization, to emulate USB interrupts. Signed-off-by: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7188 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/sm501.c')
-rw-r--r--hw/sm501.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/sm501.c b/hw/sm501.c
index 8ecac7193..fe3782bf4 100644
--- a/hw/sm501.c
+++ b/hw/sm501.c
@@ -1055,7 +1055,8 @@ static void sm501_update_display(void *opaque)
sm501_draw_crt(s);
}
-void sm501_init(uint32_t base, uint32_t local_mem_bytes, CharDriverState *chr)
+void sm501_init(uint32_t base, uint32_t local_mem_bytes, qemu_irq irq,
+ CharDriverState *chr)
{
SM501State * s;
int sm501_system_config_index;
@@ -1089,6 +1090,10 @@ void sm501_init(uint32_t base, uint32_t local_mem_bytes, CharDriverState *chr)
cpu_register_physical_memory(base + MMIO_BASE_OFFSET + SM501_DC,
0x1000, sm501_disp_ctrl_index);
+ /* bridge to usb host emulation module */
+ usb_ohci_init_sm501(base + MMIO_BASE_OFFSET + SM501_USB_HOST, base,
+ 2, -1, irq);
+
/* bridge to serial emulation module */
if (chr)
serial_mm_init(base + MMIO_BASE_OFFSET + SM501_UART0, 2,