diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2011-09-03 16:38:02 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2011-09-04 09:28:04 +0000 |
commit | f69539b14bdba7a5cd22e1f4bed439b476b17286 (patch) | |
tree | 95e4e000537e39cb82ee286076f17f2346dc5137 /hw/apb_pci.c | |
parent | 962d4b2834e6a3b37784391a906b5fe2a7e96b74 (diff) |
apb_pci: convert PCI space to memory API
Add a new memory space for PCI instead of using system memory.
This also fixes a bug where VGA region vga.chain4 is
accidentally mapped to 0xa0000 instead of 0x1ff000a0000.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/apb_pci.c')
-rw-r--r-- | hw/apb_pci.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/hw/apb_pci.c b/hw/apb_pci.c index 6ee2068128..c232946280 100644 --- a/hw/apb_pci.c +++ b/hw/apb_pci.c @@ -71,6 +71,7 @@ typedef struct APBState { PCIBus *bus; MemoryRegion apb_config; MemoryRegion pci_config; + MemoryRegion pci_mmio; MemoryRegion pci_ioport; uint32_t iommu[4]; uint32_t pci_control[16]; @@ -336,12 +337,14 @@ PCIBus *pci_apb_init(target_phys_addr_t special_base, sysbus_mmio_map(s, 2, special_base + 0x2000000ULL); d = FROM_SYSBUS(APBState, s); + memory_region_init(&d->pci_mmio, "pci-mmio", 0x100000000ULL); + memory_region_add_subregion(get_system_memory(), mem_base, &d->pci_mmio); + d->bus = pci_register_bus(&d->busdev.qdev, "pci", - pci_apb_set_irq, pci_pbm_map_irq, d, - get_system_memory(), - get_system_io(), - 0, 32); - pci_bus_set_mem_base(d->bus, mem_base); + pci_apb_set_irq, pci_pbm_map_irq, d, + &d->pci_mmio, + get_system_io(), + 0, 32); for (i = 0; i < 32; i++) { sysbus_connect_irq(s, i, pic[i]); |