/* Creates MMIO mappings base..end as well as 4 SPIs from the given base. */ static int xgene_storm_pcie_specific_mapping(struct domain *d, const struct dt_device_node *node, paddr_t base, paddr_t end, int base_spi) { int ret; printk("Mapping additional regions for PCIe device %s\n", dt_node_full_name(node)); /* Map the PCIe bus resources */ ret = map_one_mmio(d, "PCI MEMORY", paddr_to_pfn(base), paddr_to_pfn(end)); if ( ret ) goto err; ret = map_one_spi(d, "PCI#INTA", base_spi+0, DT_IRQ_TYPE_LEVEL_HIGH); if ( ret ) goto err; ret = map_one_spi(d, "PCI#INTB", base_spi+1, DT_IRQ_TYPE_LEVEL_HIGH); if ( ret ) goto err; ret = map_one_spi(d, "PCI#INTC", base_spi+2, DT_IRQ_TYPE_LEVEL_HIGH); if ( ret ) goto err; ret = map_one_spi(d, "PCI#INTD", base_spi+3, DT_IRQ_TYPE_LEVEL_HIGH); if ( ret ) goto err; ret = 0; err: return ret; }
/* * Xen does not currently support mapping MMIO regions and interrupt * for bus child devices (referenced via the "ranges" and * "interrupt-map" properties to domain 0). Instead for now map the * necessary resources manually. */ static int xgene_storm_specific_mapping(struct domain *d) { int ret; /* Map the PCIe bus resources */ ret = map_one_mmio(d, "PCI MEM REGION", paddr_to_pfn(0xe000000000UL), paddr_to_pfn(0xe010000000UL)); if ( ret ) goto err; ret = map_one_mmio(d, "PCI IO REGION", paddr_to_pfn(0xe080000000UL), paddr_to_pfn(0xe080010000UL)); if ( ret ) goto err; ret = map_one_mmio(d, "PCI CFG REGION", paddr_to_pfn(0xe0d0000000UL), paddr_to_pfn(0xe0d0200000UL)); if ( ret ) goto err; ret = map_one_mmio(d, "PCI MSI REGION", paddr_to_pfn(0xe010000000UL), paddr_to_pfn(0xe010800000UL)); if ( ret ) goto err; ret = map_one_spi(d, "PCI#INTA", 0xc2, DT_IRQ_TYPE_LEVEL_HIGH); if ( ret ) goto err; ret = map_one_spi(d, "PCI#INTB", 0xc3, DT_IRQ_TYPE_LEVEL_HIGH); if ( ret ) goto err; ret = map_one_spi(d, "PCI#INTC", 0xc4, DT_IRQ_TYPE_LEVEL_HIGH); if ( ret ) goto err; ret = map_one_spi(d, "PCI#INTD", 0xc5, DT_IRQ_TYPE_LEVEL_HIGH); if ( ret ) goto err; ret = 0; err: return ret; }