xref: /linux/Documentation/devicetree/bindings/interrupt-controller/arm,gic.yaml (revision 66ed144f147a785fada14c53f06a25079b764043)
1*66ed144fSRob Herring# SPDX-License-Identifier: GPL-2.0
2*66ed144fSRob Herring%YAML 1.2
3*66ed144fSRob Herring---
4*66ed144fSRob Herring$id: http://devicetree.org/schemas/interrupt-controller/arm,gic.yaml#
5*66ed144fSRob Herring$schema: http://devicetree.org/meta-schemas/core.yaml#
6*66ed144fSRob Herring
7*66ed144fSRob Herringtitle: ARM Generic Interrupt Controller v1 and v2
8*66ed144fSRob Herring
9*66ed144fSRob Herringmaintainers:
10*66ed144fSRob Herring  - Marc Zyngier <marc.zyngier@arm.com>
11*66ed144fSRob Herring
12*66ed144fSRob Herringdescription: |+
13*66ed144fSRob Herring  ARM SMP cores are often associated with a GIC, providing per processor
14*66ed144fSRob Herring  interrupts (PPI), shared processor interrupts (SPI) and software
15*66ed144fSRob Herring  generated interrupts (SGI).
16*66ed144fSRob Herring
17*66ed144fSRob Herring  Primary GIC is attached directly to the CPU and typically has PPIs and SGIs.
18*66ed144fSRob Herring  Secondary GICs are cascaded into the upward interrupt controller and do not
19*66ed144fSRob Herring  have PPIs or SGIs.
20*66ed144fSRob Herring
21*66ed144fSRob HerringallOf:
22*66ed144fSRob Herring  - $ref: /schemas/interrupt-controller.yaml#
23*66ed144fSRob Herring
24*66ed144fSRob Herringproperties:
25*66ed144fSRob Herring  compatible:
26*66ed144fSRob Herring    oneOf:
27*66ed144fSRob Herring      - items:
28*66ed144fSRob Herring          - enum:
29*66ed144fSRob Herring              - arm,arm11mp-gic
30*66ed144fSRob Herring              - arm,cortex-a15-gic
31*66ed144fSRob Herring              - arm,cortex-a7-gic
32*66ed144fSRob Herring              - arm,cortex-a5-gic
33*66ed144fSRob Herring              - arm,cortex-a9-gic
34*66ed144fSRob Herring              - arm,eb11mp-gic
35*66ed144fSRob Herring              - arm,gic-400
36*66ed144fSRob Herring              - arm,pl390
37*66ed144fSRob Herring              - arm,tc11mp-gic
38*66ed144fSRob Herring              - nvidia,tegra210-agic
39*66ed144fSRob Herring              - qcom,msm-8660-qgic
40*66ed144fSRob Herring              - qcom,msm-qgic2
41*66ed144fSRob Herring
42*66ed144fSRob Herring      - items:
43*66ed144fSRob Herring          - const: arm,arm1176jzf-devchip-gic
44*66ed144fSRob Herring          - const: arm,arm11mp-gic
45*66ed144fSRob Herring
46*66ed144fSRob Herring      - items:
47*66ed144fSRob Herring          - const: brcm,brahma-b15-gic
48*66ed144fSRob Herring          - const: arm,cortex-a15-gic
49*66ed144fSRob Herring
50*66ed144fSRob Herring  interrupt-controller: true
51*66ed144fSRob Herring
52*66ed144fSRob Herring  "#address-cells":
53*66ed144fSRob Herring    enum: [ 0, 1 ]
54*66ed144fSRob Herring  "#size-cells":
55*66ed144fSRob Herring    const: 1
56*66ed144fSRob Herring
57*66ed144fSRob Herring  "#interrupt-cells":
58*66ed144fSRob Herring    const: 3
59*66ed144fSRob Herring    description: |
60*66ed144fSRob Herring      The 1st cell is the interrupt type; 0 for SPI interrupts, 1 for PPI
61*66ed144fSRob Herring      interrupts.
62*66ed144fSRob Herring
63*66ed144fSRob Herring      The 2nd cell contains the interrupt number for the interrupt type.
64*66ed144fSRob Herring      SPI interrupts are in the range [0-987].  PPI interrupts are in the
65*66ed144fSRob Herring      range [0-15].
66*66ed144fSRob Herring
67*66ed144fSRob Herring      The 3rd cell is the flags, encoded as follows:
68*66ed144fSRob Herring        bits[3:0] trigger type and level flags.
69*66ed144fSRob Herring          1 = low-to-high edge triggered
70*66ed144fSRob Herring          2 = high-to-low edge triggered (invalid for SPIs)
71*66ed144fSRob Herring          4 = active high level-sensitive
72*66ed144fSRob Herring          8 = active low level-sensitive (invalid for SPIs).
73*66ed144fSRob Herring        bits[15:8] PPI interrupt cpu mask.  Each bit corresponds to each of
74*66ed144fSRob Herring        the 8 possible cpus attached to the GIC.  A bit set to '1' indicated
75*66ed144fSRob Herring        the interrupt is wired to that CPU.  Only valid for PPI interrupts.
76*66ed144fSRob Herring        Also note that the configurability of PPI interrupts is IMPLEMENTATION
77*66ed144fSRob Herring        DEFINED and as such not guaranteed to be present (most SoC available
78*66ed144fSRob Herring        in 2014 seem to ignore the setting of this flag and use the hardware
79*66ed144fSRob Herring        default value).
80*66ed144fSRob Herring
81*66ed144fSRob Herring  reg:
82*66ed144fSRob Herring    description: |
83*66ed144fSRob Herring      Specifies base physical address(s) and size of the GIC registers. The
84*66ed144fSRob Herring      first region is the GIC distributor register base and size. The 2nd region
85*66ed144fSRob Herring      is the GIC cpu interface register base and size.
86*66ed144fSRob Herring
87*66ed144fSRob Herring      For GICv2 with virtualization extensions, additional regions are
88*66ed144fSRob Herring      required for specifying the base physical address and size of the VGIC
89*66ed144fSRob Herring      registers. The first additional region is the GIC virtual interface
90*66ed144fSRob Herring      control register base and size. The 2nd additional region is the GIC
91*66ed144fSRob Herring      virtual cpu interface register base and size.
92*66ed144fSRob Herring    minItems: 2
93*66ed144fSRob Herring    maxItems: 4
94*66ed144fSRob Herring
95*66ed144fSRob Herring  interrupts:
96*66ed144fSRob Herring    description: Interrupt source of the parent interrupt controller on
97*66ed144fSRob Herring      secondary GICs, or VGIC maintenance interrupt on primary GIC (see
98*66ed144fSRob Herring      below).
99*66ed144fSRob Herring    maxItems: 1
100*66ed144fSRob Herring
101*66ed144fSRob Herring  cpu-offset:
102*66ed144fSRob Herring    description: per-cpu offset within the distributor and cpu interface
103*66ed144fSRob Herring      regions, used when the GIC doesn't have banked registers. The offset
104*66ed144fSRob Herring      is cpu-offset * cpu-nr.
105*66ed144fSRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
106*66ed144fSRob Herring
107*66ed144fSRob Herring  clocks:
108*66ed144fSRob Herring    minItems: 1
109*66ed144fSRob Herring    maxItems: 2
110*66ed144fSRob Herring
111*66ed144fSRob Herring  clock-names:
112*66ed144fSRob Herring    description: List of names for the GIC clock input(s). Valid clock names
113*66ed144fSRob Herring      depend on the GIC variant.
114*66ed144fSRob Herring    oneOf:
115*66ed144fSRob Herring      - const: ic_clk # for "arm,arm11mp-gic"
116*66ed144fSRob Herring      - const: PERIPHCLKEN # for "arm,cortex-a15-gic"
117*66ed144fSRob Herring      - items: # for "arm,cortex-a9-gic"
118*66ed144fSRob Herring          - const: PERIPHCLK
119*66ed144fSRob Herring          - const: PERIPHCLKEN
120*66ed144fSRob Herring      - const: clk # for "arm,gic-400" and "nvidia,tegra210"
121*66ed144fSRob Herring      - const: gclk #for "arm,pl390"
122*66ed144fSRob Herring
123*66ed144fSRob Herring  power-domains:
124*66ed144fSRob Herring    maxItems: 1
125*66ed144fSRob Herring
126*66ed144fSRob Herringrequired:
127*66ed144fSRob Herring  - compatible
128*66ed144fSRob Herring  - reg
129*66ed144fSRob Herring
130*66ed144fSRob HerringpatternProperties:
131*66ed144fSRob Herring  "^v2m@[0-9a-f]+$":
132*66ed144fSRob Herring    description: |
133*66ed144fSRob Herring      * GICv2m extension for MSI/MSI-x support (Optional)
134*66ed144fSRob Herring
135*66ed144fSRob Herring      Certain revisions of GIC-400 supports MSI/MSI-x via V2M register frame(s).
136*66ed144fSRob Herring      This is enabled by specifying v2m sub-node(s).
137*66ed144fSRob Herring
138*66ed144fSRob Herring    properties:
139*66ed144fSRob Herring      compatible:
140*66ed144fSRob Herring        const: arm,gic-v2m-frame
141*66ed144fSRob Herring
142*66ed144fSRob Herring      msi-controller: true
143*66ed144fSRob Herring
144*66ed144fSRob Herring      reg:
145*66ed144fSRob Herring        maxItems: 1
146*66ed144fSRob Herring        description: GICv2m MSI interface register base and size
147*66ed144fSRob Herring
148*66ed144fSRob Herring      arm,msi-base-spi:
149*66ed144fSRob Herring        description: When the MSI_TYPER register contains an incorrect value,
150*66ed144fSRob Herring          this property should contain the SPI base of the MSI frame, overriding
151*66ed144fSRob Herring          the HW value.
152*66ed144fSRob Herring        $ref: /schemas/types.yaml#/definitions/uint32
153*66ed144fSRob Herring
154*66ed144fSRob Herring      arm,msi-num-spis:
155*66ed144fSRob Herring        description: When the MSI_TYPER register contains an incorrect value,
156*66ed144fSRob Herring          this property should contain the number of SPIs assigned to the
157*66ed144fSRob Herring          frame, overriding the HW value.
158*66ed144fSRob Herring        $ref: /schemas/types.yaml#/definitions/uint32
159*66ed144fSRob Herring
160*66ed144fSRob Herring    required:
161*66ed144fSRob Herring      - compatible
162*66ed144fSRob Herring      - msi-controller
163*66ed144fSRob Herring      - reg
164*66ed144fSRob Herring
165*66ed144fSRob Herring    additionalProperties: false
166*66ed144fSRob Herring
167*66ed144fSRob HerringadditionalProperties: false
168*66ed144fSRob Herring
169*66ed144fSRob Herringexamples:
170*66ed144fSRob Herring  - |
171*66ed144fSRob Herring    // GICv1
172*66ed144fSRob Herring    intc: interrupt-controller@fff11000 {
173*66ed144fSRob Herring      compatible = "arm,cortex-a9-gic";
174*66ed144fSRob Herring      #interrupt-cells = <3>;
175*66ed144fSRob Herring      #address-cells = <1>;
176*66ed144fSRob Herring      interrupt-controller;
177*66ed144fSRob Herring      reg = <0xfff11000 0x1000>,
178*66ed144fSRob Herring            <0xfff10100 0x100>;
179*66ed144fSRob Herring    };
180*66ed144fSRob Herring
181*66ed144fSRob Herring  - |
182*66ed144fSRob Herring    // GICv2
183*66ed144fSRob Herring    interrupt-controller@2c001000 {
184*66ed144fSRob Herring      compatible = "arm,cortex-a15-gic";
185*66ed144fSRob Herring      #interrupt-cells = <3>;
186*66ed144fSRob Herring      interrupt-controller;
187*66ed144fSRob Herring      reg = <0x2c001000 0x1000>,
188*66ed144fSRob Herring            <0x2c002000 0x2000>,
189*66ed144fSRob Herring            <0x2c004000 0x2000>,
190*66ed144fSRob Herring            <0x2c006000 0x2000>;
191*66ed144fSRob Herring      interrupts = <1 9 0xf04>;
192*66ed144fSRob Herring    };
193*66ed144fSRob Herring
194*66ed144fSRob Herring  - |
195*66ed144fSRob Herring    // GICv2m extension for MSI/MSI-x support
196*66ed144fSRob Herring    interrupt-controller@e1101000 {
197*66ed144fSRob Herring      compatible = "arm,gic-400";
198*66ed144fSRob Herring      #interrupt-cells = <3>;
199*66ed144fSRob Herring      #address-cells = <2>;
200*66ed144fSRob Herring      #size-cells = <2>;
201*66ed144fSRob Herring      interrupt-controller;
202*66ed144fSRob Herring      interrupts = <1 8 0xf04>;
203*66ed144fSRob Herring      ranges = <0 0 0 0xe1100000 0 0x100000>;
204*66ed144fSRob Herring      reg = <0x0 0xe1110000 0 0x01000>,
205*66ed144fSRob Herring            <0x0 0xe112f000 0 0x02000>,
206*66ed144fSRob Herring            <0x0 0xe1140000 0 0x10000>,
207*66ed144fSRob Herring            <0x0 0xe1160000 0 0x10000>;
208*66ed144fSRob Herring
209*66ed144fSRob Herring      v2m0: v2m@8000 {
210*66ed144fSRob Herring        compatible = "arm,gic-v2m-frame";
211*66ed144fSRob Herring        msi-controller;
212*66ed144fSRob Herring        reg = <0x0 0x80000 0 0x1000>;
213*66ed144fSRob Herring      };
214*66ed144fSRob Herring
215*66ed144fSRob Herring      //...
216*66ed144fSRob Herring
217*66ed144fSRob Herring      v2mN: v2m@9000 {
218*66ed144fSRob Herring        compatible = "arm,gic-v2m-frame";
219*66ed144fSRob Herring        msi-controller;
220*66ed144fSRob Herring        reg = <0x0 0x90000 0 0x1000>;
221*66ed144fSRob Herring      };
222*66ed144fSRob Herring    };
223*66ed144fSRob Herring...
224