xref: /linux/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml (revision 43cd3ddbff3c1635d0e09fe5b09af48d39dbb9d7)
136c79bc7SRob Herring# SPDX-License-Identifier: GPL-2.0
236c79bc7SRob Herring%YAML 1.2
336c79bc7SRob Herring---
436c79bc7SRob Herring$id: http://devicetree.org/schemas/interrupt-controller/arm,gic-v3.yaml#
536c79bc7SRob Herring$schema: http://devicetree.org/meta-schemas/core.yaml#
636c79bc7SRob Herring
736c79bc7SRob Herringtitle: ARM Generic Interrupt Controller, version 3
836c79bc7SRob Herring
936c79bc7SRob Herringmaintainers:
104053b6b4SMarc Zyngier  - Marc Zyngier <maz@kernel.org>
1136c79bc7SRob Herring
1236c79bc7SRob Herringdescription: |
1336c79bc7SRob Herring  AArch64 SMP cores are often associated with a GICv3, providing Private
1436c79bc7SRob Herring  Peripheral Interrupts (PPI), Shared Peripheral Interrupts (SPI),
1536c79bc7SRob Herring  Software Generated Interrupts (SGI), and Locality-specific Peripheral
1636c79bc7SRob Herring  Interrupts (LPI).
1736c79bc7SRob Herring
1836c79bc7SRob HerringallOf:
1936c79bc7SRob Herring  - $ref: /schemas/interrupt-controller.yaml#
2036c79bc7SRob Herring
2136c79bc7SRob Herringproperties:
2236c79bc7SRob Herring  compatible:
2336c79bc7SRob Herring    oneOf:
2436c79bc7SRob Herring      - items:
2536c79bc7SRob Herring          - enum:
2636c79bc7SRob Herring              - qcom,msm8996-gic-v3
2736c79bc7SRob Herring          - const: arm,gic-v3
2836c79bc7SRob Herring      - const: arm,gic-v3
2936c79bc7SRob Herring
3036c79bc7SRob Herring  interrupt-controller: true
3136c79bc7SRob Herring
3236c79bc7SRob Herring  "#address-cells":
3336c79bc7SRob Herring    enum: [ 0, 1, 2 ]
3436c79bc7SRob Herring  "#size-cells":
3536c79bc7SRob Herring    enum: [ 1, 2 ]
3636c79bc7SRob Herring
3736c79bc7SRob Herring  ranges: true
3836c79bc7SRob Herring
3936c79bc7SRob Herring  "#interrupt-cells":
4036c79bc7SRob Herring    description: |
4136c79bc7SRob Herring      Specifies the number of cells needed to encode an interrupt source.
4236c79bc7SRob Herring      Must be a single cell with a value of at least 3.
4336c79bc7SRob Herring      If the system requires describing PPI affinity, then the value must
4436c79bc7SRob Herring      be at least 4.
4536c79bc7SRob Herring
4636c79bc7SRob Herring      The 1st cell is the interrupt type; 0 for SPI interrupts, 1 for PPI
474b049063SMarc Zyngier      interrupts, 2 for interrupts in the Extended SPI range, 3 for the
484b049063SMarc Zyngier      Extended PPI range. Other values are reserved for future use.
4936c79bc7SRob Herring
5036c79bc7SRob Herring      The 2nd cell contains the interrupt number for the interrupt type.
5136c79bc7SRob Herring      SPI interrupts are in the range [0-987]. PPI interrupts are in the
5286624653SMarc Zyngier      range [0-15]. Extented SPI interrupts are in the range [0-1023].
534b049063SMarc Zyngier      Extended PPI interrupts are in the range [0-127].
5436c79bc7SRob Herring
5536c79bc7SRob Herring      The 3rd cell is the flags, encoded as follows:
5636c79bc7SRob Herring      bits[3:0] trigger type and level flags.
5736c79bc7SRob Herring        1 = edge triggered
5836c79bc7SRob Herring        4 = level triggered
5936c79bc7SRob Herring
6036c79bc7SRob Herring      The 4th cell is a phandle to a node describing a set of CPUs this
6136c79bc7SRob Herring      interrupt is affine to. The interrupt must be a PPI, and the node
6236c79bc7SRob Herring      pointed must be a subnode of the "ppi-partitions" subnode. For
6336c79bc7SRob Herring      interrupt types other than PPI or PPIs that are not partitionned,
6436c79bc7SRob Herring      this cell must be zero. See the "ppi-partitions" node description
6536c79bc7SRob Herring      below.
6636c79bc7SRob Herring
6736c79bc7SRob Herring      Cells 5 and beyond are reserved for future use and must have a value
6836c79bc7SRob Herring      of 0 if present.
6936c79bc7SRob Herring    enum: [ 3, 4 ]
7036c79bc7SRob Herring
7136c79bc7SRob Herring  reg:
7236c79bc7SRob Herring    description: |
7336c79bc7SRob Herring      Specifies base physical address(s) and size of the GIC
7436c79bc7SRob Herring      registers, in the following order:
7536c79bc7SRob Herring      - GIC Distributor interface (GICD)
7636c79bc7SRob Herring      - GIC Redistributors (GICR), one range per redistributor region
7736c79bc7SRob Herring      - GIC CPU interface (GICC)
7836c79bc7SRob Herring      - GIC Hypervisor interface (GICH)
7936c79bc7SRob Herring      - GIC Virtual CPU interface (GICV)
8036c79bc7SRob Herring
814053b6b4SMarc Zyngier      GICC, GICH and GICV are optional, but must be described if the CPUs
824053b6b4SMarc Zyngier      support them. Examples of such CPUs are ARM's implementations of the
834053b6b4SMarc Zyngier      ARMv8.0 architecture such as Cortex-A32, A34, A35, A53, A57, A72 and
844053b6b4SMarc Zyngier      A73 (this list is not exhaustive).
854053b6b4SMarc Zyngier
8636c79bc7SRob Herring    minItems: 2
8736c79bc7SRob Herring    maxItems: 4096   # Should be enough?
8836c79bc7SRob Herring
8936c79bc7SRob Herring  interrupts:
9036c79bc7SRob Herring    description:
9136c79bc7SRob Herring      Interrupt source of the VGIC maintenance interrupt.
9236c79bc7SRob Herring    maxItems: 1
9336c79bc7SRob Herring
9436c79bc7SRob Herring  redistributor-stride:
9536c79bc7SRob Herring    description:
9636c79bc7SRob Herring      If using padding pages, specifies the stride of consecutive
9736c79bc7SRob Herring      redistributors. Must be a multiple of 64kB.
983d21a460SRob Herring    $ref: /schemas/types.yaml#/definitions/uint64
993d21a460SRob Herring    multipleOf: 0x10000
10036c79bc7SRob Herring    exclusiveMinimum: 0
10136c79bc7SRob Herring
10236c79bc7SRob Herring  "#redistributor-regions":
10336c79bc7SRob Herring    description:
10436c79bc7SRob Herring      The number of independent contiguous regions occupied by the
10536c79bc7SRob Herring      redistributors. Required if more than one such region is present.
1063d21a460SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
1073d21a460SRob Herring    maximum: 4096
10836c79bc7SRob Herring
10936c79bc7SRob Herring  msi-controller:
11036c79bc7SRob Herring    description:
111707344c8SLad Prabhakar      Only present if the Message Based Interrupt functionality is
11236c79bc7SRob Herring      being exposed by the HW, and the mbi-ranges property present.
11336c79bc7SRob Herring
11436c79bc7SRob Herring  mbi-ranges:
11536c79bc7SRob Herring    description:
11636c79bc7SRob Herring      A list of pairs <intid span>, where "intid" is the first SPI of a range
11736c79bc7SRob Herring      that can be used an MBI, and "span" the size of that range. Multiple
11836c79bc7SRob Herring      ranges can be provided.
1193d21a460SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32-matrix
1203d21a460SRob Herring    items:
12136c79bc7SRob Herring      minItems: 2
12236c79bc7SRob Herring      maxItems: 2
12336c79bc7SRob Herring
12436c79bc7SRob Herring  mbi-alias:
12536c79bc7SRob Herring    description:
12636c79bc7SRob Herring      Address property. Base address of an alias of the GICD region containing
12736c79bc7SRob Herring      only the {SET,CLR}SPI registers to be used if isolation is required,
12836c79bc7SRob Herring      and if supported by the HW.
1293d21a460SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32-array
1303d21a460SRob Herring    items:
13136c79bc7SRob Herring      minItems: 1
13236c79bc7SRob Herring      maxItems: 2
13336c79bc7SRob Herring
13436c79bc7SRob Herring  ppi-partitions:
13536c79bc7SRob Herring    type: object
136e62fc182SRob Herring    additionalProperties: false
13736c79bc7SRob Herring    description:
13836c79bc7SRob Herring      PPI affinity can be expressed as a single "ppi-partitions" node,
13936c79bc7SRob Herring      containing a set of sub-nodes.
14036c79bc7SRob Herring    patternProperties:
14136c79bc7SRob Herring      "^interrupt-partition-[0-9]+$":
142cf7d88fbSRob Herring        type: object
143e62fc182SRob Herring        additionalProperties: false
14436c79bc7SRob Herring        properties:
14536c79bc7SRob Herring          affinity:
14636c79bc7SRob Herring            $ref: /schemas/types.yaml#/definitions/phandle-array
14739bd2b6aSRob Herring            items:
14839bd2b6aSRob Herring              maxItems: 1
14936c79bc7SRob Herring            description:
15036c79bc7SRob Herring              Should be a list of phandles to CPU nodes (as described in
15136c79bc7SRob Herring              Documentation/devicetree/bindings/arm/cpus.yaml).
15236c79bc7SRob Herring
15336c79bc7SRob Herring        required:
15436c79bc7SRob Herring          - affinity
15536c79bc7SRob Herring
1564e08a559SLad Prabhakar  clocks:
1574e08a559SLad Prabhakar    maxItems: 1
1584e08a559SLad Prabhakar
1594e08a559SLad Prabhakar  clock-names:
1604e08a559SLad Prabhakar    items:
1614e08a559SLad Prabhakar      - const: aclk
1624e08a559SLad Prabhakar
1634e08a559SLad Prabhakar  power-domains:
1644e08a559SLad Prabhakar    maxItems: 1
1654e08a559SLad Prabhakar
1664e08a559SLad Prabhakar  resets:
1674e08a559SLad Prabhakar    maxItems: 1
1684e08a559SLad Prabhakar
169*43cd3ddbSDouglas Anderson  mediatek,broken-save-restore-fw:
170*43cd3ddbSDouglas Anderson    type: boolean
171*43cd3ddbSDouglas Anderson    description:
172*43cd3ddbSDouglas Anderson      Asserts that the firmware on this device has issues saving and restoring
173*43cd3ddbSDouglas Anderson      GICR registers when the GIC redistributors are powered off.
174*43cd3ddbSDouglas Anderson
17536c79bc7SRob Herringdependencies:
17636c79bc7SRob Herring  mbi-ranges: [ msi-controller ]
17736c79bc7SRob Herring  msi-controller: [ mbi-ranges ]
17836c79bc7SRob Herring
17936c79bc7SRob Herringrequired:
18036c79bc7SRob Herring  - compatible
18136c79bc7SRob Herring  - reg
18236c79bc7SRob Herring
18336c79bc7SRob HerringpatternProperties:
18436c79bc7SRob Herring  "^gic-its@": false
18536c79bc7SRob Herring  "^interrupt-controller@[0-9a-f]+$": false
18636c79bc7SRob Herring  # msi-controller is preferred, but allow other names
18736c79bc7SRob Herring  "^(msi-controller|gic-its|interrupt-controller)@[0-9a-f]+$":
18836c79bc7SRob Herring    type: object
18936c79bc7SRob Herring    description:
19036c79bc7SRob Herring      GICv3 has one or more Interrupt Translation Services (ITS) that are
19136c79bc7SRob Herring      used to route Message Signalled Interrupts (MSI) to the CPUs.
19236c79bc7SRob Herring    properties:
19336c79bc7SRob Herring      compatible:
19436c79bc7SRob Herring        const: arm,gic-v3-its
19536c79bc7SRob Herring
19636c79bc7SRob Herring      msi-controller: true
19736c79bc7SRob Herring
19836c79bc7SRob Herring      "#msi-cells":
19936c79bc7SRob Herring        description:
20036c79bc7SRob Herring          The single msi-cell is the DeviceID of the device which will generate
20136c79bc7SRob Herring          the MSI.
20236c79bc7SRob Herring        const: 1
20336c79bc7SRob Herring
20436c79bc7SRob Herring      reg:
20536c79bc7SRob Herring        description:
20636c79bc7SRob Herring          Specifies the base physical address and size of the ITS registers.
20736c79bc7SRob Herring        maxItems: 1
20836c79bc7SRob Herring
20936c79bc7SRob Herring      socionext,synquacer-pre-its:
21036c79bc7SRob Herring        description:
21136c79bc7SRob Herring          (u32, u32) tuple describing the untranslated
21236c79bc7SRob Herring          address and size of the pre-ITS window.
2133d21a460SRob Herring        $ref: /schemas/types.yaml#/definitions/uint32-array
2143d21a460SRob Herring        items:
21536c79bc7SRob Herring          minItems: 2
21636c79bc7SRob Herring          maxItems: 2
21736c79bc7SRob Herring
21836c79bc7SRob Herring    required:
21936c79bc7SRob Herring      - compatible
22036c79bc7SRob Herring      - msi-controller
22136c79bc7SRob Herring      - "#msi-cells"
22236c79bc7SRob Herring      - reg
22336c79bc7SRob Herring
22436c79bc7SRob Herring    additionalProperties: false
22536c79bc7SRob Herring
22636c79bc7SRob HerringadditionalProperties: false
22736c79bc7SRob Herring
22836c79bc7SRob Herringexamples:
22936c79bc7SRob Herring  - |
23036c79bc7SRob Herring    gic: interrupt-controller@2cf00000 {
23136c79bc7SRob Herring      compatible = "arm,gic-v3";
23236c79bc7SRob Herring      #interrupt-cells = <3>;
23336c79bc7SRob Herring      #address-cells = <1>;
23436c79bc7SRob Herring      #size-cells = <1>;
23536c79bc7SRob Herring      ranges;
23636c79bc7SRob Herring      interrupt-controller;
23736c79bc7SRob Herring      reg = <0x2f000000 0x10000>,  // GICD
23836c79bc7SRob Herring            <0x2f100000 0x200000>,  // GICR
23936c79bc7SRob Herring            <0x2c000000 0x2000>,  // GICC
24036c79bc7SRob Herring            <0x2c010000 0x2000>,  // GICH
24136c79bc7SRob Herring            <0x2c020000 0x2000>;  // GICV
24236c79bc7SRob Herring      interrupts = <1 9 4>;
24336c79bc7SRob Herring
24436c79bc7SRob Herring      msi-controller;
24536c79bc7SRob Herring      mbi-ranges = <256 128>;
24636c79bc7SRob Herring
24736c79bc7SRob Herring      msi-controller@2c200000 {
24836c79bc7SRob Herring        compatible = "arm,gic-v3-its";
24936c79bc7SRob Herring        msi-controller;
25036c79bc7SRob Herring        #msi-cells = <1>;
25136c79bc7SRob Herring        reg = <0x2c200000 0x20000>;
25236c79bc7SRob Herring      };
25336c79bc7SRob Herring    };
25436c79bc7SRob Herring
255e3a3356dSRob Herring  - |
25636c79bc7SRob Herring    interrupt-controller@2c010000 {
25736c79bc7SRob Herring      compatible = "arm,gic-v3";
25836c79bc7SRob Herring      #interrupt-cells = <4>;
25936c79bc7SRob Herring      #address-cells = <1>;
26036c79bc7SRob Herring      #size-cells = <1>;
26136c79bc7SRob Herring      ranges;
26236c79bc7SRob Herring      interrupt-controller;
26336c79bc7SRob Herring      redistributor-stride = <0x0 0x40000>;  // 256kB stride
26436c79bc7SRob Herring      #redistributor-regions = <2>;
26536c79bc7SRob Herring      reg = <0x2c010000 0x10000>,  // GICD
26636c79bc7SRob Herring            <0x2d000000 0x800000>,  // GICR 1: CPUs 0-31
26736c79bc7SRob Herring            <0x2e000000 0x800000>,  // GICR 2: CPUs 32-63
26836c79bc7SRob Herring            <0x2c040000 0x2000>,  // GICC
26936c79bc7SRob Herring            <0x2c060000 0x2000>,  // GICH
27036c79bc7SRob Herring            <0x2c080000 0x2000>;  // GICV
271e3a3356dSRob Herring      interrupts = <1 9 4 0>;
27236c79bc7SRob Herring
27336c79bc7SRob Herring      msi-controller@2c200000 {
27436c79bc7SRob Herring        compatible = "arm,gic-v3-its";
27536c79bc7SRob Herring        msi-controller;
27636c79bc7SRob Herring        #msi-cells = <1>;
27736c79bc7SRob Herring        reg = <0x2c200000 0x20000>;
27836c79bc7SRob Herring      };
27936c79bc7SRob Herring
28036c79bc7SRob Herring      msi-controller@2c400000 {
28136c79bc7SRob Herring        compatible = "arm,gic-v3-its";
28236c79bc7SRob Herring        msi-controller;
28336c79bc7SRob Herring        #msi-cells = <1>;
28436c79bc7SRob Herring        reg = <0x2c400000 0x20000>;
28536c79bc7SRob Herring      };
28636c79bc7SRob Herring
28736c79bc7SRob Herring      ppi-partitions {
28836c79bc7SRob Herring        part0: interrupt-partition-0 {
28939bd2b6aSRob Herring          affinity = <&cpu0>, <&cpu2>;
29036c79bc7SRob Herring        };
29136c79bc7SRob Herring
29236c79bc7SRob Herring        part1: interrupt-partition-1 {
29339bd2b6aSRob Herring          affinity = <&cpu1>, <&cpu3>;
29436c79bc7SRob Herring        };
29536c79bc7SRob Herring      };
29636c79bc7SRob Herring    };
29736c79bc7SRob Herring
29836c79bc7SRob Herring
29936c79bc7SRob Herring    device@0 {
30036c79bc7SRob Herring      reg = <0 4>;
30136c79bc7SRob Herring      interrupts = <1 1 4 &part0>;
30236c79bc7SRob Herring    };
30336c79bc7SRob Herring
30436c79bc7SRob Herring...
305