[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 17/49] uninorth: enable internal PCI host bridge
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 17/49] uninorth: enable internal PCI host bridge |
Date: |
Fri, 27 Apr 2018 19:20:54 +1000 |
From: Mark Cave-Ayland <address@hidden>
Signed-off-by: Mark Cave-Ayland <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/pci-host/uninorth.c | 28 +++++++++++++++++++++++-----
1 file changed, 23 insertions(+), 5 deletions(-)
diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
index 1f6752c294..ccde332fa9 100644
--- a/hw/pci-host/uninorth.c
+++ b/hw/pci-host/uninorth.c
@@ -213,6 +213,21 @@ static void pci_unin_agp_init(Object *obj)
sysbus_init_mmio(sbd, &h->data_mem);
}
+static void pci_unin_internal_realize(DeviceState *dev, Error **errp)
+{
+ UNINState *s = UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE(dev);
+ PCIHostState *h = PCI_HOST_BRIDGE(dev);
+
+ h->bus = pci_register_root_bus(dev, NULL,
+ pci_unin_set_irq, pci_unin_map_irq,
+ s->pic_irqs,
+ &s->pci_mmio,
+ get_system_io(),
+ PCI_DEVFN(14, 0), 4, TYPE_PCI_BUS);
+
+ pci_create_simple(h->bus, PCI_DEVFN(14, 0), "uni-north-internal-pci");
+}
+
static void pci_unin_internal_init(Object *obj)
{
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
@@ -244,16 +259,12 @@ UNINState *pci_pmac_init(qemu_irq *pic,
sysbus_mmio_map(s, 1, 0xf0c00000);
/* Uninorth internal bus */
-#if 0
- /* XXX: not needed for now */
- pci_create_simple(h->bus, PCI_DEVFN(14, 0),
- "uni-north-internal-pci");
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);
-#endif
/* Uninorth main bus */
dev = qdev_create(NULL, TYPE_UNI_NORTH_PCI_HOST_BRIDGE);
@@ -523,10 +534,17 @@ static const TypeInfo pci_unin_agp_info = {
.class_init = pci_unin_agp_class_init,
};
+static Property pci_unin_internal_class_properties[] = {
+ DEFINE_PROP_PTR("pic-irqs", UNINState, pic_irqs),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
static void pci_unin_internal_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ dc->realize = pci_unin_internal_realize;
+ dc->props = pci_unin_internal_class_properties;
set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
}
--
2.14.3
- [Qemu-ppc] [PULL 08/49] grackle: general tidy-up and QOMify, (continued)
- [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, 2018/04/27
- [Qemu-ppc] [PULL 17/49] uninorth: enable internal PCI host bridge,
David Gibson <=
- [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
- [Qemu-ppc] [PULL 38/49] target/ppc: Make hash64_opts field mandatory for 64-bit hash MMUs, David Gibson, 2018/04/27