arm,gic-v3.yaml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. # SPDX-License-Identifier: GPL-2.0
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/interrupt-controller/arm,gic-v3.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: ARM Generic Interrupt Controller, version 3
  7. maintainers:
  8. - Marc Zyngier <maz@kernel.org>
  9. description: |
  10. AArch64 SMP cores are often associated with a GICv3, providing Private
  11. Peripheral Interrupts (PPI), Shared Peripheral Interrupts (SPI),
  12. Software Generated Interrupts (SGI), and Locality-specific Peripheral
  13. Interrupts (LPI).
  14. allOf:
  15. - $ref: /schemas/interrupt-controller.yaml#
  16. properties:
  17. compatible:
  18. oneOf:
  19. - items:
  20. - enum:
  21. - qcom,msm8996-gic-v3
  22. - const: arm,gic-v3
  23. - const: arm,gic-v3
  24. interrupt-controller: true
  25. "#address-cells":
  26. enum: [ 0, 1, 2 ]
  27. "#size-cells":
  28. enum: [ 1, 2 ]
  29. ranges: true
  30. "#interrupt-cells":
  31. description: |
  32. Specifies the number of cells needed to encode an interrupt source.
  33. Must be a single cell with a value of at least 3.
  34. If the system requires describing PPI affinity, then the value must
  35. be at least 4.
  36. The 1st cell is the interrupt type; 0 for SPI interrupts, 1 for PPI
  37. interrupts, 2 for interrupts in the Extended SPI range, 3 for the
  38. Extended PPI range. Other values are reserved for future use.
  39. The 2nd cell contains the interrupt number for the interrupt type.
  40. SPI interrupts are in the range [0-987]. PPI interrupts are in the
  41. range [0-15]. Extended SPI interrupts are in the range [0-1023].
  42. Extended PPI interrupts are in the range [0-127].
  43. The 3rd cell is the flags, encoded as follows:
  44. bits[3:0] trigger type and level flags.
  45. 1 = edge triggered
  46. 4 = level triggered
  47. The 4th cell is a phandle to a node describing a set of CPUs this
  48. interrupt is affine to. The interrupt must be a PPI, and the node
  49. pointed must be a subnode of the "ppi-partitions" subnode. For
  50. interrupt types other than PPI or PPIs that are not partitioned,
  51. this cell must be zero. See the "ppi-partitions" node description
  52. below.
  53. Cells 5 and beyond are reserved for future use and must have a value
  54. of 0 if present.
  55. enum: [ 3, 4 ]
  56. reg:
  57. description: |
  58. Specifies base physical address(s) and size of the GIC
  59. registers, in the following order:
  60. - GIC Distributor interface (GICD)
  61. - GIC Redistributors (GICR), one range per redistributor region
  62. - GIC CPU interface (GICC)
  63. - GIC Hypervisor interface (GICH)
  64. - GIC Virtual CPU interface (GICV)
  65. GICC, GICH and GICV are optional, but must be described if the CPUs
  66. support them. Examples of such CPUs are ARM's implementations of the
  67. ARMv8.0 architecture such as Cortex-A32, A34, A35, A53, A57, A72 and
  68. A73 (this list is not exhaustive).
  69. minItems: 2
  70. maxItems: 4096 # Should be enough?
  71. interrupts:
  72. description:
  73. Interrupt source of the VGIC maintenance interrupt.
  74. maxItems: 1
  75. redistributor-stride:
  76. description:
  77. If using padding pages, specifies the stride of consecutive
  78. redistributors. Must be a multiple of 64kB.
  79. $ref: /schemas/types.yaml#/definitions/uint64
  80. multipleOf: 0x10000
  81. exclusiveMinimum: 0
  82. "#redistributor-regions":
  83. description:
  84. The number of independent contiguous regions occupied by the
  85. redistributors. Required if more than one such region is present.
  86. $ref: /schemas/types.yaml#/definitions/uint32
  87. maximum: 4096
  88. dma-noncoherent:
  89. description:
  90. Present if the GIC redistributors permit programming shareability
  91. and cacheability attributes but are connected to a non-coherent
  92. downstream interconnect.
  93. msi-controller:
  94. description:
  95. Only present if the Message Based Interrupt functionality is
  96. being exposed by the HW, and the mbi-ranges property present.
  97. mbi-ranges:
  98. description:
  99. A list of pairs <intid span>, where "intid" is the first SPI of a range
  100. that can be used an MBI, and "span" the size of that range. Multiple
  101. ranges can be provided.
  102. $ref: /schemas/types.yaml#/definitions/uint32-matrix
  103. items:
  104. minItems: 2
  105. maxItems: 2
  106. mbi-alias:
  107. description:
  108. Address property. Base address of an alias of the GICD region containing
  109. only the {SET,CLR}SPI registers to be used if isolation is required,
  110. and if supported by the HW.
  111. $ref: /schemas/types.yaml#/definitions/uint32-array
  112. items:
  113. minItems: 1
  114. maxItems: 2
  115. ppi-partitions:
  116. type: object
  117. additionalProperties: false
  118. description:
  119. PPI affinity can be expressed as a single "ppi-partitions" node,
  120. containing a set of sub-nodes.
  121. patternProperties:
  122. "^interrupt-partition-[0-9]+$":
  123. type: object
  124. additionalProperties: false
  125. properties:
  126. affinity:
  127. $ref: /schemas/types.yaml#/definitions/phandle-array
  128. items:
  129. maxItems: 1
  130. description:
  131. Should be a list of phandles to CPU nodes (as described in
  132. Documentation/devicetree/bindings/arm/cpus.yaml).
  133. required:
  134. - affinity
  135. clocks:
  136. maxItems: 1
  137. clock-names:
  138. items:
  139. - const: aclk
  140. power-domains:
  141. maxItems: 1
  142. resets:
  143. maxItems: 1
  144. mediatek,broken-save-restore-fw:
  145. type: boolean
  146. description:
  147. Asserts that the firmware on this device has issues saving and restoring
  148. GICR registers when the GIC redistributors are powered off.
  149. dependencies:
  150. mbi-ranges: [ msi-controller ]
  151. msi-controller: [ mbi-ranges ]
  152. required:
  153. - compatible
  154. - reg
  155. patternProperties:
  156. "^gic-its@": false
  157. "^interrupt-controller@[0-9a-f]+$": false
  158. # msi-controller is preferred, but allow other names
  159. "^(msi-controller|gic-its|interrupt-controller)@[0-9a-f]+$":
  160. type: object
  161. description:
  162. GICv3 has one or more Interrupt Translation Services (ITS) that are
  163. used to route Message Signalled Interrupts (MSI) to the CPUs.
  164. properties:
  165. compatible:
  166. const: arm,gic-v3-its
  167. dma-noncoherent:
  168. description:
  169. Present if the GIC ITS permits programming shareability and
  170. cacheability attributes but is connected to a non-coherent
  171. downstream interconnect.
  172. msi-controller: true
  173. "#msi-cells":
  174. description:
  175. The single msi-cell is the DeviceID of the device which will generate
  176. the MSI.
  177. const: 1
  178. reg:
  179. description:
  180. Specifies the base physical address and size of the ITS registers.
  181. maxItems: 1
  182. socionext,synquacer-pre-its:
  183. description:
  184. (u32, u32) tuple describing the untranslated
  185. address and size of the pre-ITS window.
  186. $ref: /schemas/types.yaml#/definitions/uint32-array
  187. items:
  188. minItems: 2
  189. maxItems: 2
  190. required:
  191. - compatible
  192. - msi-controller
  193. - "#msi-cells"
  194. - reg
  195. additionalProperties: false
  196. additionalProperties: false
  197. examples:
  198. - |
  199. gic: interrupt-controller@2cf00000 {
  200. compatible = "arm,gic-v3";
  201. #interrupt-cells = <3>;
  202. #address-cells = <1>;
  203. #size-cells = <1>;
  204. ranges;
  205. interrupt-controller;
  206. reg = <0x2f000000 0x10000>, // GICD
  207. <0x2f100000 0x200000>, // GICR
  208. <0x2c000000 0x2000>, // GICC
  209. <0x2c010000 0x2000>, // GICH
  210. <0x2c020000 0x2000>; // GICV
  211. interrupts = <1 9 4>;
  212. msi-controller;
  213. mbi-ranges = <256 128>;
  214. msi-controller@2c200000 {
  215. compatible = "arm,gic-v3-its";
  216. msi-controller;
  217. #msi-cells = <1>;
  218. reg = <0x2c200000 0x20000>;
  219. };
  220. };
  221. - |
  222. interrupt-controller@2c010000 {
  223. compatible = "arm,gic-v3";
  224. #interrupt-cells = <4>;
  225. #address-cells = <1>;
  226. #size-cells = <1>;
  227. ranges;
  228. interrupt-controller;
  229. redistributor-stride = <0x0 0x40000>; // 256kB stride
  230. #redistributor-regions = <2>;
  231. reg = <0x2c010000 0x10000>, // GICD
  232. <0x2d000000 0x800000>, // GICR 1: CPUs 0-31
  233. <0x2e000000 0x800000>, // GICR 2: CPUs 32-63
  234. <0x2c040000 0x2000>, // GICC
  235. <0x2c060000 0x2000>, // GICH
  236. <0x2c080000 0x2000>; // GICV
  237. interrupts = <1 9 4 0>;
  238. msi-controller@2c200000 {
  239. compatible = "arm,gic-v3-its";
  240. msi-controller;
  241. #msi-cells = <1>;
  242. reg = <0x2c200000 0x20000>;
  243. };
  244. msi-controller@2c400000 {
  245. compatible = "arm,gic-v3-its";
  246. msi-controller;
  247. #msi-cells = <1>;
  248. reg = <0x2c400000 0x20000>;
  249. };
  250. ppi-partitions {
  251. part0: interrupt-partition-0 {
  252. affinity = <&cpu0>, <&cpu2>;
  253. };
  254. part1: interrupt-partition-1 {
  255. affinity = <&cpu1>, <&cpu3>;
  256. };
  257. };
  258. };
  259. device@0 {
  260. reg = <0 4>;
  261. interrupts = <1 1 4 &part0>;
  262. };
  263. ...