xref: /linux/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml (revision 4053b6b43fae126bea0654493fe512d364ee9fc1)
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:
10*4053b6b4SMarc 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
81*4053b6b4SMarc Zyngier      GICC, GICH and GICV are optional, but must be described if the CPUs
82*4053b6b4SMarc Zyngier      support them. Examples of such CPUs are ARM's implementations of the
83*4053b6b4SMarc Zyngier      ARMv8.0 architecture such as Cortex-A32, A34, A35, A53, A57, A72 and
84*4053b6b4SMarc Zyngier      A73 (this list is not exhaustive).
85*4053b6b4SMarc 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:
11136c79bc7SRob Herring      Only present if the Message Based Interrupt functionnality 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
13636c79bc7SRob Herring    description:
13736c79bc7SRob Herring      PPI affinity can be expressed as a single "ppi-partitions" node,
13836c79bc7SRob Herring      containing a set of sub-nodes.
13936c79bc7SRob Herring    patternProperties:
14036c79bc7SRob Herring      "^interrupt-partition-[0-9]+$":
141cf7d88fbSRob Herring        type: object
14236c79bc7SRob Herring        properties:
14336c79bc7SRob Herring          affinity:
14436c79bc7SRob Herring            $ref: /schemas/types.yaml#/definitions/phandle-array
14539bd2b6aSRob Herring            items:
14639bd2b6aSRob Herring              maxItems: 1
14736c79bc7SRob Herring            description:
14836c79bc7SRob Herring              Should be a list of phandles to CPU nodes (as described in
14936c79bc7SRob Herring              Documentation/devicetree/bindings/arm/cpus.yaml).
15036c79bc7SRob Herring
15136c79bc7SRob Herring        required:
15236c79bc7SRob Herring          - affinity
15336c79bc7SRob Herring
1544e08a559SLad Prabhakar  clocks:
1554e08a559SLad Prabhakar    maxItems: 1
1564e08a559SLad Prabhakar
1574e08a559SLad Prabhakar  clock-names:
1584e08a559SLad Prabhakar    items:
1594e08a559SLad Prabhakar      - const: aclk
1604e08a559SLad Prabhakar
1614e08a559SLad Prabhakar  power-domains:
1624e08a559SLad Prabhakar    maxItems: 1
1634e08a559SLad Prabhakar
1644e08a559SLad Prabhakar  resets:
1654e08a559SLad Prabhakar    maxItems: 1
1664e08a559SLad Prabhakar
16736c79bc7SRob Herringdependencies:
16836c79bc7SRob Herring  mbi-ranges: [ msi-controller ]
16936c79bc7SRob Herring  msi-controller: [ mbi-ranges ]
17036c79bc7SRob Herring
17136c79bc7SRob Herringrequired:
17236c79bc7SRob Herring  - compatible
17336c79bc7SRob Herring  - interrupts
17436c79bc7SRob Herring  - reg
17536c79bc7SRob Herring
17636c79bc7SRob HerringpatternProperties:
17736c79bc7SRob Herring  "^gic-its@": false
17836c79bc7SRob Herring  "^interrupt-controller@[0-9a-f]+$": false
17936c79bc7SRob Herring  # msi-controller is preferred, but allow other names
18036c79bc7SRob Herring  "^(msi-controller|gic-its|interrupt-controller)@[0-9a-f]+$":
18136c79bc7SRob Herring    type: object
18236c79bc7SRob Herring    description:
18336c79bc7SRob Herring      GICv3 has one or more Interrupt Translation Services (ITS) that are
18436c79bc7SRob Herring      used to route Message Signalled Interrupts (MSI) to the CPUs.
18536c79bc7SRob Herring    properties:
18636c79bc7SRob Herring      compatible:
18736c79bc7SRob Herring        const: arm,gic-v3-its
18836c79bc7SRob Herring
18936c79bc7SRob Herring      msi-controller: true
19036c79bc7SRob Herring
19136c79bc7SRob Herring      "#msi-cells":
19236c79bc7SRob Herring        description:
19336c79bc7SRob Herring          The single msi-cell is the DeviceID of the device which will generate
19436c79bc7SRob Herring          the MSI.
19536c79bc7SRob Herring        const: 1
19636c79bc7SRob Herring
19736c79bc7SRob Herring      reg:
19836c79bc7SRob Herring        description:
19936c79bc7SRob Herring          Specifies the base physical address and size of the ITS registers.
20036c79bc7SRob Herring        maxItems: 1
20136c79bc7SRob Herring
20236c79bc7SRob Herring      socionext,synquacer-pre-its:
20336c79bc7SRob Herring        description:
20436c79bc7SRob Herring          (u32, u32) tuple describing the untranslated
20536c79bc7SRob Herring          address and size of the pre-ITS window.
2063d21a460SRob Herring        $ref: /schemas/types.yaml#/definitions/uint32-array
2073d21a460SRob Herring        items:
20836c79bc7SRob Herring          minItems: 2
20936c79bc7SRob Herring          maxItems: 2
21036c79bc7SRob Herring
21136c79bc7SRob Herring    required:
21236c79bc7SRob Herring      - compatible
21336c79bc7SRob Herring      - msi-controller
21436c79bc7SRob Herring      - "#msi-cells"
21536c79bc7SRob Herring      - reg
21636c79bc7SRob Herring
21736c79bc7SRob Herring    additionalProperties: false
21836c79bc7SRob Herring
21936c79bc7SRob HerringadditionalProperties: false
22036c79bc7SRob Herring
22136c79bc7SRob Herringexamples:
22236c79bc7SRob Herring  - |
22336c79bc7SRob Herring    gic: interrupt-controller@2cf00000 {
22436c79bc7SRob Herring      compatible = "arm,gic-v3";
22536c79bc7SRob Herring      #interrupt-cells = <3>;
22636c79bc7SRob Herring      #address-cells = <1>;
22736c79bc7SRob Herring      #size-cells = <1>;
22836c79bc7SRob Herring      ranges;
22936c79bc7SRob Herring      interrupt-controller;
23036c79bc7SRob Herring      reg = <0x2f000000 0x10000>,  // GICD
23136c79bc7SRob Herring            <0x2f100000 0x200000>,  // GICR
23236c79bc7SRob Herring            <0x2c000000 0x2000>,  // GICC
23336c79bc7SRob Herring            <0x2c010000 0x2000>,  // GICH
23436c79bc7SRob Herring            <0x2c020000 0x2000>;  // GICV
23536c79bc7SRob Herring      interrupts = <1 9 4>;
23636c79bc7SRob Herring
23736c79bc7SRob Herring      msi-controller;
23836c79bc7SRob Herring      mbi-ranges = <256 128>;
23936c79bc7SRob Herring
24036c79bc7SRob Herring      msi-controller@2c200000 {
24136c79bc7SRob Herring        compatible = "arm,gic-v3-its";
24236c79bc7SRob Herring        msi-controller;
24336c79bc7SRob Herring        #msi-cells = <1>;
24436c79bc7SRob Herring        reg = <0x2c200000 0x20000>;
24536c79bc7SRob Herring      };
24636c79bc7SRob Herring    };
24736c79bc7SRob Herring
248e3a3356dSRob Herring  - |
24936c79bc7SRob Herring    interrupt-controller@2c010000 {
25036c79bc7SRob Herring      compatible = "arm,gic-v3";
25136c79bc7SRob Herring      #interrupt-cells = <4>;
25236c79bc7SRob Herring      #address-cells = <1>;
25336c79bc7SRob Herring      #size-cells = <1>;
25436c79bc7SRob Herring      ranges;
25536c79bc7SRob Herring      interrupt-controller;
25636c79bc7SRob Herring      redistributor-stride = <0x0 0x40000>;  // 256kB stride
25736c79bc7SRob Herring      #redistributor-regions = <2>;
25836c79bc7SRob Herring      reg = <0x2c010000 0x10000>,  // GICD
25936c79bc7SRob Herring            <0x2d000000 0x800000>,  // GICR 1: CPUs 0-31
26036c79bc7SRob Herring            <0x2e000000 0x800000>,  // GICR 2: CPUs 32-63
26136c79bc7SRob Herring            <0x2c040000 0x2000>,  // GICC
26236c79bc7SRob Herring            <0x2c060000 0x2000>,  // GICH
26336c79bc7SRob Herring            <0x2c080000 0x2000>;  // GICV
264e3a3356dSRob Herring      interrupts = <1 9 4 0>;
26536c79bc7SRob Herring
26636c79bc7SRob Herring      msi-controller@2c200000 {
26736c79bc7SRob Herring        compatible = "arm,gic-v3-its";
26836c79bc7SRob Herring        msi-controller;
26936c79bc7SRob Herring        #msi-cells = <1>;
27036c79bc7SRob Herring        reg = <0x2c200000 0x20000>;
27136c79bc7SRob Herring      };
27236c79bc7SRob Herring
27336c79bc7SRob Herring      msi-controller@2c400000 {
27436c79bc7SRob Herring        compatible = "arm,gic-v3-its";
27536c79bc7SRob Herring        msi-controller;
27636c79bc7SRob Herring        #msi-cells = <1>;
27736c79bc7SRob Herring        reg = <0x2c400000 0x20000>;
27836c79bc7SRob Herring      };
27936c79bc7SRob Herring
28036c79bc7SRob Herring      ppi-partitions {
28136c79bc7SRob Herring        part0: interrupt-partition-0 {
28239bd2b6aSRob Herring          affinity = <&cpu0>, <&cpu2>;
28336c79bc7SRob Herring        };
28436c79bc7SRob Herring
28536c79bc7SRob Herring        part1: interrupt-partition-1 {
28639bd2b6aSRob Herring          affinity = <&cpu1>, <&cpu3>;
28736c79bc7SRob Herring        };
28836c79bc7SRob Herring      };
28936c79bc7SRob Herring    };
29036c79bc7SRob Herring
29136c79bc7SRob Herring
29236c79bc7SRob Herring    device@0 {
29336c79bc7SRob Herring      reg = <0 4>;
29436c79bc7SRob Herring      interrupts = <1 1 4 &part0>;
29536c79bc7SRob Herring    };
29636c79bc7SRob Herring
29736c79bc7SRob Herring...
298