aboutsummaryrefslogtreecommitdiff
path: root/hw/r2d.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-02-01 00:13:41 +0100
committerAurelien Jarno <aurelien@aurel32.net>2013-02-01 00:13:41 +0100
commit6b2578d678497dbce44ed7999d269fc973ae6e8f (patch)
treea3a036444eb8c52c19c7a37b9f4e958eea446be6 /hw/r2d.c
parente62a214cd49f836339fe3fd8126fc81d66c3c917 (diff)
ide/mmio: QOM'ify MMIO IDE for R2D
It was not qdev'ified before, so turn it into a SysBusDevice. Keep mmio_ide_init_drives() around to attach the hard drive. Signed-off-by: Andreas Färberr <afaerber@suse.de> Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'hw/r2d.c')
-rw-r--r--hw/r2d.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/hw/r2d.c b/hw/r2d.c
index a2e3b6fe1c..2d0dd1ffba 100644
--- a/hw/r2d.c
+++ b/hw/r2d.c
@@ -276,8 +276,14 @@ static void r2d_init(QEMUMachineInitArgs *args)
/* onboard CF (True IDE mode, Master only). */
dinfo = drive_get(IF_IDE, 0, 0);
- mmio_ide_init(0x14001000, 0x1400080c, address_space_mem, irq[CF_IDE], 1,
- dinfo, NULL);
+ dev = qdev_create(NULL, "mmio-ide");
+ busdev = SYS_BUS_DEVICE(dev);
+ sysbus_connect_irq(busdev, 0, irq[CF_IDE]);
+ qdev_prop_set_uint32(dev, "shift", 1);
+ qdev_init_nofail(dev);
+ sysbus_mmio_map(busdev, 0, 0x14001000);
+ sysbus_mmio_map(busdev, 1, 0x1400080c);
+ mmio_ide_init_drives(dev, dinfo, NULL);
/* onboard flash memory */
dinfo = drive_get(IF_PFLASH, 0, 0);