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
This commit is contained in:
andrew 2016-05-16 10:03:57 +00:00
parent c121e24b65
commit 26e3729fc0

View File

@ -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,