xref: /linux/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml (revision cf7d88fb867c107a6b93c8a180ce9831fd4dc6fb)
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:
1036c79bc7SRob Herring  - Marc Zyngier <marc.zyngier@arm.com>
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
8136c79bc7SRob Herring      GICC, GICH and GICV are optional.
8236c79bc7SRob Herring    minItems: 2
8336c79bc7SRob Herring    maxItems: 4096   # Should be enough?
8436c79bc7SRob Herring
8536c79bc7SRob Herring  interrupts:
8636c79bc7SRob Herring    description:
8736c79bc7SRob Herring      Interrupt source of the VGIC maintenance interrupt.
8836c79bc7SRob Herring    maxItems: 1
8936c79bc7SRob Herring
9036c79bc7SRob Herring  redistributor-stride:
9136c79bc7SRob Herring    description:
9236c79bc7SRob Herring      If using padding pages, specifies the stride of consecutive
9336c79bc7SRob Herring      redistributors. Must be a multiple of 64kB.
9436c79bc7SRob Herring    allOf:
9536c79bc7SRob Herring      - $ref: /schemas/types.yaml#/definitions/uint64
9636c79bc7SRob Herring      - multipleOf: 0x10000
9736c79bc7SRob Herring        exclusiveMinimum: 0
9836c79bc7SRob Herring
9936c79bc7SRob Herring  "#redistributor-regions":
10036c79bc7SRob Herring    description:
10136c79bc7SRob Herring      The number of independent contiguous regions occupied by the
10236c79bc7SRob Herring      redistributors. Required if more than one such region is present.
10336c79bc7SRob Herring    allOf:
10436c79bc7SRob Herring      - $ref: /schemas/types.yaml#/definitions/uint32
10536c79bc7SRob Herring      - maximum: 4096   # Should be enough?
10636c79bc7SRob Herring
10736c79bc7SRob Herring  msi-controller:
10836c79bc7SRob Herring    description:
10936c79bc7SRob Herring      Only present if the Message Based Interrupt functionnality is
11036c79bc7SRob Herring      being exposed by the HW, and the mbi-ranges property present.
11136c79bc7SRob Herring
11236c79bc7SRob Herring  mbi-ranges:
11336c79bc7SRob Herring    description:
11436c79bc7SRob Herring      A list of pairs <intid span>, where "intid" is the first SPI of a range
11536c79bc7SRob Herring      that can be used an MBI, and "span" the size of that range. Multiple
11636c79bc7SRob Herring      ranges can be provided.
11736c79bc7SRob Herring    allOf:
11836c79bc7SRob Herring      - $ref: /schemas/types.yaml#/definitions/uint32-matrix
11936c79bc7SRob Herring      - items:
12036c79bc7SRob Herring          minItems: 2
12136c79bc7SRob Herring          maxItems: 2
12236c79bc7SRob Herring
12336c79bc7SRob Herring  mbi-alias:
12436c79bc7SRob Herring    description:
12536c79bc7SRob Herring      Address property. Base address of an alias of the GICD region containing
12636c79bc7SRob Herring      only the {SET,CLR}SPI registers to be used if isolation is required,
12736c79bc7SRob Herring      and if supported by the HW.
12836c79bc7SRob Herring    allOf:
12936c79bc7SRob Herring      - $ref: /schemas/types.yaml#/definitions/uint32-array
13036c79bc7SRob 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]+$":
141*cf7d88fbSRob Herring        type: object
14236c79bc7SRob Herring        properties:
14336c79bc7SRob Herring          affinity:
14436c79bc7SRob Herring            $ref: /schemas/types.yaml#/definitions/phandle-array
14536c79bc7SRob Herring            description:
14636c79bc7SRob Herring              Should be a list of phandles to CPU nodes (as described in
14736c79bc7SRob Herring              Documentation/devicetree/bindings/arm/cpus.yaml).
14836c79bc7SRob Herring
14936c79bc7SRob Herring        required:
15036c79bc7SRob Herring          - affinity
15136c79bc7SRob Herring
15236c79bc7SRob Herringdependencies:
15336c79bc7SRob Herring  mbi-ranges: [ msi-controller ]
15436c79bc7SRob Herring  msi-controller: [ mbi-ranges ]
15536c79bc7SRob Herring
15636c79bc7SRob Herringrequired:
15736c79bc7SRob Herring  - compatible
15836c79bc7SRob Herring  - interrupts
15936c79bc7SRob Herring  - reg
16036c79bc7SRob Herring
16136c79bc7SRob HerringpatternProperties:
16236c79bc7SRob Herring  "^gic-its@": false
16336c79bc7SRob Herring  "^interrupt-controller@[0-9a-f]+$": false
16436c79bc7SRob Herring  # msi-controller is preferred, but allow other names
16536c79bc7SRob Herring  "^(msi-controller|gic-its|interrupt-controller)@[0-9a-f]+$":
16636c79bc7SRob Herring    type: object
16736c79bc7SRob Herring    description:
16836c79bc7SRob Herring      GICv3 has one or more Interrupt Translation Services (ITS) that are
16936c79bc7SRob Herring      used to route Message Signalled Interrupts (MSI) to the CPUs.
17036c79bc7SRob Herring    properties:
17136c79bc7SRob Herring      compatible:
17236c79bc7SRob Herring        const: arm,gic-v3-its
17336c79bc7SRob Herring
17436c79bc7SRob Herring      msi-controller: true
17536c79bc7SRob Herring
17636c79bc7SRob Herring      "#msi-cells":
17736c79bc7SRob Herring        description:
17836c79bc7SRob Herring          The single msi-cell is the DeviceID of the device which will generate
17936c79bc7SRob Herring          the MSI.
18036c79bc7SRob Herring        const: 1
18136c79bc7SRob Herring
18236c79bc7SRob Herring      reg:
18336c79bc7SRob Herring        description:
18436c79bc7SRob Herring          Specifies the base physical address and size of the ITS registers.
18536c79bc7SRob Herring        maxItems: 1
18636c79bc7SRob Herring
18736c79bc7SRob Herring      socionext,synquacer-pre-its:
18836c79bc7SRob Herring        description:
18936c79bc7SRob Herring          (u32, u32) tuple describing the untranslated
19036c79bc7SRob Herring          address and size of the pre-ITS window.
19136c79bc7SRob Herring        allOf:
19236c79bc7SRob Herring          - $ref: /schemas/types.yaml#/definitions/uint32-array
19336c79bc7SRob Herring          - items:
19436c79bc7SRob Herring              minItems: 2
19536c79bc7SRob Herring              maxItems: 2
19636c79bc7SRob Herring
19736c79bc7SRob Herring    required:
19836c79bc7SRob Herring      - compatible
19936c79bc7SRob Herring      - msi-controller
20036c79bc7SRob Herring      - "#msi-cells"
20136c79bc7SRob Herring      - reg
20236c79bc7SRob Herring
20336c79bc7SRob Herring    additionalProperties: false
20436c79bc7SRob Herring
20536c79bc7SRob HerringadditionalProperties: false
20636c79bc7SRob Herring
20736c79bc7SRob Herringexamples:
20836c79bc7SRob Herring  - |
20936c79bc7SRob Herring    gic: interrupt-controller@2cf00000 {
21036c79bc7SRob Herring      compatible = "arm,gic-v3";
21136c79bc7SRob Herring      #interrupt-cells = <3>;
21236c79bc7SRob Herring      #address-cells = <1>;
21336c79bc7SRob Herring      #size-cells = <1>;
21436c79bc7SRob Herring      ranges;
21536c79bc7SRob Herring      interrupt-controller;
21636c79bc7SRob Herring      reg = <0x2f000000 0x10000>,  // GICD
21736c79bc7SRob Herring            <0x2f100000 0x200000>,  // GICR
21836c79bc7SRob Herring            <0x2c000000 0x2000>,  // GICC
21936c79bc7SRob Herring            <0x2c010000 0x2000>,  // GICH
22036c79bc7SRob Herring            <0x2c020000 0x2000>;  // GICV
22136c79bc7SRob Herring      interrupts = <1 9 4>;
22236c79bc7SRob Herring
22336c79bc7SRob Herring      msi-controller;
22436c79bc7SRob Herring      mbi-ranges = <256 128>;
22536c79bc7SRob Herring
22636c79bc7SRob Herring      msi-controller@2c200000 {
22736c79bc7SRob Herring        compatible = "arm,gic-v3-its";
22836c79bc7SRob Herring        msi-controller;
22936c79bc7SRob Herring        #msi-cells = <1>;
23036c79bc7SRob Herring        reg = <0x2c200000 0x20000>;
23136c79bc7SRob Herring      };
23236c79bc7SRob Herring    };
23336c79bc7SRob Herring
23436c79bc7SRob Herring    interrupt-controller@2c010000 {
23536c79bc7SRob Herring      compatible = "arm,gic-v3";
23636c79bc7SRob Herring      #interrupt-cells = <4>;
23736c79bc7SRob Herring      #address-cells = <1>;
23836c79bc7SRob Herring      #size-cells = <1>;
23936c79bc7SRob Herring      ranges;
24036c79bc7SRob Herring      interrupt-controller;
24136c79bc7SRob Herring      redistributor-stride = <0x0 0x40000>;  // 256kB stride
24236c79bc7SRob Herring      #redistributor-regions = <2>;
24336c79bc7SRob Herring      reg = <0x2c010000 0x10000>,  // GICD
24436c79bc7SRob Herring            <0x2d000000 0x800000>,  // GICR 1: CPUs 0-31
24536c79bc7SRob Herring            <0x2e000000 0x800000>,  // GICR 2: CPUs 32-63
24636c79bc7SRob Herring            <0x2c040000 0x2000>,  // GICC
24736c79bc7SRob Herring            <0x2c060000 0x2000>,  // GICH
24836c79bc7SRob Herring            <0x2c080000 0x2000>;  // GICV
24936c79bc7SRob Herring      interrupts = <1 9 4>;
25036c79bc7SRob Herring
25136c79bc7SRob Herring      msi-controller@2c200000 {
25236c79bc7SRob Herring        compatible = "arm,gic-v3-its";
25336c79bc7SRob Herring        msi-controller;
25436c79bc7SRob Herring        #msi-cells = <1>;
25536c79bc7SRob Herring        reg = <0x2c200000 0x20000>;
25636c79bc7SRob Herring      };
25736c79bc7SRob Herring
25836c79bc7SRob Herring      msi-controller@2c400000 {
25936c79bc7SRob Herring        compatible = "arm,gic-v3-its";
26036c79bc7SRob Herring        msi-controller;
26136c79bc7SRob Herring        #msi-cells = <1>;
26236c79bc7SRob Herring        reg = <0x2c400000 0x20000>;
26336c79bc7SRob Herring      };
26436c79bc7SRob Herring
26536c79bc7SRob Herring      ppi-partitions {
26636c79bc7SRob Herring        part0: interrupt-partition-0 {
26736c79bc7SRob Herring          affinity = <&cpu0 &cpu2>;
26836c79bc7SRob Herring        };
26936c79bc7SRob Herring
27036c79bc7SRob Herring        part1: interrupt-partition-1 {
27136c79bc7SRob Herring          affinity = <&cpu1 &cpu3>;
27236c79bc7SRob Herring        };
27336c79bc7SRob Herring      };
27436c79bc7SRob Herring    };
27536c79bc7SRob Herring
27636c79bc7SRob Herring
27736c79bc7SRob Herring    device@0 {
27836c79bc7SRob Herring      reg = <0 4>;
27936c79bc7SRob Herring      interrupts = <1 1 4 &part0>;
28036c79bc7SRob Herring    };
28136c79bc7SRob Herring
28236c79bc7SRob Herring...
283