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