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