Page MenuHomeFreeBSD

Implement MIPS and PCI(e) interrupt support.

Authored by landonf on Sep 27 2017, 10:04 PM.



On BHND MIPS SoCs, this replaces the use of hard-coded non-portable MIPS CPU
IRQs in the common bhnd(4) core drivers; we now register an INTRNG child PIC
that handles routing of backplane interrupt signals to the MIPS core, where
they are mapped to MIPS CPU interrupts and dispatched accordingly.

Dedicated MIPS CPU interrupts are allocated according to a simple core priority
table, with a single shared MIPS CPU interrupt reserved for lower-priority

On BHND PCIe devices, backplane interrupt signals are now routed to the PCI/PCIe
host bridge core when bus_setup_intr() is called, where they are dispatched by
the PCI core via a host interrupt (e.g. INTx/MSI/MSI-X on PCI bridge cores).

The bhndb(4) bridge driver tracks registered interrupt handlers for the bridged
bhnd(4) devices, delegating actual interrupt setup/teardown to the parent PCI
bus on behalf of the bridged cores.

Depends on D12385

Test Plan

Tested against bcma(4) and siba(4) MIPS targets, with no regressions found in
the existing bhnd(4) drivers that make use of interrupts (bhnd_usb(4),

Tested against bwn(4) PCIe devices (using the in-development bhnd compatibility shims),
and verified that the MAC core's interrupts are correctly dispatched to the
bwn(4) driver's interrupt handler.

Diff Detail

rS FreeBSD src repository - subversion
Lint Not Applicable
Tests Not Applicable

Event Timeline

Re-enable support for the PCIe-G2 core.

mizhka added inline comments.
311–332 ↗(On Diff #33579)

May be single bus_read_4 is enough thanks to fixed step between registers?

62 ↗(On Diff #33579)

typo, BMCA

62–63 ↗(On Diff #33579)

in intr_machdep.h it's defined for !(defined(CPU_RMI) || defined(CPU_NLM)).

62–63 ↗(On Diff #33579)

I could do the same here, but these are only defined if INTRNG is enabled; mips/rmi and mips/nlm will already need to make changes to intr.h and mips_pic.c if/when they adopt INTRNG (and it's possible they never will), so I'd prefer to avoid preemptively including changes that imply support for RMI/NLM that doesn't actually exist.

  • Simplify IRQ switch() statement by using BCM_MIPS74K_INTR_SEL(irq).
  • Fix BMCA->BCMA typo.
This revision was automatically updated to reflect the committed changes.