[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 12/19] uninorth: remove obsolete pci_pmac_init() funct
From: |
Mark Cave-Ayland |
Subject: |
[Qemu-ppc] [PATCH 12/19] uninorth: remove obsolete pci_pmac_init() function |
Date: |
Tue, 6 Mar 2018 20:30:56 +0000 |
Instead wire up the PCI/AGP host bridges in mac_newworld.c. Now this is complete
it is possible to move the initialisation of the PCI hole alias into
pci_unin_main_init().
Signed-off-by: Mark Cave-Ayland <address@hidden>
---
hw/pci-host/uninorth.c | 46 +++++-----------------------------------------
hw/ppc/mac_newworld.c | 30 +++++++++++++++++++++++++++++-
2 files changed, 34 insertions(+), 42 deletions(-)
diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
index ccde332fa9..8e4e9b3d35 100644
--- a/hw/pci-host/uninorth.c
+++ b/hw/pci-host/uninorth.c
@@ -146,8 +146,13 @@ static void pci_unin_main_init(Object *obj)
memory_region_init(&s->pci_mmio, OBJECT(s), "unin-pci-mmio",
0x100000000ULL);
+ memory_region_init_alias(&s->pci_hole, OBJECT(s),
+ "unin-pci-hole", &s->pci_mmio,
+ 0x80000000ULL, 0x10000000ULL);
+
sysbus_init_mmio(sbd, &h->conf_mem);
sysbus_init_mmio(sbd, &h->data_mem);
+ sysbus_init_mmio(sbd, &s->pci_hole);
}
static void pci_u3_agp_realize(DeviceState *dev, Error **errp)
@@ -242,47 +247,6 @@ static void pci_unin_internal_init(Object *obj)
sysbus_init_mmio(sbd, &h->data_mem);
}
-UNINState *pci_pmac_init(qemu_irq *pic,
- MemoryRegion *address_space_mem)
-{
- DeviceState *dev;
- SysBusDevice *s;
- UNINState *d;
-
- /* Use values found on a real PowerMac */
- /* Uninorth AGP bus */
- dev = qdev_create(NULL, TYPE_UNI_NORTH_AGP_HOST_BRIDGE);
- qdev_prop_set_ptr(dev, "pic-irqs", pic);
- qdev_init_nofail(dev);
- s = SYS_BUS_DEVICE(dev);
- sysbus_mmio_map(s, 0, 0xf0800000);
- sysbus_mmio_map(s, 1, 0xf0c00000);
-
- /* Uninorth internal bus */
- dev = qdev_create(NULL, TYPE_UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE);
- qdev_prop_set_ptr(dev, "pic-irqs", pic);
- qdev_init_nofail(dev);
- s = SYS_BUS_DEVICE(dev);
- sysbus_mmio_map(s, 0, 0xf4800000);
- sysbus_mmio_map(s, 1, 0xf4c00000);
-
- /* Uninorth main bus */
- dev = qdev_create(NULL, TYPE_UNI_NORTH_PCI_HOST_BRIDGE);
- qdev_prop_set_ptr(dev, "pic-irqs", pic);
- qdev_init_nofail(dev);
- s = SYS_BUS_DEVICE(dev);
- d = UNI_NORTH_PCI_HOST_BRIDGE(dev);
- memory_region_init_alias(&d->pci_hole, OBJECT(d), "pci-hole", &d->pci_mmio,
- 0x80000000ULL, 0x10000000ULL);
- memory_region_add_subregion(address_space_mem, 0x80000000ULL,
- &d->pci_hole);
-
- sysbus_mmio_map(s, 0, 0xf2800000);
- sysbus_mmio_map(s, 1, 0xf2c00000);
-
- return d;
-}
-
UNINState *pci_pmac_u3_init(qemu_irq *pic,
MemoryRegion *address_space_mem)
{
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index f2b07207d3..da76c33099 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -349,7 +349,35 @@ static void ppc_core99_init(MachineState *machine)
uninorth_pci = pci_pmac_u3_init(pic, get_system_memory());
machine_arch = ARCH_MAC99_U3;
} else {
- uninorth_pci = pci_pmac_init(pic, get_system_memory());
+ /* Use values found on a real PowerMac */
+ /* Uninorth AGP bus */
+ dev = qdev_create(NULL, TYPE_UNI_NORTH_AGP_HOST_BRIDGE);
+ qdev_prop_set_ptr(dev, "pic-irqs", pic);
+ qdev_init_nofail(dev);
+ s = SYS_BUS_DEVICE(dev);
+ sysbus_mmio_map(s, 0, 0xf0800000);
+ sysbus_mmio_map(s, 1, 0xf0c00000);
+
+ /* Uninorth internal bus */
+ dev = qdev_create(NULL, TYPE_UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE);
+ qdev_prop_set_ptr(dev, "pic-irqs", pic);
+ qdev_init_nofail(dev);
+ s = SYS_BUS_DEVICE(dev);
+ sysbus_mmio_map(s, 0, 0xf4800000);
+ sysbus_mmio_map(s, 1, 0xf4c00000);
+
+ /* Uninorth main bus */
+ dev = qdev_create(NULL, TYPE_UNI_NORTH_PCI_HOST_BRIDGE);
+ qdev_prop_set_ptr(dev, "pic-irqs", pic);
+ qdev_init_nofail(dev);
+ uninorth_pci = UNI_NORTH_PCI_HOST_BRIDGE(dev);
+ s = SYS_BUS_DEVICE(dev);
+ /* PCI hole */
+ memory_region_add_subregion(get_system_memory(), 0x80000000ULL,
+ sysbus_mmio_get_region(s, 2));
+ sysbus_mmio_map(s, 0, 0xf2800000);
+ sysbus_mmio_map(s, 1, 0xf2c00000);
+
machine_arch = ARCH_MAC99;
}
--
2.11.0
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 07/19] uninorth: move PCI mmio memory region initialisation into init function, (continued)
- [Qemu-ppc] [PATCH 08/19] uninorth: introduce temporary pic_irqs device property, Mark Cave-Ayland, 2018/03/06
- [Qemu-ppc] [PATCH 09/19] uninorth: move PCI host bridge bus initialisation into device realize, Mark Cave-Ayland, 2018/03/06
- [Qemu-ppc] [PATCH 19/19] mac_newworld: move wiring of macio IRQs to macio_newworld_realize(), Mark Cave-Ayland, 2018/03/06
- [Qemu-ppc] [PATCH 14/19] uninorth: use object link to pass OpenPIC object to uninorth, Mark Cave-Ayland, 2018/03/06
- [Qemu-ppc] [PATCH 13/19] uninorth: remove obsolete pci_pmac_u3_init() function, Mark Cave-Ayland, 2018/03/06
- [Qemu-ppc] [PATCH 10/19] uninorth: fix PCI and AGP bus mixup, Mark Cave-Ayland, 2018/03/06
- [Qemu-ppc] [PATCH 12/19] uninorth: remove obsolete pci_pmac_init() function,
Mark Cave-Ayland <=
- [Qemu-ppc] [PATCH 11/19] uninorth: enable internal PCI host bridge, Mark Cave-Ayland, 2018/03/06
- [Qemu-ppc] [PATCH 16/19] uninorth: rename UNINState to UNINHostState, Mark Cave-Ayland, 2018/03/06
- [Qemu-ppc] [PATCH 18/19] mac_newworld: remove pics IRQ array and wire up macio to OpenPIC directly, Mark Cave-Ayland, 2018/03/06
- [Qemu-ppc] [PATCH 15/19] uninorth: move PCI IO (ISA) memory region into the uninorth device, Mark Cave-Ayland, 2018/03/06
- [Qemu-ppc] [PATCH 17/19] uninorth: create new uninorth device, Mark Cave-Ayland, 2018/03/06