aboutsummaryrefslogtreecommitdiff
path: root/hw/hppa
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-05-04 10:25:13 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-05-08 18:52:36 +0100
commit63901b6cc4d8b471ac4b92826220db914b908368 (patch)
tree17696935752cc0d9d35cf56508e5cbb750e4915d /hw/hppa
parent7cdfa94166fb5aa25681152675c85c709e927602 (diff)
dino: move PCI bus initialisation to dino_pcihost_init()
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220504092600.10048-4-mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw/hppa')
-rw-r--r--hw/hppa/dino.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c
index 9401b68ff7..c6c01ea14c 100644
--- a/hw/hppa/dino.c
+++ b/hw/hppa/dino.c
@@ -526,13 +526,7 @@ PCIBus *dino_init(MemoryRegion *addr_space,
s->iar0 = s->iar1 = CPU_HPA + 3;
s->toc_addr = 0xFFFA0030; /* IO_COMMAND of CPU */
- /* Dino PCI bus memory. */
- memory_region_init(&s->pci_mem, OBJECT(s), "pci-memory", 4 * GiB);
-
- b = pci_register_root_bus(dev, "pci", dino_set_irq, dino_pci_map_irq, s,
- &s->pci_mem, get_system_io(),
- PCI_DEVFN(0, 0), 32, TYPE_PCI_BUS);
- s->parent_obj.bus = b;
+ b = s->parent_obj.bus;
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
memory_region_add_subregion(addr_space, DINO_HPA,
@@ -598,6 +592,14 @@ static void dino_pcihost_init(Object *obj)
memory_region_add_subregion(&s->this_mem, DINO_CONFIG_DATA,
&phb->data_mem);
+ /* Dino PCI bus memory. */
+ memory_region_init(&s->pci_mem, OBJECT(s), "pci-memory", 4 * GiB);
+
+ phb->bus = pci_register_root_bus(DEVICE(s), "pci",
+ dino_set_irq, dino_pci_map_irq, s,
+ &s->pci_mem, get_system_io(),
+ PCI_DEVFN(0, 0), 32, TYPE_PCI_BUS);
+
sysbus_init_mmio(sbd, &s->this_mem);
}