Page MenuHomeFreeBSD

Implement MIPS and PCI(e) interrupt support.
ClosedPublic

Authored by landonf on Sep 27 2017, 10:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 13, 12:45 AM
Unknown Object (File)
Sat, Apr 13, 12:44 AM
Unknown Object (File)
Fri, Apr 12, 1:11 PM
Unknown Object (File)
Fri, Apr 12, 8:10 AM
Unknown Object (File)
Fri, Apr 12, 8:09 AM
Unknown Object (File)
Thu, Mar 28, 11:01 AM
Unknown Object (File)
Feb 25 2024, 10:44 PM
Unknown Object (File)
Feb 20 2024, 5:26 PM
Subscribers

Details

Summary

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
cores.

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),
bhnd_chipc(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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 11822
Build 12165: arc lint + arc unit

Event Timeline

Re-enable support for the PCIe-G2 core.

mizhka added inline comments.
sys/mips/broadcom/bcm_mips74k.c
311–332

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

sys/mips/broadcom/bcma_nexus.c
62

typo, BMCA

sys/mips/include/intr.h
62–63

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

sys/mips/include/intr.h
62–63

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.