summaryrefslogtreecommitdiffstats
path: root/hw/ppc/mac_newworld.c
diff options
context:
space:
mode:
authorAndreas Färber2013-01-24 00:04:01 +0100
committerAlexander Graf2013-01-25 22:02:54 +0100
commit07a7484e5d713f1eb7c1c37b18a8ab0d56d88875 (patch)
tree2c768cca41786f5fb08683c48e5066635c9cded6 /hw/ppc/mac_newworld.c
parentmac_nvram: QOM'ify MacIO NVRAM (diff)
downloadqemu-07a7484e5d713f1eb7c1c37b18a8ab0d56d88875.tar.gz
qemu-07a7484e5d713f1eb7c1c37b18a8ab0d56d88875.tar.xz
qemu-07a7484e5d713f1eb7c1c37b18a8ab0d56d88875.zip
ide/macio: QOM'ify MacIO IDE
It was not qdev'ified before. Turn it into a SysBusDevice. Embed them into the MacIO devices. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/ppc/mac_newworld.c')
-rw-r--r--hw/ppc/mac_newworld.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index a4b38fba1e..4fd86b042a 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -148,15 +148,14 @@ static void ppc_core99_init(QEMUMachineInitArgs *args)
long kernel_size, initrd_size;
PCIBus *pci_bus;
PCIDevice *macio;
+ MACIOIDEState *macio_ide;
MacIONVRAMState *nvr;
int bios_size;
- MemoryRegion *pic_mem, *dbdma_mem, *cuda_mem, *escc_mem;
+ MemoryRegion *pic_mem, *cuda_mem, *escc_mem;
MemoryRegion *escc_bar = g_new(MemoryRegion, 1);
- MemoryRegion *ide_mem[3];
int ppc_boot_device;
DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
void *fw_cfg;
- void *dbdma;
int machine_arch;
SysBusDevice *s;
DeviceState *dev;
@@ -363,12 +362,6 @@ static void ppc_core99_init(QEMUMachineInitArgs *args)
pci_nic_init_nofail(&nd_table[i], "ne2k_pci", NULL);
ide_drive_get(hd, MAX_IDE_BUS);
- dbdma = DBDMA_init(&dbdma_mem);
-
- /* We only emulate 2 out of 3 IDE controllers for now */
- ide_mem[0] = NULL;
- ide_mem[1] = pmac_ide_init(hd, pic[0x0d], dbdma, 0x16, pic[0x02]);
- ide_mem[2] = pmac_ide_init(&hd[MAX_IDE_DEVS], pic[0x0e], dbdma, 0x1a, pic[0x02]);
cuda_init(&cuda_mem, pic[0x19]);
@@ -376,8 +369,21 @@ static void ppc_core99_init(QEMUMachineInitArgs *args)
adb_mouse_init(&adb_bus);
macio = pci_create(pci_bus, -1, TYPE_NEWWORLD_MACIO);
- macio_init(macio, pic_mem,
- dbdma_mem, cuda_mem, 3, ide_mem, escc_bar);
+ dev = DEVICE(macio);
+ qdev_connect_gpio_out(dev, 0, pic[0x0d]); /* IDE */
+ qdev_connect_gpio_out(dev, 1, pic[0x02]); /* IDE DMA */
+ qdev_connect_gpio_out(dev, 2, pic[0x0e]); /* IDE */
+ qdev_connect_gpio_out(dev, 3, pic[0x02]); /* IDE DMA */
+ macio_init(macio, pic_mem, cuda_mem, escc_bar);
+
+ /* We only emulate 2 out of 3 IDE controllers for now */
+ macio_ide = MACIO_IDE(object_resolve_path_component(OBJECT(macio),
+ "ide[0]"));
+ macio_ide_init_drives(macio_ide, hd);
+
+ macio_ide = MACIO_IDE(object_resolve_path_component(OBJECT(macio),
+ "ide[1]"));
+ macio_ide_init_drives(macio_ide, &hd[MAX_IDE_DEVS]);
if (usb_enabled(machine_arch == ARCH_MAC99_U3)) {
pci_create_simple(pci_bus, -1, "pci-ohci");