aboutsummaryrefslogtreecommitdiff
path: root/hw/sm501.c
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2010-04-05 19:57:40 +0100
committerPaul Brook <paul@codesourcery.com>2010-04-05 19:57:40 +0100
commit61d3cf93e2676282ba1a8d568b2406257f208b26 (patch)
tree43fc3b106d24bdf1c474a23857873974e1b2235f /hw/sm501.c
parent4f78c9ad5a6076a37a944ededfbec508861103f7 (diff)
OHCI qdev conversion
Convert remaining OHCI devices to QDEV interface. Signed-off-by: Paul Brook <paul@codesourcery.com>
Diffstat (limited to 'hw/sm501.c')
-rw-r--r--hw/sm501.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/hw/sm501.c b/hw/sm501.c
index 1a342bdc58..931001479a 100644
--- a/hw/sm501.c
+++ b/hw/sm501.c
@@ -27,6 +27,8 @@
#include "pc.h"
#include "console.h"
#include "devices.h"
+#include "sysbus.h"
+#include "qdev-addr.h"
/*
* Status: 2008/11/02
@@ -1190,6 +1192,7 @@ void sm501_init(uint32_t base, uint32_t local_mem_bytes, qemu_irq irq,
CharDriverState *chr)
{
SM501State * s;
+ DeviceState *dev;
int sm501_system_config_index;
int sm501_disp_ctrl_index;
@@ -1222,8 +1225,13 @@ void sm501_init(uint32_t base, uint32_t local_mem_bytes, qemu_irq irq,
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);
+ dev = qdev_create(NULL, "sysbus-ohci");
+ qdev_prop_set_uint32(dev, "num-ports", 2);
+ qdev_prop_set_taddr(dev, "dma-offset", base);
+ qdev_init_nofail(dev);
+ sysbus_mmio_map(sysbus_from_qdev(dev), 0,
+ base + MMIO_BASE_OFFSET + SM501_USB_HOST);
+ sysbus_connect_irq(sysbus_from_qdev(dev), 0, irq);
/* bridge to serial emulation module */
if (chr) {