[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 11/19] uninorth: enable internal PCI host bridge
From: |
Mark Cave-Ayland |
Subject: |
[Qemu-ppc] [PATCH 11/19] uninorth: enable internal PCI host bridge |
Date: |
Tue, 6 Mar 2018 20:30:55 +0000 |
Signed-off-by: Mark Cave-Ayland <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.11.0
- [Qemu-ppc] [PATCH 08/19] uninorth: introduce temporary pic_irqs device property, (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, 2018/03/06
- [Qemu-ppc] [PATCH 11/19] uninorth: enable internal PCI host bridge,
Mark Cave-Ayland <=
- [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