[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 19/49] uninorth: remove obsolete pci_pmac_u3_init() fun
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 19/49] uninorth: remove obsolete pci_pmac_u3_init() function |
Date: |
Fri, 27 Apr 2018 19:20:56 +1000 |
From: Mark Cave-Ayland <address@hidden>
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_u3_agp_init().
Signed-off-by: Mark Cave-Ayland <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/pci-host/uninorth.c | 30 +++++-------------------------
hw/ppc/mac_newworld.c | 13 ++++++++++++-
2 files changed, 17 insertions(+), 26 deletions(-)
diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
index 8e4e9b3d35..ec6e529d66 100644
--- a/hw/pci-host/uninorth.c
+++ b/hw/pci-host/uninorth.c
@@ -185,8 +185,13 @@ static void pci_u3_agp_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, 0x70000000ULL);
+
sysbus_init_mmio(sbd, &h->conf_mem);
sysbus_init_mmio(sbd, &h->data_mem);
+ sysbus_init_mmio(sbd, &s->pci_hole);
}
static void pci_unin_agp_realize(DeviceState *dev, Error **errp)
@@ -247,31 +252,6 @@ static void pci_unin_internal_init(Object *obj)
sysbus_init_mmio(sbd, &h->data_mem);
}
-UNINState *pci_pmac_u3_init(qemu_irq *pic,
- MemoryRegion *address_space_mem)
-{
- DeviceState *dev;
- SysBusDevice *s;
- UNINState *d;
-
- /* Uninorth AGP bus */
- dev = qdev_create(NULL, TYPE_U3_AGP_HOST_BRIDGE);
- qdev_prop_set_ptr(dev, "pic-irqs", pic);
- qdev_init_nofail(dev);
- s = SYS_BUS_DEVICE(dev);
- d = U3_AGP_HOST_BRIDGE(dev);
-
- memory_region_init_alias(&d->pci_hole, OBJECT(d), "pci-hole", &d->pci_mmio,
- 0x80000000ULL, 0x70000000ULL);
- memory_region_add_subregion(address_space_mem, 0x80000000ULL,
- &d->pci_hole);
-
- sysbus_mmio_map(s, 0, 0xf0800000);
- sysbus_mmio_map(s, 1, 0xf0c00000);
-
- return d;
-}
-
static void unin_main_pci_host_realize(PCIDevice *d, Error **errp)
{
/* cache_line_size */
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 3033fc0d7e..2360b24a12 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -345,7 +345,18 @@ static void ppc_core99_init(MachineState *machine)
if (PPC_INPUT(env) == PPC_FLAGS_INPUT_970) {
/* 970 gets a U3 bus */
- uninorth_pci = pci_pmac_u3_init(pic, get_system_memory());
+ /* Uninorth AGP bus */
+ dev = qdev_create(NULL, TYPE_U3_AGP_HOST_BRIDGE);
+ qdev_prop_set_ptr(dev, "pic-irqs", pic);
+ qdev_init_nofail(dev);
+ uninorth_pci = U3_AGP_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, 0xf0800000);
+ sysbus_mmio_map(s, 1, 0xf0c00000);
+
machine_arch = ARCH_MAC99_U3;
} else {
/* Use values found on a real PowerMac */
--
2.14.3
- [Qemu-ppc] [PULL 07/49] heathrow: remove obsolete heathow_init() function, (continued)
- [Qemu-ppc] [PULL 07/49] heathrow: remove obsolete heathow_init() function, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 08/49] grackle: general tidy-up and QOMify, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 11/49] mac_oldworld: remove pics IRQ array and wire up macio to heathrow directly, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 14/49] uninorth: introduce temporary pic_irqs device property, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 10/49] grackle: move PCI IO (ISA) memory region into the grackle device, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 12/49] mac_oldworld: move wiring of macio IRQs to macio_oldworld_realize(), David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 16/49] uninorth: fix PCI and AGP bus mixup, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 13/49] uninorth: move PCI mmio memory region initialisation into init function, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 06/49] uninorth: alter pci_pmac_init() and pci_pmac_u3_init() to return uninorth device, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 05/49] uninorth: move uninorth definitions into uninorth.h, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 19/49] uninorth: remove obsolete pci_pmac_u3_init() function,
David Gibson <=
- [Qemu-ppc] [PULL 17/49] uninorth: enable internal PCI host bridge, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 24/49] target/ppc: Fix reserved bit mask of dstst instruction, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 30/49] spapr: drop useless dynamic sysbus device sanity check, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 15/49] uninorth: move PCI host bridge bus initialisation into device realize, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 20/49] uninorth: use object link to pass OpenPIC object to uninorth, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 28/49] spapr: drop useless sanity check in spapr_irq_alloc*(), David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 22/49] uninorth: rename UNINState to UNINHostState, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 18/49] uninorth: remove obsolete pci_pmac_init() function, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 39/49] target/ppc: Move 1T segment and AMR options to PPCHash64Options, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 37/49] target/ppc: Split page size information into a separate allocation, David Gibson, 2018/04/27