xref: /linux/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.yaml (revision a1ff5a7d78a036d6c2178ee5acd6ba4946243800)
1*9ff14104SKanak Shilledar# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
2*9ff14104SKanak Shilledar%YAML 1.2
3*9ff14104SKanak Shilledar---
4*9ff14104SKanak Shilledar$id: http://devicetree.org/schemas/interrupt-controller/riscv,cpu-intc.yaml#
5*9ff14104SKanak Shilledar$schema: http://devicetree.org/meta-schemas/core.yaml#
6*9ff14104SKanak Shilledar
7*9ff14104SKanak Shilledartitle: RISC-V Hart-Level Interrupt Controller (HLIC)
8*9ff14104SKanak Shilledar
9*9ff14104SKanak Shilledardescription:
10*9ff14104SKanak Shilledar  RISC-V cores include Control Status Registers (CSRs) which are local to
11*9ff14104SKanak Shilledar  each CPU core (HART in RISC-V terminology) and can be read or written by
12*9ff14104SKanak Shilledar  software. Some of these CSRs are used to control local interrupts connected
13*9ff14104SKanak Shilledar  to the core. Every interrupt is ultimately routed through a hart's HLIC
14*9ff14104SKanak Shilledar  before it interrupts that hart.
15*9ff14104SKanak Shilledar
16*9ff14104SKanak Shilledar  The RISC-V supervisor ISA manual specifies three interrupt sources that are
17*9ff14104SKanak Shilledar  attached to every HLIC namely software interrupts, the timer interrupt, and
18*9ff14104SKanak Shilledar  external interrupts. Software interrupts are used to send IPIs between
19*9ff14104SKanak Shilledar  cores.  The timer interrupt comes from an architecturally mandated real-
20*9ff14104SKanak Shilledar  time timer that is controlled via Supervisor Binary Interface (SBI) calls
21*9ff14104SKanak Shilledar  and CSR reads. External interrupts connect all other device interrupts to
22*9ff14104SKanak Shilledar  the HLIC, which are routed via the platform-level interrupt controller
23*9ff14104SKanak Shilledar  (PLIC).
24*9ff14104SKanak Shilledar
25*9ff14104SKanak Shilledar  All RISC-V systems that conform to the supervisor ISA specification are
26*9ff14104SKanak Shilledar  required to have a HLIC with these three interrupt sources present.  Since
27*9ff14104SKanak Shilledar  the interrupt map is defined by the ISA it's not listed in the HLIC's device
28*9ff14104SKanak Shilledar  tree entry, though external interrupt controllers (like the PLIC, for
29*9ff14104SKanak Shilledar  example) will need to define how their interrupts map to the relevant HLICs.
30*9ff14104SKanak Shilledar  This means a PLIC interrupt property will typically list the HLICs for all
31*9ff14104SKanak Shilledar  present HARTs in the system.
32*9ff14104SKanak Shilledar
33*9ff14104SKanak Shilledarmaintainers:
34*9ff14104SKanak Shilledar  - Palmer Dabbelt <palmer@dabbelt.com>
35*9ff14104SKanak Shilledar  - Paul Walmsley <paul.walmsley@sifive.com>
36*9ff14104SKanak Shilledar
37*9ff14104SKanak Shilledarproperties:
38*9ff14104SKanak Shilledar  compatible:
39*9ff14104SKanak Shilledar    oneOf:
40*9ff14104SKanak Shilledar      - items:
41*9ff14104SKanak Shilledar          - const: andestech,cpu-intc
42*9ff14104SKanak Shilledar          - const: riscv,cpu-intc
43*9ff14104SKanak Shilledar      - const: riscv,cpu-intc
44*9ff14104SKanak Shilledar
45*9ff14104SKanak Shilledar  interrupt-controller: true
46*9ff14104SKanak Shilledar
47*9ff14104SKanak Shilledar  '#interrupt-cells':
48*9ff14104SKanak Shilledar    const: 1
49*9ff14104SKanak Shilledar    description: |
50*9ff14104SKanak Shilledar      The interrupt sources are defined by the RISC-V supervisor ISA manual,
51*9ff14104SKanak Shilledar      with only the following three interrupts being defined for
52*9ff14104SKanak Shilledar      supervisor mode:
53*9ff14104SKanak Shilledar        - Source 1 is the supervisor software interrupt, which can be sent by
54*9ff14104SKanak Shilledar          an SBI call and is reserved for use by software.
55*9ff14104SKanak Shilledar        - Source 5 is the supervisor timer interrupt, which can be configured
56*9ff14104SKanak Shilledar          by SBI calls and implements a one-shot timer.
57*9ff14104SKanak Shilledar        - Source 9 is the supervisor external interrupt, which chains to all
58*9ff14104SKanak Shilledar          other device interrupts.
59*9ff14104SKanak Shilledar
60*9ff14104SKanak Shilledarrequired:
61*9ff14104SKanak Shilledar  - compatible
62*9ff14104SKanak Shilledar  - '#interrupt-cells'
63*9ff14104SKanak Shilledar  - interrupt-controller
64*9ff14104SKanak Shilledar
65*9ff14104SKanak ShilledaradditionalProperties: false
66*9ff14104SKanak Shilledar
67*9ff14104SKanak Shilledarexamples:
68*9ff14104SKanak Shilledar  - |
69*9ff14104SKanak Shilledar    interrupt-controller {
70*9ff14104SKanak Shilledar        #interrupt-cells = <1>;
71*9ff14104SKanak Shilledar        compatible = "riscv,cpu-intc";
72*9ff14104SKanak Shilledar        interrupt-controller;
73*9ff14104SKanak Shilledar    };
74