diff options
author | ian <ian@FreeBSD.org> | 2014-05-15 14:26:11 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2014-05-15 14:26:11 +0000 |
commit | 27f0a13f0adbfdb658bb63aac86772e0107c1c20 (patch) | |
tree | 51fd84ee4d563c9fcc06c0dd196587a24ab23dfc /sys/arm/mv | |
parent | e24fc6cb17a568070581980459e14fc4808f0bb4 (diff) | |
download | FreeBSD-src-27f0a13f0adbfdb658bb63aac86772e0107c1c20.zip FreeBSD-src-27f0a13f0adbfdb658bb63aac86772e0107c1c20.tar.gz |
MFC r261351, r261352, r261355, r261396, r261397, r261398, r261403, r261404,
r261405
Open Firmware interrupt specifiers can consist of arbitrary-length byte
strings and include arbitrary information (IRQ line/domain/sense). When the
ofw_bus_map_intr() API was introduced, it assumed that, as on most systems,
these were either 1 cell, containing an interrupt line, or 2, containing
a line number plus a sense code. It turns out a non-negligible number of
ARM systems use 3 (or even 4!) cells for interrupts, so make this more
general.
Provide a simpler and more standards-compliant simplebus implementation to
get the Routerboard 800 up and running with the vendor device tree. This
does not implement some BERI-specific features (which hopefully won't be
necessary soon), so move the old code to mips/beri, with a higher attach
priority when built, until MIPS interrupt domain support is rearranged.
Allow nesting of simplebuses.
Add a set of helpers (ofw_bus_get_status() and ofw_bus_status_okay()) to
process "status" properties of OF nodes.
Fix one remnant endian flaw in nexus.
Diffstat (limited to 'sys/arm/mv')
-rw-r--r-- | sys/arm/mv/mv_pci.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/arm/mv/mv_pci.c b/sys/arm/mv/mv_pci.c index 4660e5c..690ebb4 100644 --- a/sys/arm/mv/mv_pci.c +++ b/sys/arm/mv/mv_pci.c @@ -1050,7 +1050,8 @@ mv_pcib_route_interrupt(device_t bus, device_t dev, int pin) { struct mv_pcib_softc *sc; struct ofw_pci_register reg; - uint32_t pintr, mintr; + uint32_t pintr, mintr[4]; + int icells; phandle_t iparent; sc = device_get_softc(bus); @@ -1062,10 +1063,11 @@ mv_pcib_route_interrupt(device_t bus, device_t dev, int pin) (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, ®, - sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), - &iparent)) - return (ofw_bus_map_intr(dev, iparent, mintr)); + icells = ofw_bus_lookup_imap(ofw_bus_get_node(dev), &sc->sc_pci_iinfo, + ®, sizeof(reg), &pintr, sizeof(pintr), mintr, sizeof(mintr), + &iparent); + if (icells > 0) + return (ofw_bus_map_intr(dev, iparent, icells, mintr)); /* Maybe it's a real interrupt, not an intpin */ if (pin > 4) |