18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci%YAML 1.2
38c2ecf20Sopenharmony_ci---
48c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/interrupt-controller/arm,gic-v3.yaml#
58c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cititle: ARM Generic Interrupt Controller, version 3
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cimaintainers:
108c2ecf20Sopenharmony_ci  - Marc Zyngier <marc.zyngier@arm.com>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_cidescription: |
138c2ecf20Sopenharmony_ci  AArch64 SMP cores are often associated with a GICv3, providing Private
148c2ecf20Sopenharmony_ci  Peripheral Interrupts (PPI), Shared Peripheral Interrupts (SPI),
158c2ecf20Sopenharmony_ci  Software Generated Interrupts (SGI), and Locality-specific Peripheral
168c2ecf20Sopenharmony_ci  Interrupts (LPI).
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ciallOf:
198c2ecf20Sopenharmony_ci  - $ref: /schemas/interrupt-controller.yaml#
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ciproperties:
228c2ecf20Sopenharmony_ci  compatible:
238c2ecf20Sopenharmony_ci    oneOf:
248c2ecf20Sopenharmony_ci      - items:
258c2ecf20Sopenharmony_ci          - enum:
268c2ecf20Sopenharmony_ci              - qcom,msm8996-gic-v3
278c2ecf20Sopenharmony_ci          - const: arm,gic-v3
288c2ecf20Sopenharmony_ci      - const: arm,gic-v3
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci  interrupt-controller: true
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci  "#address-cells":
338c2ecf20Sopenharmony_ci    enum: [ 0, 1, 2 ]
348c2ecf20Sopenharmony_ci  "#size-cells":
358c2ecf20Sopenharmony_ci    enum: [ 1, 2 ]
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci  ranges: true
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci  "#interrupt-cells":
408c2ecf20Sopenharmony_ci    description: |
418c2ecf20Sopenharmony_ci      Specifies the number of cells needed to encode an interrupt source.
428c2ecf20Sopenharmony_ci      Must be a single cell with a value of at least 3.
438c2ecf20Sopenharmony_ci      If the system requires describing PPI affinity, then the value must
448c2ecf20Sopenharmony_ci      be at least 4.
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci      The 1st cell is the interrupt type; 0 for SPI interrupts, 1 for PPI
478c2ecf20Sopenharmony_ci      interrupts, 2 for interrupts in the Extended SPI range, 3 for the
488c2ecf20Sopenharmony_ci      Extended PPI range. Other values are reserved for future use.
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci      The 2nd cell contains the interrupt number for the interrupt type.
518c2ecf20Sopenharmony_ci      SPI interrupts are in the range [0-987]. PPI interrupts are in the
528c2ecf20Sopenharmony_ci      range [0-15]. Extented SPI interrupts are in the range [0-1023].
538c2ecf20Sopenharmony_ci      Extended PPI interrupts are in the range [0-127].
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci      The 3rd cell is the flags, encoded as follows:
568c2ecf20Sopenharmony_ci      bits[3:0] trigger type and level flags.
578c2ecf20Sopenharmony_ci        1 = edge triggered
588c2ecf20Sopenharmony_ci        4 = level triggered
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci      The 4th cell is a phandle to a node describing a set of CPUs this
618c2ecf20Sopenharmony_ci      interrupt is affine to. The interrupt must be a PPI, and the node
628c2ecf20Sopenharmony_ci      pointed must be a subnode of the "ppi-partitions" subnode. For
638c2ecf20Sopenharmony_ci      interrupt types other than PPI or PPIs that are not partitionned,
648c2ecf20Sopenharmony_ci      this cell must be zero. See the "ppi-partitions" node description
658c2ecf20Sopenharmony_ci      below.
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci      Cells 5 and beyond are reserved for future use and must have a value
688c2ecf20Sopenharmony_ci      of 0 if present.
698c2ecf20Sopenharmony_ci    enum: [ 3, 4 ]
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci  reg:
728c2ecf20Sopenharmony_ci    description: |
738c2ecf20Sopenharmony_ci      Specifies base physical address(s) and size of the GIC
748c2ecf20Sopenharmony_ci      registers, in the following order:
758c2ecf20Sopenharmony_ci      - GIC Distributor interface (GICD)
768c2ecf20Sopenharmony_ci      - GIC Redistributors (GICR), one range per redistributor region
778c2ecf20Sopenharmony_ci      - GIC CPU interface (GICC)
788c2ecf20Sopenharmony_ci      - GIC Hypervisor interface (GICH)
798c2ecf20Sopenharmony_ci      - GIC Virtual CPU interface (GICV)
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci      GICC, GICH and GICV are optional.
828c2ecf20Sopenharmony_ci    minItems: 2
838c2ecf20Sopenharmony_ci    maxItems: 4096   # Should be enough?
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci  interrupts:
868c2ecf20Sopenharmony_ci    description:
878c2ecf20Sopenharmony_ci      Interrupt source of the VGIC maintenance interrupt.
888c2ecf20Sopenharmony_ci    maxItems: 1
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci  redistributor-stride:
918c2ecf20Sopenharmony_ci    description:
928c2ecf20Sopenharmony_ci      If using padding pages, specifies the stride of consecutive
938c2ecf20Sopenharmony_ci      redistributors. Must be a multiple of 64kB.
948c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint64
958c2ecf20Sopenharmony_ci    multipleOf: 0x10000
968c2ecf20Sopenharmony_ci    exclusiveMinimum: 0
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci  "#redistributor-regions":
998c2ecf20Sopenharmony_ci    description:
1008c2ecf20Sopenharmony_ci      The number of independent contiguous regions occupied by the
1018c2ecf20Sopenharmony_ci      redistributors. Required if more than one such region is present.
1028c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
1038c2ecf20Sopenharmony_ci    maximum: 4096
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci  msi-controller:
1068c2ecf20Sopenharmony_ci    description:
1078c2ecf20Sopenharmony_ci      Only present if the Message Based Interrupt functionnality is
1088c2ecf20Sopenharmony_ci      being exposed by the HW, and the mbi-ranges property present.
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci  mbi-ranges:
1118c2ecf20Sopenharmony_ci    description:
1128c2ecf20Sopenharmony_ci      A list of pairs <intid span>, where "intid" is the first SPI of a range
1138c2ecf20Sopenharmony_ci      that can be used an MBI, and "span" the size of that range. Multiple
1148c2ecf20Sopenharmony_ci      ranges can be provided.
1158c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32-matrix
1168c2ecf20Sopenharmony_ci    items:
1178c2ecf20Sopenharmony_ci      minItems: 2
1188c2ecf20Sopenharmony_ci      maxItems: 2
1198c2ecf20Sopenharmony_ci
1208c2ecf20Sopenharmony_ci  mbi-alias:
1218c2ecf20Sopenharmony_ci    description:
1228c2ecf20Sopenharmony_ci      Address property. Base address of an alias of the GICD region containing
1238c2ecf20Sopenharmony_ci      only the {SET,CLR}SPI registers to be used if isolation is required,
1248c2ecf20Sopenharmony_ci      and if supported by the HW.
1258c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32-array
1268c2ecf20Sopenharmony_ci    items:
1278c2ecf20Sopenharmony_ci      minItems: 1
1288c2ecf20Sopenharmony_ci      maxItems: 2
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_ci  ppi-partitions:
1318c2ecf20Sopenharmony_ci    type: object
1328c2ecf20Sopenharmony_ci    description:
1338c2ecf20Sopenharmony_ci      PPI affinity can be expressed as a single "ppi-partitions" node,
1348c2ecf20Sopenharmony_ci      containing a set of sub-nodes.
1358c2ecf20Sopenharmony_ci    patternProperties:
1368c2ecf20Sopenharmony_ci      "^interrupt-partition-[0-9]+$":
1378c2ecf20Sopenharmony_ci        type: object
1388c2ecf20Sopenharmony_ci        properties:
1398c2ecf20Sopenharmony_ci          affinity:
1408c2ecf20Sopenharmony_ci            $ref: /schemas/types.yaml#/definitions/phandle-array
1418c2ecf20Sopenharmony_ci            description:
1428c2ecf20Sopenharmony_ci              Should be a list of phandles to CPU nodes (as described in
1438c2ecf20Sopenharmony_ci              Documentation/devicetree/bindings/arm/cpus.yaml).
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_ci        required:
1468c2ecf20Sopenharmony_ci          - affinity
1478c2ecf20Sopenharmony_ci
1488c2ecf20Sopenharmony_cidependencies:
1498c2ecf20Sopenharmony_ci  mbi-ranges: [ msi-controller ]
1508c2ecf20Sopenharmony_ci  msi-controller: [ mbi-ranges ]
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_cirequired:
1538c2ecf20Sopenharmony_ci  - compatible
1548c2ecf20Sopenharmony_ci  - interrupts
1558c2ecf20Sopenharmony_ci  - reg
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_cipatternProperties:
1588c2ecf20Sopenharmony_ci  "^gic-its@": false
1598c2ecf20Sopenharmony_ci  "^interrupt-controller@[0-9a-f]+$": false
1608c2ecf20Sopenharmony_ci  # msi-controller is preferred, but allow other names
1618c2ecf20Sopenharmony_ci  "^(msi-controller|gic-its|interrupt-controller)@[0-9a-f]+$":
1628c2ecf20Sopenharmony_ci    type: object
1638c2ecf20Sopenharmony_ci    description:
1648c2ecf20Sopenharmony_ci      GICv3 has one or more Interrupt Translation Services (ITS) that are
1658c2ecf20Sopenharmony_ci      used to route Message Signalled Interrupts (MSI) to the CPUs.
1668c2ecf20Sopenharmony_ci    properties:
1678c2ecf20Sopenharmony_ci      compatible:
1688c2ecf20Sopenharmony_ci        const: arm,gic-v3-its
1698c2ecf20Sopenharmony_ci
1708c2ecf20Sopenharmony_ci      msi-controller: true
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ci      "#msi-cells":
1738c2ecf20Sopenharmony_ci        description:
1748c2ecf20Sopenharmony_ci          The single msi-cell is the DeviceID of the device which will generate
1758c2ecf20Sopenharmony_ci          the MSI.
1768c2ecf20Sopenharmony_ci        const: 1
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci      reg:
1798c2ecf20Sopenharmony_ci        description:
1808c2ecf20Sopenharmony_ci          Specifies the base physical address and size of the ITS registers.
1818c2ecf20Sopenharmony_ci        maxItems: 1
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci      socionext,synquacer-pre-its:
1848c2ecf20Sopenharmony_ci        description:
1858c2ecf20Sopenharmony_ci          (u32, u32) tuple describing the untranslated
1868c2ecf20Sopenharmony_ci          address and size of the pre-ITS window.
1878c2ecf20Sopenharmony_ci        $ref: /schemas/types.yaml#/definitions/uint32-array
1888c2ecf20Sopenharmony_ci        items:
1898c2ecf20Sopenharmony_ci          minItems: 2
1908c2ecf20Sopenharmony_ci          maxItems: 2
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_ci    required:
1938c2ecf20Sopenharmony_ci      - compatible
1948c2ecf20Sopenharmony_ci      - msi-controller
1958c2ecf20Sopenharmony_ci      - "#msi-cells"
1968c2ecf20Sopenharmony_ci      - reg
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ci    additionalProperties: false
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ciadditionalProperties: false
2018c2ecf20Sopenharmony_ci
2028c2ecf20Sopenharmony_ciexamples:
2038c2ecf20Sopenharmony_ci  - |
2048c2ecf20Sopenharmony_ci    gic: interrupt-controller@2cf00000 {
2058c2ecf20Sopenharmony_ci      compatible = "arm,gic-v3";
2068c2ecf20Sopenharmony_ci      #interrupt-cells = <3>;
2078c2ecf20Sopenharmony_ci      #address-cells = <1>;
2088c2ecf20Sopenharmony_ci      #size-cells = <1>;
2098c2ecf20Sopenharmony_ci      ranges;
2108c2ecf20Sopenharmony_ci      interrupt-controller;
2118c2ecf20Sopenharmony_ci      reg = <0x2f000000 0x10000>,  // GICD
2128c2ecf20Sopenharmony_ci            <0x2f100000 0x200000>,  // GICR
2138c2ecf20Sopenharmony_ci            <0x2c000000 0x2000>,  // GICC
2148c2ecf20Sopenharmony_ci            <0x2c010000 0x2000>,  // GICH
2158c2ecf20Sopenharmony_ci            <0x2c020000 0x2000>;  // GICV
2168c2ecf20Sopenharmony_ci      interrupts = <1 9 4>;
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci      msi-controller;
2198c2ecf20Sopenharmony_ci      mbi-ranges = <256 128>;
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ci      msi-controller@2c200000 {
2228c2ecf20Sopenharmony_ci        compatible = "arm,gic-v3-its";
2238c2ecf20Sopenharmony_ci        msi-controller;
2248c2ecf20Sopenharmony_ci        #msi-cells = <1>;
2258c2ecf20Sopenharmony_ci        reg = <0x2c200000 0x20000>;
2268c2ecf20Sopenharmony_ci      };
2278c2ecf20Sopenharmony_ci    };
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_ci    interrupt-controller@2c010000 {
2308c2ecf20Sopenharmony_ci      compatible = "arm,gic-v3";
2318c2ecf20Sopenharmony_ci      #interrupt-cells = <4>;
2328c2ecf20Sopenharmony_ci      #address-cells = <1>;
2338c2ecf20Sopenharmony_ci      #size-cells = <1>;
2348c2ecf20Sopenharmony_ci      ranges;
2358c2ecf20Sopenharmony_ci      interrupt-controller;
2368c2ecf20Sopenharmony_ci      redistributor-stride = <0x0 0x40000>;  // 256kB stride
2378c2ecf20Sopenharmony_ci      #redistributor-regions = <2>;
2388c2ecf20Sopenharmony_ci      reg = <0x2c010000 0x10000>,  // GICD
2398c2ecf20Sopenharmony_ci            <0x2d000000 0x800000>,  // GICR 1: CPUs 0-31
2408c2ecf20Sopenharmony_ci            <0x2e000000 0x800000>,  // GICR 2: CPUs 32-63
2418c2ecf20Sopenharmony_ci            <0x2c040000 0x2000>,  // GICC
2428c2ecf20Sopenharmony_ci            <0x2c060000 0x2000>,  // GICH
2438c2ecf20Sopenharmony_ci            <0x2c080000 0x2000>;  // GICV
2448c2ecf20Sopenharmony_ci      interrupts = <1 9 4>;
2458c2ecf20Sopenharmony_ci
2468c2ecf20Sopenharmony_ci      msi-controller@2c200000 {
2478c2ecf20Sopenharmony_ci        compatible = "arm,gic-v3-its";
2488c2ecf20Sopenharmony_ci        msi-controller;
2498c2ecf20Sopenharmony_ci        #msi-cells = <1>;
2508c2ecf20Sopenharmony_ci        reg = <0x2c200000 0x20000>;
2518c2ecf20Sopenharmony_ci      };
2528c2ecf20Sopenharmony_ci
2538c2ecf20Sopenharmony_ci      msi-controller@2c400000 {
2548c2ecf20Sopenharmony_ci        compatible = "arm,gic-v3-its";
2558c2ecf20Sopenharmony_ci        msi-controller;
2568c2ecf20Sopenharmony_ci        #msi-cells = <1>;
2578c2ecf20Sopenharmony_ci        reg = <0x2c400000 0x20000>;
2588c2ecf20Sopenharmony_ci      };
2598c2ecf20Sopenharmony_ci
2608c2ecf20Sopenharmony_ci      ppi-partitions {
2618c2ecf20Sopenharmony_ci        part0: interrupt-partition-0 {
2628c2ecf20Sopenharmony_ci          affinity = <&cpu0 &cpu2>;
2638c2ecf20Sopenharmony_ci        };
2648c2ecf20Sopenharmony_ci
2658c2ecf20Sopenharmony_ci        part1: interrupt-partition-1 {
2668c2ecf20Sopenharmony_ci          affinity = <&cpu1 &cpu3>;
2678c2ecf20Sopenharmony_ci        };
2688c2ecf20Sopenharmony_ci      };
2698c2ecf20Sopenharmony_ci    };
2708c2ecf20Sopenharmony_ci
2718c2ecf20Sopenharmony_ci
2728c2ecf20Sopenharmony_ci    device@0 {
2738c2ecf20Sopenharmony_ci      reg = <0 4>;
2748c2ecf20Sopenharmony_ci      interrupts = <1 1 4 &part0>;
2758c2ecf20Sopenharmony_ci    };
2768c2ecf20Sopenharmony_ci
2778c2ecf20Sopenharmony_ci...
278