summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/interrupt-controller/arm,gic.yaml
blob: a2846e4934972168e287b4aad108eff30bf9e278 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/interrupt-controller/arm,gic.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ARM Generic Interrupt Controller v1 and v2

maintainers:
  - Marc Zyngier <marc.zyngier@arm.com>

description: |+
  ARM SMP cores are often associated with a GIC, providing per processor
  interrupts (PPI), shared processor interrupts (SPI) and software
  generated interrupts (SGI).

  Primary GIC is attached directly to the CPU and typically has PPIs and SGIs.
  Secondary GICs are cascaded into the upward interrupt controller and do not
  have PPIs or SGIs.

allOf:
  - $ref: /schemas/interrupt-controller.yaml#

properties:
  compatible:
    oneOf:
      - items:
          - enum:
              - arm,arm11mp-gic
              - arm,cortex-a15-gic
              - arm,cortex-a7-gic
              - arm,cortex-a5-gic
              - arm,cortex-a9-gic
              - arm,eb11mp-gic
              - arm,gic-400
              - arm,pl390
              - arm,tc11mp-gic
              - qcom,msm-8660-qgic
              - qcom,msm-qgic2

      - items:
          - const: arm,gic-400
          - enum:
              - arm,cortex-a15-gic
              - arm,cortex-a7-gic

      - items:
          - const: arm,arm1176jzf-devchip-gic
          - const: arm,arm11mp-gic

      - items:
          - const: brcm,brahma-b15-gic
          - const: arm,cortex-a15-gic

      - oneOf:
          - const: nvidia,tegra210-agic
          - items:
              - enum:
                  - nvidia,tegra186-agic
                  - nvidia,tegra194-agic
                  - nvidia,tegra234-agic
              - const: nvidia,tegra210-agic

  interrupt-controller: true

  "#address-cells":
    enum: [ 0, 1, 2 ]
  "#size-cells":
    enum: [ 1, 2 ]

  "#interrupt-cells":
    const: 3
    description: |
      The 1st cell is the interrupt type; 0 for SPI interrupts, 1 for PPI
      interrupts.

      The 2nd cell contains the interrupt number for the interrupt type.
      SPI interrupts are in the range [0-987].  PPI interrupts are in the
      range [0-15].

      The 3rd cell is the flags, encoded as follows:
        bits[3:0] trigger type and level flags.
          1 = low-to-high edge triggered
          2 = high-to-low edge triggered (invalid for SPIs)
          4 = active high level-sensitive
          8 = active low level-sensitive (invalid for SPIs).
        bits[15:8] PPI interrupt cpu mask.  Each bit corresponds to each of
        the 8 possible cpus attached to the GIC.  A bit set to '1' indicated
        the interrupt is wired to that CPU.  Only valid for PPI interrupts.
        Also note that the configurability of PPI interrupts is IMPLEMENTATION
        DEFINED and as such not guaranteed to be present (most SoC available
        in 2014 seem to ignore the setting of this flag and use the hardware
        default value).

  reg:
    description: |
      Specifies base physical address(s) and size of the GIC registers. The
      first region is the GIC distributor register base and size. The 2nd region
      is the GIC cpu interface register base and size.

      For GICv2 with virtualization extensions, additional regions are
      required for specifying the base physical address and size of the VGIC
      registers. The first additional region is the GIC virtual interface
      control register base and size. The 2nd additional region is the GIC
      virtual cpu interface register base and size.
    minItems: 2
    maxItems: 4

  ranges: true

  interrupts:
    description: Interrupt source of the parent interrupt controller on
      secondary GICs, or VGIC maintenance interrupt on primary GIC (see
      below).
    maxItems: 1

  cpu-offset:
    description: per-cpu offset within the distributor and cpu interface
      regions, used when the GIC doesn't have banked registers. The offset
      is cpu-offset * cpu-nr.
    $ref: /schemas/types.yaml#/definitions/uint32

  clocks:
    minItems: 1
    maxItems: 2

  clock-names:
    description: List of names for the GIC clock input(s). Valid clock names
      depend on the GIC variant.
    oneOf:
      - const: ic_clk # for "arm,arm11mp-gic"
      - const: PERIPHCLKEN # for "arm,cortex-a15-gic"
      - items: # for "arm,cortex-a9-gic"
          - const: PERIPHCLK
          - const: PERIPHCLKEN
      - const: clk  # for "arm,gic-400" and "nvidia,tegra210"
      - const: gclk # for "arm,pl390"

  power-domains:
    maxItems: 1

  resets:
    maxItems: 1

required:
  - compatible
  - reg

patternProperties:
  "^v2m@[0-9a-f]+$":
    type: object
    description: |
      * GICv2m extension for MSI/MSI-x support (Optional)

      Certain revisions of GIC-400 supports MSI/MSI-x via V2M register frame(s).
      This is enabled by specifying v2m sub-node(s).

    properties:
      compatible:
        const: arm,gic-v2m-frame

      msi-controller: true

      reg:
        maxItems: 1
        description: GICv2m MSI interface register base and size

      arm,msi-base-spi:
        description: When the MSI_TYPER register contains an incorrect value,
          this property should contain the SPI base of the MSI frame, overriding
          the HW value.
        $ref: /schemas/types.yaml#/definitions/uint32

      arm,msi-num-spis:
        description: When the MSI_TYPER register contains an incorrect value,
          this property should contain the number of SPIs assigned to the
          frame, overriding the HW value.
        $ref: /schemas/types.yaml#/definitions/uint32

    required:
      - compatible
      - msi-controller
      - reg

    additionalProperties: false

additionalProperties: false

examples:
  - |
    // GICv1
    intc: interrupt-controller@fff11000 {
      compatible = "arm,cortex-a9-gic";
      #interrupt-cells = <3>;
      #address-cells = <1>;
      interrupt-controller;
      reg = <0xfff11000 0x1000>,
            <0xfff10100 0x100>;
    };

  - |
    // GICv2
    interrupt-controller@2c001000 {
      compatible = "arm,cortex-a15-gic";
      #interrupt-cells = <3>;
      interrupt-controller;
      reg = <0x2c001000 0x1000>,
            <0x2c002000 0x2000>,
            <0x2c004000 0x2000>,
            <0x2c006000 0x2000>;
      interrupts = <1 9 0xf04>;
    };

  - |
    // GICv2m extension for MSI/MSI-x support
    interrupt-controller@e1101000 {
      compatible = "arm,gic-400";
      #interrupt-cells = <3>;
      #address-cells = <1>;
      #size-cells = <1>;
      interrupt-controller;
      interrupts = <1 8 0xf04>;
      ranges = <0 0xe1100000 0x100000>;
      reg = <0xe1110000 0x01000>,
            <0xe112f000 0x02000>,
            <0xe1140000 0x10000>,
            <0xe1160000 0x10000>;

      v2m0: v2m@80000 {
        compatible = "arm,gic-v2m-frame";
        msi-controller;
        reg = <0x80000 0x1000>;
      };

      //...

      v2mN: v2m@90000 {
        compatible = "arm,gic-v2m-frame";
        msi-controller;
        reg = <0x90000 0x1000>;
      };
    };
...