HomeFreeBSD

plic: handling for interrupt-cells == 2

Description

plic: handling for interrupt-cells == 2

Some device trees report interrupt info in two cells: the first value is
the IRQ number, the second value indicates the trigger type, such as
IRQ_TYPE_LEVEL_HIGH. The device tree for the Allwinner D1(s) is one such
case. Thus, extend the PLIC driver to accept this extra information when
available.

Apparently, some PLIC implementations using edge-triggered interrupts
will require some special handling. This is not required for the D1, and
therefore not implemented in this change. However, to prevent
misbehaviour a check is added to reject this case and a message will be
printed.

Similarly, emit messages for the error paths, e.g. ncells == 3. Drivers
will fail to attach all the same, but the message will aid in diagnosing
the issue more quickly.

Reviewed by: br
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47135

Details

Provenance
mhorneAuthored on Wed, Oct 30, 6:17 PM
Reviewer
br
Differential Revision
D47135: plic: handling for interrupt-cells == 2
Parents
rGd584228930a1: plic, aplic: handle all pending interrupts for hart
Branches
Unknown
Tags
Unknown