riscv,cpu-intc.yaml 2.7 KB

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