xref: /linux/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml (revision 3a39d672e7f48b8d6b91a09afa4b55352773b4b5)
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
5247aab533SBjorn Helgaas      range [0-15]. Extended 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
63*a7fcc232SYu-Chun Lin      interrupt types other than PPI or PPIs that are not partitioned,
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
1095e5c636cSLorenzo Pieralisi  dma-noncoherent:
1105e5c636cSLorenzo Pieralisi    description:
1115e5c636cSLorenzo Pieralisi      Present if the GIC redistributors permit programming shareability
1125e5c636cSLorenzo Pieralisi      and cacheability attributes but are connected to a non-coherent
1135e5c636cSLorenzo Pieralisi      downstream interconnect.
1145e5c636cSLorenzo Pieralisi
11536c79bc7SRob Herring  msi-controller:
11636c79bc7SRob Herring    description:
117707344c8SLad Prabhakar      Only present if the Message Based Interrupt functionality is
11836c79bc7SRob Herring      being exposed by the HW, and the mbi-ranges property present.
11936c79bc7SRob Herring
12036c79bc7SRob Herring  mbi-ranges:
12136c79bc7SRob Herring    description:
12236c79bc7SRob Herring      A list of pairs <intid span>, where "intid" is the first SPI of a range
12336c79bc7SRob Herring      that can be used an MBI, and "span" the size of that range. Multiple
12436c79bc7SRob Herring      ranges can be provided.
1253d21a460SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32-matrix
1263d21a460SRob Herring    items:
12736c79bc7SRob Herring      minItems: 2
12836c79bc7SRob Herring      maxItems: 2
12936c79bc7SRob Herring
13036c79bc7SRob Herring  mbi-alias:
13136c79bc7SRob Herring    description:
13236c79bc7SRob Herring      Address property. Base address of an alias of the GICD region containing
13336c79bc7SRob Herring      only the {SET,CLR}SPI registers to be used if isolation is required,
13436c79bc7SRob Herring      and if supported by the HW.
1353d21a460SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32-array
1363d21a460SRob Herring    items:
13736c79bc7SRob Herring      minItems: 1
13836c79bc7SRob Herring      maxItems: 2
13936c79bc7SRob Herring
14036c79bc7SRob Herring  ppi-partitions:
14136c79bc7SRob Herring    type: object
142e62fc182SRob Herring    additionalProperties: false
14336c79bc7SRob Herring    description:
14436c79bc7SRob Herring      PPI affinity can be expressed as a single "ppi-partitions" node,
14536c79bc7SRob Herring      containing a set of sub-nodes.
14636c79bc7SRob Herring    patternProperties:
14736c79bc7SRob Herring      "^interrupt-partition-[0-9]+$":
148cf7d88fbSRob Herring        type: object
149e62fc182SRob Herring        additionalProperties: false
15036c79bc7SRob Herring        properties:
15136c79bc7SRob Herring          affinity:
15236c79bc7SRob Herring            $ref: /schemas/types.yaml#/definitions/phandle-array
15339bd2b6aSRob Herring            items:
15439bd2b6aSRob Herring              maxItems: 1
15536c79bc7SRob Herring            description:
15636c79bc7SRob Herring              Should be a list of phandles to CPU nodes (as described in
15736c79bc7SRob Herring              Documentation/devicetree/bindings/arm/cpus.yaml).
15836c79bc7SRob Herring
15936c79bc7SRob Herring        required:
16036c79bc7SRob Herring          - affinity
16136c79bc7SRob Herring
1624e08a559SLad Prabhakar  clocks:
1634e08a559SLad Prabhakar    maxItems: 1
1644e08a559SLad Prabhakar
1654e08a559SLad Prabhakar  clock-names:
1664e08a559SLad Prabhakar    items:
1674e08a559SLad Prabhakar      - const: aclk
1684e08a559SLad Prabhakar
1694e08a559SLad Prabhakar  power-domains:
1704e08a559SLad Prabhakar    maxItems: 1
1714e08a559SLad Prabhakar
1724e08a559SLad Prabhakar  resets:
1734e08a559SLad Prabhakar    maxItems: 1
1744e08a559SLad Prabhakar
17543cd3ddbSDouglas Anderson  mediatek,broken-save-restore-fw:
17643cd3ddbSDouglas Anderson    type: boolean
17743cd3ddbSDouglas Anderson    description:
17843cd3ddbSDouglas Anderson      Asserts that the firmware on this device has issues saving and restoring
17943cd3ddbSDouglas Anderson      GICR registers when the GIC redistributors are powered off.
18043cd3ddbSDouglas Anderson
18136c79bc7SRob Herringdependencies:
18236c79bc7SRob Herring  mbi-ranges: [ msi-controller ]
18336c79bc7SRob Herring  msi-controller: [ mbi-ranges ]
18436c79bc7SRob Herring
18536c79bc7SRob Herringrequired:
18636c79bc7SRob Herring  - compatible
18736c79bc7SRob Herring  - reg
18836c79bc7SRob Herring
18936c79bc7SRob HerringpatternProperties:
19036c79bc7SRob Herring  "^gic-its@": false
19136c79bc7SRob Herring  "^interrupt-controller@[0-9a-f]+$": false
19236c79bc7SRob Herring  # msi-controller is preferred, but allow other names
19336c79bc7SRob Herring  "^(msi-controller|gic-its|interrupt-controller)@[0-9a-f]+$":
19436c79bc7SRob Herring    type: object
19536c79bc7SRob Herring    description:
19636c79bc7SRob Herring      GICv3 has one or more Interrupt Translation Services (ITS) that are
19736c79bc7SRob Herring      used to route Message Signalled Interrupts (MSI) to the CPUs.
19836c79bc7SRob Herring    properties:
19936c79bc7SRob Herring      compatible:
20036c79bc7SRob Herring        const: arm,gic-v3-its
20136c79bc7SRob Herring
2025e5c636cSLorenzo Pieralisi      dma-noncoherent:
2035e5c636cSLorenzo Pieralisi        description:
2045e5c636cSLorenzo Pieralisi          Present if the GIC ITS permits programming shareability and
2055e5c636cSLorenzo Pieralisi          cacheability attributes but is connected to a non-coherent
2065e5c636cSLorenzo Pieralisi          downstream interconnect.
2075e5c636cSLorenzo Pieralisi
20836c79bc7SRob Herring      msi-controller: true
20936c79bc7SRob Herring
21036c79bc7SRob Herring      "#msi-cells":
21136c79bc7SRob Herring        description:
21236c79bc7SRob Herring          The single msi-cell is the DeviceID of the device which will generate
21336c79bc7SRob Herring          the MSI.
21436c79bc7SRob Herring        const: 1
21536c79bc7SRob Herring
21636c79bc7SRob Herring      reg:
21736c79bc7SRob Herring        description:
21836c79bc7SRob Herring          Specifies the base physical address and size of the ITS registers.
21936c79bc7SRob Herring        maxItems: 1
22036c79bc7SRob Herring
22136c79bc7SRob Herring      socionext,synquacer-pre-its:
22236c79bc7SRob Herring        description:
22336c79bc7SRob Herring          (u32, u32) tuple describing the untranslated
22436c79bc7SRob Herring          address and size of the pre-ITS window.
2253d21a460SRob Herring        $ref: /schemas/types.yaml#/definitions/uint32-array
2263d21a460SRob Herring        items:
22736c79bc7SRob Herring          minItems: 2
22836c79bc7SRob Herring          maxItems: 2
22936c79bc7SRob Herring
23036c79bc7SRob Herring    required:
23136c79bc7SRob Herring      - compatible
23236c79bc7SRob Herring      - msi-controller
23336c79bc7SRob Herring      - "#msi-cells"
23436c79bc7SRob Herring      - reg
23536c79bc7SRob Herring
23636c79bc7SRob Herring    additionalProperties: false
23736c79bc7SRob Herring
23836c79bc7SRob HerringadditionalProperties: false
23936c79bc7SRob Herring
24036c79bc7SRob Herringexamples:
24136c79bc7SRob Herring  - |
24236c79bc7SRob Herring    gic: interrupt-controller@2cf00000 {
24336c79bc7SRob Herring      compatible = "arm,gic-v3";
24436c79bc7SRob Herring      #interrupt-cells = <3>;
24536c79bc7SRob Herring      #address-cells = <1>;
24636c79bc7SRob Herring      #size-cells = <1>;
24736c79bc7SRob Herring      ranges;
24836c79bc7SRob Herring      interrupt-controller;
24936c79bc7SRob Herring      reg = <0x2f000000 0x10000>,  // GICD
25036c79bc7SRob Herring            <0x2f100000 0x200000>,  // GICR
25136c79bc7SRob Herring            <0x2c000000 0x2000>,  // GICC
25236c79bc7SRob Herring            <0x2c010000 0x2000>,  // GICH
25336c79bc7SRob Herring            <0x2c020000 0x2000>;  // GICV
25436c79bc7SRob Herring      interrupts = <1 9 4>;
25536c79bc7SRob Herring
25636c79bc7SRob Herring      msi-controller;
25736c79bc7SRob Herring      mbi-ranges = <256 128>;
25836c79bc7SRob Herring
25936c79bc7SRob Herring      msi-controller@2c200000 {
26036c79bc7SRob Herring        compatible = "arm,gic-v3-its";
26136c79bc7SRob Herring        msi-controller;
26236c79bc7SRob Herring        #msi-cells = <1>;
26336c79bc7SRob Herring        reg = <0x2c200000 0x20000>;
26436c79bc7SRob Herring      };
26536c79bc7SRob Herring    };
26636c79bc7SRob Herring
267e3a3356dSRob Herring  - |
26836c79bc7SRob Herring    interrupt-controller@2c010000 {
26936c79bc7SRob Herring      compatible = "arm,gic-v3";
27036c79bc7SRob Herring      #interrupt-cells = <4>;
27136c79bc7SRob Herring      #address-cells = <1>;
27236c79bc7SRob Herring      #size-cells = <1>;
27336c79bc7SRob Herring      ranges;
27436c79bc7SRob Herring      interrupt-controller;
27536c79bc7SRob Herring      redistributor-stride = <0x0 0x40000>;  // 256kB stride
27636c79bc7SRob Herring      #redistributor-regions = <2>;
27736c79bc7SRob Herring      reg = <0x2c010000 0x10000>,  // GICD
27836c79bc7SRob Herring            <0x2d000000 0x800000>,  // GICR 1: CPUs 0-31
27936c79bc7SRob Herring            <0x2e000000 0x800000>,  // GICR 2: CPUs 32-63
28036c79bc7SRob Herring            <0x2c040000 0x2000>,  // GICC
28136c79bc7SRob Herring            <0x2c060000 0x2000>,  // GICH
28236c79bc7SRob Herring            <0x2c080000 0x2000>;  // GICV
283e3a3356dSRob Herring      interrupts = <1 9 4 0>;
28436c79bc7SRob Herring
28536c79bc7SRob Herring      msi-controller@2c200000 {
28636c79bc7SRob Herring        compatible = "arm,gic-v3-its";
28736c79bc7SRob Herring        msi-controller;
28836c79bc7SRob Herring        #msi-cells = <1>;
28936c79bc7SRob Herring        reg = <0x2c200000 0x20000>;
29036c79bc7SRob Herring      };
29136c79bc7SRob Herring
29236c79bc7SRob Herring      msi-controller@2c400000 {
29336c79bc7SRob Herring        compatible = "arm,gic-v3-its";
29436c79bc7SRob Herring        msi-controller;
29536c79bc7SRob Herring        #msi-cells = <1>;
29636c79bc7SRob Herring        reg = <0x2c400000 0x20000>;
29736c79bc7SRob Herring      };
29836c79bc7SRob Herring
29936c79bc7SRob Herring      ppi-partitions {
30036c79bc7SRob Herring        part0: interrupt-partition-0 {
30139bd2b6aSRob Herring          affinity = <&cpu0>, <&cpu2>;
30236c79bc7SRob Herring        };
30336c79bc7SRob Herring
30436c79bc7SRob Herring        part1: interrupt-partition-1 {
30539bd2b6aSRob Herring          affinity = <&cpu1>, <&cpu3>;
30636c79bc7SRob Herring        };
30736c79bc7SRob Herring      };
30836c79bc7SRob Herring    };
30936c79bc7SRob Herring
31036c79bc7SRob Herring
31136c79bc7SRob Herring    device@0 {
31236c79bc7SRob Herring      reg = <0 4>;
31336c79bc7SRob Herring      interrupts = <1 1 4 &part0>;
31436c79bc7SRob Herring    };
31536c79bc7SRob Herring
31636c79bc7SRob Herring...
317