mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
mac_oldworld: use object link to pass heathrow PIC object to macio
Also switch macio_oldworld_realize() over to use it rather than using the pic_mem memory region directly. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
e1218e4812
commit
017812df5d
3 changed files with 17 additions and 7 deletions
|
@ -93,7 +93,7 @@ static void ppc_heathrow_init(MachineState *machine)
|
|||
uint32_t kernel_base, initrd_base, cmdline_base = 0;
|
||||
int32_t kernel_size, initrd_size;
|
||||
PCIBus *pci_bus;
|
||||
PCIDevice *macio;
|
||||
OldWorldMacIOState *macio;
|
||||
MACIOIDEState *macio_ide;
|
||||
DeviceState *dev, *pic_dev;
|
||||
SysBusDevice *sbd;
|
||||
|
@ -271,7 +271,7 @@ static void ppc_heathrow_init(MachineState *machine)
|
|||
ide_drive_get(hd, ARRAY_SIZE(hd));
|
||||
|
||||
/* MacIO */
|
||||
macio = pci_create(pci_bus, -1, TYPE_OLDWORLD_MACIO);
|
||||
macio = OLDWORLD_MACIO(pci_create(pci_bus, -1, TYPE_OLDWORLD_MACIO));
|
||||
dev = DEVICE(macio);
|
||||
qdev_connect_gpio_out(dev, 0, pic[0x12]); /* CUDA */
|
||||
qdev_connect_gpio_out(dev, 1, pic[0x10]); /* ESCC-B */
|
||||
|
@ -281,8 +281,10 @@ static void ppc_heathrow_init(MachineState *machine)
|
|||
qdev_connect_gpio_out(dev, 5, pic[0x0E]); /* IDE-1 */
|
||||
qdev_connect_gpio_out(dev, 6, pic[0x03]); /* IDE-1 DMA */
|
||||
qdev_prop_set_uint64(dev, "frequency", tbfreq);
|
||||
object_property_set_link(OBJECT(macio), OBJECT(pic_dev), "pic",
|
||||
&error_abort);
|
||||
sbd = SYS_BUS_DEVICE(pic_dev);
|
||||
macio_init(macio, sysbus_mmio_get_region(sbd, 0));
|
||||
macio_init(PCI_DEVICE(macio), sysbus_mmio_get_region(sbd, 0));
|
||||
|
||||
macio_ide = MACIO_IDE(object_resolve_path_component(OBJECT(macio),
|
||||
"ide[0]"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue