diff options
| author | Andrew Turner <andrew@FreeBSD.org> | 2016-05-16 10:03:57 +0000 |
|---|---|---|
| committer | Andrew Turner <andrew@FreeBSD.org> | 2016-05-16 10:03:57 +0000 |
| commit | 4e1763d34c54dc9043778cadc41d38ce9f54c415 (patch) | |
| tree | 46c7243070a09a64110daba07cd1ab87902bf9ee /sys/arm64/cavium | |
| parent | b334cdea9bb6cb6c07728e7c6389576718726b34 (diff) | |
Notes
Diffstat (limited to 'sys/arm64/cavium')
| -rw-r--r-- | sys/arm64/cavium/thunder_pcie_pem_fdt.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/sys/arm64/cavium/thunder_pcie_pem_fdt.c b/sys/arm64/cavium/thunder_pcie_pem_fdt.c index 9e4770b302e5..7f0398e28dec 100644 --- a/sys/arm64/cavium/thunder_pcie_pem_fdt.c +++ b/sys/arm64/cavium/thunder_pcie_pem_fdt.c @@ -109,6 +109,60 @@ thunder_pem_fdt_probe(device_t dev) return (ENXIO); } +#ifdef INTRNG +static int +thunder_pem_fdt_alloc_msi(device_t pci, device_t child, int count, int maxcount, + int *irqs) +{ + phandle_t msi_parent; + + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + return (intr_alloc_msi(pci, child, msi_parent, count, maxcount, + irqs)); +} + +static int +thunder_pem_fdt_release_msi(device_t pci, device_t child, int count, int *irqs) +{ + phandle_t msi_parent; + + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + return (intr_release_msi(pci, child, msi_parent, count, irqs)); +} + +static int +thunder_pem_fdt_alloc_msix(device_t pci, device_t child, int *irq) +{ + phandle_t msi_parent; + + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + return (intr_alloc_msix(pci, child, msi_parent, irq)); +} + +static int +thunder_pem_fdt_release_msix(device_t pci, device_t child, int irq) +{ + phandle_t msi_parent; + + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + return (intr_release_msix(pci, child, msi_parent, irq)); +} + +static int +thunder_pem_fdt_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, + uint32_t *data) +{ + phandle_t msi_parent; + + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + return (intr_map_msi(pci, child, msi_parent, irq, addr, data)); +} +#else static int thunder_pem_fdt_alloc_msi(device_t pci, device_t child, int count, int maxcount, int *irqs) @@ -145,6 +199,7 @@ thunder_pem_fdt_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, return (arm_map_msi(pci, child, irq, addr, data)); } +#endif static int thunder_pem_fdt_get_id(device_t dev, device_t child, enum pci_id_type type, |
