[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 13/49] uninorth: move PCI mmio memory region initialisa
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 13/49] uninorth: move PCI mmio memory region initialisation into init function |
Date: |
Fri, 27 Apr 2018 19:20:50 +1000 |
From: Mark Cave-Ayland <address@hidden>
Whilst we are here, rename the memory regions to better reflect whether they
belong to either a PCI or an AGP bus.
Signed-off-by: Mark Cave-Ayland <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/pci-host/uninorth.c | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
index b081e3c153..5b8fc3aa16 100644
--- a/hw/pci-host/uninorth.c
+++ b/hw/pci-host/uninorth.c
@@ -111,29 +111,39 @@ static const MemoryRegionOps unin_data_ops = {
static void pci_unin_main_init(Object *obj)
{
+ UNINState *s = UNI_NORTH_PCI_HOST_BRIDGE(obj);
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
PCIHostState *h = PCI_HOST_BRIDGE(obj);
/* Use values found on a real PowerMac */
/* Uninorth main bus */
memory_region_init_io(&h->conf_mem, OBJECT(h), &pci_host_conf_le_ops,
- obj, "pci-conf-idx", 0x1000);
+ obj, "unin-pci-conf-idx", 0x1000);
memory_region_init_io(&h->data_mem, OBJECT(h), &unin_data_ops, obj,
- "pci-conf-data", 0x1000);
+ "unin-pci-conf-data", 0x1000);
+
+ memory_region_init(&s->pci_mmio, OBJECT(s), "unin-pci-mmio",
+ 0x100000000ULL);
+
sysbus_init_mmio(sbd, &h->conf_mem);
sysbus_init_mmio(sbd, &h->data_mem);
}
static void pci_u3_agp_init(Object *obj)
{
+ UNINState *s = U3_AGP_HOST_BRIDGE(obj);
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
PCIHostState *h = PCI_HOST_BRIDGE(obj);
/* Uninorth U3 AGP bus */
memory_region_init_io(&h->conf_mem, OBJECT(h), &pci_host_conf_le_ops,
- obj, "pci-conf-idx", 0x1000);
+ obj, "unin-pci-conf-idx", 0x1000);
memory_region_init_io(&h->data_mem, OBJECT(h), &unin_data_ops, obj,
- "pci-conf-data", 0x1000);
+ "unin-pci-conf-data", 0x1000);
+
+ memory_region_init(&s->pci_mmio, OBJECT(s), "unin-pci-mmio",
+ 0x100000000ULL);
+
sysbus_init_mmio(sbd, &h->conf_mem);
sysbus_init_mmio(sbd, &h->data_mem);
}
@@ -145,9 +155,9 @@ static void pci_unin_agp_init(Object *obj)
/* Uninorth AGP bus */
memory_region_init_io(&h->conf_mem, OBJECT(h), &pci_host_conf_le_ops,
- obj, "pci-conf-idx", 0x1000);
+ obj, "unin-agp-conf-idx", 0x1000);
memory_region_init_io(&h->data_mem, OBJECT(h), &pci_host_data_le_ops,
- obj, "pci-conf-data", 0x1000);
+ obj, "unin-agp-conf-data", 0x1000);
sysbus_init_mmio(sbd, &h->conf_mem);
sysbus_init_mmio(sbd, &h->data_mem);
}
@@ -159,9 +169,9 @@ static void pci_unin_internal_init(Object *obj)
/* Uninorth internal bus */
memory_region_init_io(&h->conf_mem, OBJECT(h), &pci_host_conf_le_ops,
- obj, "pci-conf-idx", 0x1000);
+ obj, "unin-pci-conf-idx", 0x1000);
memory_region_init_io(&h->data_mem, OBJECT(h), &pci_host_data_le_ops,
- obj, "pci-conf-data", 0x1000);
+ obj, "unin-pci-conf-data", 0x1000);
sysbus_init_mmio(sbd, &h->conf_mem);
sysbus_init_mmio(sbd, &h->data_mem);
}
@@ -182,7 +192,6 @@ UNINState *pci_pmac_init(qemu_irq *pic,
s = SYS_BUS_DEVICE(dev);
h = PCI_HOST_BRIDGE(s);
d = UNI_NORTH_PCI_HOST_BRIDGE(dev);
- memory_region_init(&d->pci_mmio, OBJECT(d), "pci-mmio", 0x100000000ULL);
memory_region_init_alias(&d->pci_hole, OBJECT(d), "pci-hole", &d->pci_mmio,
0x80000000ULL, 0x10000000ULL);
memory_region_add_subregion(address_space_mem, 0x80000000ULL,
@@ -247,7 +256,6 @@ UNINState *pci_pmac_u3_init(qemu_irq *pic,
h = PCI_HOST_BRIDGE(dev);
d = U3_AGP_HOST_BRIDGE(dev);
- memory_region_init(&d->pci_mmio, OBJECT(d), "pci-mmio", 0x100000000ULL);
memory_region_init_alias(&d->pci_hole, OBJECT(d), "pci-hole", &d->pci_mmio,
0x80000000ULL, 0x70000000ULL);
memory_region_add_subregion(address_space_mem, 0x80000000ULL,
--
2.14.3
- [Qemu-ppc] [PULL 02/49] uninorth: remove second set of uninorth token registers, (continued)
- [Qemu-ppc] [PULL 02/49] uninorth: remove second set of uninorth token registers, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 03/49] uninorth: QOMify PCI and AGP host bridges, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 09/49] grackle: remove deprecated pci_grackle_init() function, David Gibson, 2018/04/27
- [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 <=
- [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, 2018/04/27
- [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