aboutsummaryrefslogtreecommitdiff
path: root/hw/hppa/dino.c
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-05-04 10:25:14 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-05-08 18:52:36 +0100
commitcc363c4a10b99709ea4e9e185c7b71de72f88a17 (patch)
treeacf5d94a55df02c6561fbfc9ea0c105a62d7b965 /hw/hppa/dino.c
parent63901b6cc4d8b471ac4b92826220db914b908368 (diff)
dino: move PCI windows 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-5-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/dino.c')
-rw-r--r--hw/hppa/dino.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c
index c6c01ea14c..bc27aad5dc 100644
--- a/hw/hppa/dino.c
+++ b/hw/hppa/dino.c
@@ -519,7 +519,6 @@ PCIBus *dino_init(MemoryRegion *addr_space,
DeviceState *dev;
DinoState *s;
PCIBus *b;
- int i;
dev = qdev_new(TYPE_DINO_PCI_HOST_BRIDGE);
s = DINO_PCI_HOST_BRIDGE(dev);
@@ -532,16 +531,6 @@ PCIBus *dino_init(MemoryRegion *addr_space,
memory_region_add_subregion(addr_space, DINO_HPA,
sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0));
- /* Set up windows into PCI bus memory. */
- for (i = 1; i < 31; i++) {
- uint32_t addr = 0xf0000000 + i * DINO_MEM_CHUNK_SIZE;
- char *name = g_strdup_printf("PCI Outbound Window %d", i);
- memory_region_init_alias(&s->pci_mem_alias[i], OBJECT(s),
- name, &s->pci_mem, addr,
- DINO_MEM_CHUNK_SIZE);
- g_free(name);
- }
-
/* Set up PCI view of memory: Bus master address space. */
memory_region_init(&s->bm, OBJECT(s), "bm-dino", 4 * GiB);
memory_region_init_alias(&s->bm_ram_alias, OBJECT(s),
@@ -575,6 +564,7 @@ static void dino_pcihost_init(Object *obj)
DinoState *s = DINO_PCI_HOST_BRIDGE(obj);
PCIHostState *phb = PCI_HOST_BRIDGE(obj);
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
+ int i;
/* Dino PCI access from main memory. */
memory_region_init_io(&s->this_mem, OBJECT(s), &dino_chip_ops,
@@ -600,6 +590,16 @@ static void dino_pcihost_init(Object *obj)
&s->pci_mem, get_system_io(),
PCI_DEVFN(0, 0), 32, TYPE_PCI_BUS);
+ /* Set up windows into PCI bus memory. */
+ for (i = 1; i < 31; i++) {
+ uint32_t addr = 0xf0000000 + i * DINO_MEM_CHUNK_SIZE;
+ char *name = g_strdup_printf("PCI Outbound Window %d", i);
+ memory_region_init_alias(&s->pci_mem_alias[i], OBJECT(s),
+ name, &s->pci_mem, addr,
+ DINO_MEM_CHUNK_SIZE);
+ g_free(name);
+ }
+
sysbus_init_mmio(sbd, &s->this_mem);
}