aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBALATON Zoltan <balaton@eik.bme.hu>2019-02-21 13:25:00 +0100
committerAleksandar Markovic <amarkovic@wavecomp.com>2019-02-21 19:36:47 +0100
commitf7cf2219c52f3d0f173b5b03aa193ff0efd73e9c (patch)
treed85ecdb4fc38129e1a85c8053aa9d390a2df593c
parent535db74413755701d62a49466139a6ef37ad65f4 (diff)
hw/pci-host/bonito.c: Add PCI mem region mapped at the correct address
Stop using system memory as PCI memory otherwise devices such as VGA that have regions mapped to PCI memory clash with RAM. Use a separate memory region for PCI memory and map it to the correct address in system memory which allows PCI mem regions to show at the correct address where clients expect them. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
-rw-r--r--hw/pci-host/bonito.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index 9f33582706..dde4437595 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -217,6 +217,7 @@ struct BonitoState {
PCIHostState parent_obj;
qemu_irq *pic;
PCIBonitoState *pci_dev;
+ MemoryRegion pci_mem;
};
#define TYPE_BONITO_PCI_HOST_BRIDGE "Bonito-pcihost"
@@ -598,11 +599,15 @@ static const VMStateDescription vmstate_bonito = {
static void bonito_pcihost_realize(DeviceState *dev, Error **errp)
{
PCIHostState *phb = PCI_HOST_BRIDGE(dev);
+ BonitoState *bs = BONITO_PCI_HOST_BRIDGE(dev);
+ memory_region_init(&bs->pci_mem, OBJECT(dev), "pci.mem", BONITO_PCILO_SIZE);
phb->bus = pci_register_root_bus(DEVICE(dev), "pci",
pci_bonito_set_irq, pci_bonito_map_irq,
- dev, get_system_memory(), get_system_io(),
+ dev, &bs->pci_mem, get_system_io(),
0x28, 32, TYPE_PCI_BUS);
+ memory_region_add_subregion(get_system_memory(), BONITO_PCILO_BASE,
+ &bs->pci_mem);
}
static void bonito_realize(PCIDevice *dev, Error **errp)