mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
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>
This commit is contained in:
parent
95ed3b7cf1
commit
07a7484e5d
6 changed files with 198 additions and 81 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue