[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 14/14] ppc440_pcix: Stop using system io region for PCI bus
From: |
BALATON Zoltan |
Subject: |
[PATCH v2 14/14] ppc440_pcix: Stop using system io region for PCI bus |
Date: |
Wed, 5 Jul 2023 22:12:59 +0200 (CEST) |
Reduce the iomem region to 64K and use it for the PCI io space and map
it directly from the board without an intermediate alias that is not
really needed.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/ppc/ppc440_pcix.c | 9 ++++++---
hw/ppc/sam460ex.c | 6 +-----
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/hw/ppc/ppc440_pcix.c b/hw/ppc/ppc440_pcix.c
index cf932e4b25..672090de94 100644
--- a/hw/ppc/ppc440_pcix.c
+++ b/hw/ppc/ppc440_pcix.c
@@ -23,6 +23,7 @@
#include "qemu/error-report.h"
#include "qemu/log.h"
#include "qemu/module.h"
+#include "qemu/units.h"
#include "hw/irq.h"
#include "hw/ppc/ppc.h"
#include "hw/ppc/ppc4xx.h"
@@ -490,10 +491,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", 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 +516,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, &s->regs);
sysbus_init_mmio(sbd, &s->container);
+ sysbus_init_mmio(sbd, &s->iomem);
}
static void ppc440_pcix_class_init(ObjectClass *klass, void *data)
diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
index 8d0e551d14..1e615b8d35 100644
--- a/hw/ppc/sam460ex.c
+++ b/hw/ppc/sam460ex.c
@@ -269,7 +269,6 @@ static void main_cpu_reset(void *opaque)
static void sam460ex_init(MachineState *machine)
{
- MemoryRegion *isa = g_new(MemoryRegion, 1);
MemoryRegion *l2cache_ram = g_new(MemoryRegion, 1);
DeviceState *uic[4];
int i;
@@ -441,12 +440,9 @@ static void sam460ex_init(MachineState *machine)
/* All PCI irqs are connected to the same UIC pin (cf. UBoot source) */
dev = sysbus_create_simple(TYPE_PPC440_PCIX_HOST, 0xc0ec00000,
qdev_get_gpio_in(uic[1], 0));
+ sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, 0xc08000000);
pci_bus = PCI_BUS(qdev_get_child_bus(dev, "pci.0"));
- memory_region_init_alias(isa, NULL, "isa_mmio", get_system_io(),
- 0, 0x10000);
- memory_region_add_subregion(get_system_memory(), 0xc08000000, isa);
-
/* PCI devices */
pci_create_simple(pci_bus, PCI_DEVFN(6, 0), "sm501");
/* SoC has a single SATA port but we don't emulate that yet
--
2.30.9
- [PATCH v2 03/14] ppc440: Add a macro to shorten PCIe controller DCR registration, (continued)
- [PATCH v2 03/14] ppc440: Add a macro to shorten PCIe controller DCR registration, BALATON Zoltan, 2023/07/05
- [PATCH v2 06/14] ppc440: Stop using system io region for PCIe buses, BALATON Zoltan, 2023/07/05
- [PATCH v2 04/14] ppc440: Rename parent field of PPC460EXPCIEState to match code style, BALATON Zoltan, 2023/07/05
- [PATCH v2 08/14] ppc440: Add busnum property to PCIe controller model, BALATON Zoltan, 2023/07/05
- [PATCH v2 05/14] ppc440: Rename local variable in dcr_read_pcie(), BALATON Zoltan, 2023/07/05
- [PATCH v2 09/14] ppc440: Remove ppc460ex_pcie_init legacy init function, BALATON Zoltan, 2023/07/05
- [PATCH v2 07/14] ppc/sam460ex: Remove address_space_mem local variable, BALATON Zoltan, 2023/07/05
- [PATCH v2 10/14] ppc4xx_pci: Rename QOM type name define, BALATON Zoltan, 2023/07/05
- [PATCH v2 14/14] ppc440_pcix: Stop using system io region for PCI bus,
BALATON Zoltan <=
- [PATCH v2 11/14] ppc4xx_pci: Add define for ppc4xx-host-bridge type name, BALATON Zoltan, 2023/07/05
- [PATCH v2 12/14] ppc440_pcix: Rename QOM type define abd move it to common header, BALATON Zoltan, 2023/07/05
- [PATCH v2 13/14] ppc440_pcix: Don't use iomem for regs, BALATON Zoltan, 2023/07/05
- Re: [PATCH v2 00/14] PPC440 devices misc clean up, BALATON Zoltan, 2023/07/05
- Re: [PATCH v2 00/14] PPC440 devices misc clean up, Daniel Henrique Barboza, 2023/07/05