diff options
Diffstat (limited to 'src/mainboard/emulation/qemu-aarch64/mainboard.c')
-rw-r--r-- | src/mainboard/emulation/qemu-aarch64/mainboard.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/mainboard/emulation/qemu-aarch64/mainboard.c b/src/mainboard/emulation/qemu-aarch64/mainboard.c index 181536ce03..09b983f330 100644 --- a/src/mainboard/emulation/qemu-aarch64/mainboard.c +++ b/src/mainboard/emulation/qemu-aarch64/mainboard.c @@ -4,6 +4,7 @@ #include <symbols.h> #include <device/device.h> #include <bootmem.h> +#include <mainboard/addressmap.h> void bootmem_platform_add_ranges(void) { @@ -21,3 +22,32 @@ struct chip_operations mainboard_ops = { }; struct chip_operations mainboard_emulation_qemu_aarch64_ops = { }; + +static void qemu_aarch64_domain_read_resources(struct device *dev) +{ + struct resource *res; + int index = 0; + /* Initialize the system-wide I/O space constraints. */ + res = new_resource(dev, index++); + res->limit = 0xffff; + res->flags = IORESOURCE_IO | IORESOURCE_ASSIGNED; + + /* Initialize the system-wide memory resources constraints. */ + res = new_resource(dev, index++); + res->base = VIRT_PCIE_LOW_MMIO_BASE; + res->limit = VIRT_PCIE_LOW_MMIO_LIMIT; + res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED; + + res = new_resource(dev, index++); + res->base = VIRT_PCIE_HIGH_MMIO_BASE; + res->limit = VIRT_PCIE_HIGH_MMIO_LIMIT; + res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED; + + mmio_range(dev, index++, VIRT_PCIE_ECAM_BASE, VIRT_PCIE_ECAM_SIZE); +} + +struct device_operations qemu_aarch64_pci_domain_ops = { + .read_resources = qemu_aarch64_domain_read_resources, + .set_resources = pci_domain_set_resources, + .scan_bus = pci_domain_scan_bus, +}; |