summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/ofw
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2013-10-21 00:04:26 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2013-10-21 00:04:26 +0000
commit1907ae54f114fb93c693357f584a6395bdfdb091 (patch)
tree60106ad460b78e418f4b363f03c837b1576c45ae /sys/powerpc/ofw
parent3bf0291c8b47df26ae764781ec6c3c0f9adf74ab (diff)
downloadFreeBSD-src-1907ae54f114fb93c693357f584a6395bdfdb091.zip
FreeBSD-src-1907ae54f114fb93c693357f584a6395bdfdb091.tar.gz
Allow the OFW interrupt mapping code to work with PCI devices not enumerated
by Open Firmware, as in the case of FDT.
Diffstat (limited to 'sys/powerpc/ofw')
-rw-r--r--sys/powerpc/ofw/ofw_pci.c7
-rw-r--r--sys/powerpc/ofw/ofw_pcib_pci.c8
-rw-r--r--sys/powerpc/ofw/ofw_pcibus.c11
3 files changed, 15 insertions, 11 deletions
diff --git a/sys/powerpc/ofw/ofw_pci.c b/sys/powerpc/ofw/ofw_pci.c
index 46d483d..8a9d05f 100644
--- a/sys/powerpc/ofw/ofw_pci.c
+++ b/sys/powerpc/ofw/ofw_pci.c
@@ -246,6 +246,13 @@ ofw_pci_route_interrupt(device_t bus, device_t dev, int pin)
sc = device_get_softc(bus);
pintr = pin;
+
+ /* Fabricate imap information in case this isn't an OFW device */
+ bzero(&reg, sizeof(reg));
+ reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) |
+ (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) |
+ (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT);
+
if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, &reg,
sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr),
&iparent, maskbuf))
diff --git a/sys/powerpc/ofw/ofw_pcib_pci.c b/sys/powerpc/ofw/ofw_pcib_pci.c
index d6c4168..fb0a488 100644
--- a/sys/powerpc/ofw/ofw_pcib_pci.c
+++ b/sys/powerpc/ofw/ofw_pcib_pci.c
@@ -29,6 +29,7 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/malloc.h>
@@ -141,6 +142,13 @@ ofw_pcib_pci_route_interrupt(device_t bridge, device_t dev, int intpin)
ii = &sc->ops_iinfo;
if (ii->opi_imapsz > 0) {
pintr = intpin;
+
+ /* Fabricate imap information if this isn't an OFW device */
+ bzero(&reg, sizeof(reg));
+ reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) |
+ (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) |
+ (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT);
+
if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), ii, &reg,
sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr),
&iparent, maskbuf)) {
diff --git a/sys/powerpc/ofw/ofw_pcibus.c b/sys/powerpc/ofw/ofw_pcibus.c
index 744b7ac72..b78793e 100644
--- a/sys/powerpc/ofw/ofw_pcibus.c
+++ b/sys/powerpc/ofw/ofw_pcibus.c
@@ -322,20 +322,9 @@ ofw_pcibus_assign_interrupt(device_t dev, device_t child)
if (node == -1) {
/* Non-firmware enumerated child, use standard routing */
- /*
- * XXX: Right now we don't have anything sensible to do here,
- * since the ofw_imap stuff relies on nodes having a reg
- * property. There exist ways around this, so the ePAPR
- * spec will need to be studied.
- */
-
- return (PCI_INVALID_IRQ);
-
-#ifdef NOTYET
intr = pci_get_intpin(child);
return (PCIB_ROUTE_INTERRUPT(device_get_parent(dev), child,
intr));
-#endif
}
/*
OpenPOWER on IntegriCloud