On 4/7/23 00:02, BALATON Zoltan wrote:
Use the iomem region for the PCI io space and map it directly from the
board without an intermediate alias that is not really needed.

"Reduce the I/O region to 64K."

Signed-off-by: BALATON Zoltan <bala...@eik.bme.hu>
---
  hw/ppc/ppc440_pcix.c | 8 +++++---
  hw/ppc/sam460ex.c    | 6 +-----
  2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/hw/ppc/ppc440_pcix.c b/hw/ppc/ppc440_pcix.c
index ee2dc44f67..cca8a72c72 100644
--- a/hw/ppc/ppc440_pcix.c
+++ b/hw/ppc/ppc440_pcix.c
@@ -490,10 +490,11 @@ static void ppc440_pcix_realize(DeviceState *dev, Error 
**errp)
      s = PPC440_PCIX_HOST(dev);
sysbus_init_irq(sbd, &s->irq);
-    memory_region_init(&s->busmem, OBJECT(dev), "pci bus memory", UINT64_MAX);
+    memory_region_init(&s->busmem, OBJECT(dev), "pci-mem", UINT64_MAX);
+    memory_region_init(&s->iomem, OBJECT(dev), "pci-io", 0x10000);

64 * KiB

      h->bus = pci_register_root_bus(dev, NULL, ppc440_pcix_set_irq,
-                         ppc440_pcix_map_irq, &s->irq, &s->busmem,
-                         get_system_io(), PCI_DEVFN(0, 0), 1, TYPE_PCI_BUS);
+                         ppc440_pcix_map_irq, &s->irq, &s->busmem, &s->iomem,
+                         PCI_DEVFN(0, 0), 1, TYPE_PCI_BUS);
s->dev = pci_create_simple(h->bus, PCI_DEVFN(0, 0),
                                 TYPE_PPC4xx_HOST_BRIDGE);
@@ -514,6 +515,7 @@ static void ppc440_pcix_realize(DeviceState *dev, Error 
**errp)
      memory_region_add_subregion(&s->container, PCIC0_CFGDATA, &h->data_mem);
      memory_region_add_subregion(&s->container, PPC440_REG_BASE, regs);
      sysbus_init_mmio(sbd, &s->container);
+    sysbus_init_mmio(sbd, &s->iomem);
  }

With the changes requested:
Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>



Reply via email to