svn commit: r299934 - head/sys/arm64/cavium
Andrew Turner
andrew at FreeBSD.org
Mon May 16 10:03:59 UTC 2016
Author: andrew
Date: Mon May 16 10:03:57 2016
New Revision: 299934
URL: https://svnweb.freebsd.org/changeset/base/299934
Log:
Teach the ThunderX PCI PEM driver about intrng. This will be used later
when arm64 is supported by intrng.
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
Modified:
head/sys/arm64/cavium/thunder_pcie_pem_fdt.c
Modified: head/sys/arm64/cavium/thunder_pcie_pem_fdt.c
==============================================================================
--- head/sys/arm64/cavium/thunder_pcie_pem_fdt.c Mon May 16 09:56:48 2016 (r299933)
+++ head/sys/arm64/cavium/thunder_pcie_pem_fdt.c Mon May 16 10:03:57 2016 (r299934)
@@ -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, de
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,
More information about the svn-src-all
mailing list