18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
28c2ecf20Sopenharmony_ci%YAML 1.2
38c2ecf20Sopenharmony_ci---
48c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/interrupt-controller/ti,pruss-intc.yaml#
58c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cititle: TI PRU-ICSS Local Interrupt Controller
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cimaintainers:
108c2ecf20Sopenharmony_ci  - Suman Anna <s-anna@ti.com>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_cidescription: |
138c2ecf20Sopenharmony_ci  Each PRU-ICSS has a single interrupt controller instance that is common
148c2ecf20Sopenharmony_ci  to all the PRU cores. Most interrupt controllers can route 64 input events
158c2ecf20Sopenharmony_ci  which are then mapped to 10 possible output interrupts through two levels
168c2ecf20Sopenharmony_ci  of mapping. The input events can be triggered by either the PRUs and/or
178c2ecf20Sopenharmony_ci  various other PRUSS internal and external peripherals. The first 2 output
188c2ecf20Sopenharmony_ci  interrupts (0, 1) are fed exclusively to the internal PRU cores, with the
198c2ecf20Sopenharmony_ci  remaining 8 (2 through 9) connected to external interrupt controllers
208c2ecf20Sopenharmony_ci  including the MPU and/or other PRUSS instances, DSPs or devices.
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci  The property "ti,irqs-reserved" is used for denoting the connection
238c2ecf20Sopenharmony_ci  differences on the output interrupts 2 through 9. If this property is not
248c2ecf20Sopenharmony_ci  defined, it implies that all the PRUSS INTC output interrupts 2 through 9
258c2ecf20Sopenharmony_ci  (host_intr0 through host_intr7) are connected exclusively to the Arm interrupt
268c2ecf20Sopenharmony_ci  controller.
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci  The K3 family of SoCs can handle 160 input events that can be mapped to 20
298c2ecf20Sopenharmony_ci  different possible output interrupts. The additional output interrupts (10
308c2ecf20Sopenharmony_ci  through 19) are connected to new sub-modules within the ICSSG instances.
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci  This interrupt-controller node should be defined as a child node of the
338c2ecf20Sopenharmony_ci  corresponding PRUSS node. The node should be named "interrupt-controller".
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ciproperties:
368c2ecf20Sopenharmony_ci  compatible:
378c2ecf20Sopenharmony_ci    enum:
388c2ecf20Sopenharmony_ci      - ti,pruss-intc
398c2ecf20Sopenharmony_ci      - ti,icssg-intc
408c2ecf20Sopenharmony_ci    description: |
418c2ecf20Sopenharmony_ci      Use "ti,pruss-intc" for OMAP-L13x/AM18x/DA850 SoCs,
428c2ecf20Sopenharmony_ci                              AM335x family of SoCs,
438c2ecf20Sopenharmony_ci                              AM437x family of SoCs,
448c2ecf20Sopenharmony_ci                              AM57xx family of SoCs
458c2ecf20Sopenharmony_ci                              66AK2G family of SoCs
468c2ecf20Sopenharmony_ci      Use "ti,icssg-intc" for K3 AM65x & J721E family of SoCs
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci  reg:
498c2ecf20Sopenharmony_ci    maxItems: 1
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci  interrupts:
528c2ecf20Sopenharmony_ci    minItems: 1
538c2ecf20Sopenharmony_ci    maxItems: 8
548c2ecf20Sopenharmony_ci    description: |
558c2ecf20Sopenharmony_ci      All the interrupts generated towards the main host processor in the SoC.
568c2ecf20Sopenharmony_ci      A shared interrupt can be skipped if the desired destination and usage is
578c2ecf20Sopenharmony_ci      by a different processor/device.
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci  interrupt-names:
608c2ecf20Sopenharmony_ci    minItems: 1
618c2ecf20Sopenharmony_ci    maxItems: 8
628c2ecf20Sopenharmony_ci    items:
638c2ecf20Sopenharmony_ci      pattern: host_intr[0-7]
648c2ecf20Sopenharmony_ci    description: |
658c2ecf20Sopenharmony_ci      Should use one of the above names for each valid host event interrupt
668c2ecf20Sopenharmony_ci      connected to Arm interrupt controller, the name should match the
678c2ecf20Sopenharmony_ci      corresponding host event interrupt number.
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci  interrupt-controller: true
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci  "#interrupt-cells":
728c2ecf20Sopenharmony_ci    const: 3
738c2ecf20Sopenharmony_ci    description: |
748c2ecf20Sopenharmony_ci      Client users shall use the PRU System event number (the interrupt source
758c2ecf20Sopenharmony_ci      that the client is interested in) [cell 1], PRU channel [cell 2] and PRU
768c2ecf20Sopenharmony_ci      host_event (target) [cell 3] as the value of the interrupts property in
778c2ecf20Sopenharmony_ci      their node.  The system events can be mapped to some output host
788c2ecf20Sopenharmony_ci      interrupts through 2 levels of many-to-one mapping i.e. events to channel
798c2ecf20Sopenharmony_ci      mapping and channels to host interrupts so through this property entire
808c2ecf20Sopenharmony_ci      mapping is provided.
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci  ti,irqs-reserved:
838c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#definitions/uint8
848c2ecf20Sopenharmony_ci    description: |
858c2ecf20Sopenharmony_ci      Bitmask of host interrupts between 0 and 7 (corresponding to PRUSS INTC
868c2ecf20Sopenharmony_ci      output interrupts 2 through 9) that are not connected to the Arm interrupt
878c2ecf20Sopenharmony_ci      controller or are shared and used by other devices or processors in the
888c2ecf20Sopenharmony_ci      SoC. Define this property when any of 8 interrupts should not be handled
898c2ecf20Sopenharmony_ci      by Arm interrupt controller.
908c2ecf20Sopenharmony_ci        Eg: - AM437x and 66AK2G SoCs do not have "host_intr5" interrupt
918c2ecf20Sopenharmony_ci              connected to MPU
928c2ecf20Sopenharmony_ci            - AM65x and J721E SoCs have "host_intr5", "host_intr6" and
938c2ecf20Sopenharmony_ci              "host_intr7" interrupts connected to MPU, and other ICSSG
948c2ecf20Sopenharmony_ci              instances.
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_cirequired:
978c2ecf20Sopenharmony_ci  - compatible
988c2ecf20Sopenharmony_ci  - reg
998c2ecf20Sopenharmony_ci  - interrupts
1008c2ecf20Sopenharmony_ci  - interrupt-names
1018c2ecf20Sopenharmony_ci  - interrupt-controller
1028c2ecf20Sopenharmony_ci  - "#interrupt-cells"
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ciadditionalProperties: false
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ciexamples:
1078c2ecf20Sopenharmony_ci  - |
1088c2ecf20Sopenharmony_ci    /* AM33xx PRU-ICSS */
1098c2ecf20Sopenharmony_ci    pruss: pruss@0 {
1108c2ecf20Sopenharmony_ci        compatible = "ti,am3356-pruss";
1118c2ecf20Sopenharmony_ci        reg = <0x0 0x80000>;
1128c2ecf20Sopenharmony_ci        #address-cells = <1>;
1138c2ecf20Sopenharmony_ci        #size-cells = <1>;
1148c2ecf20Sopenharmony_ci        ranges;
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci        pruss_intc: interrupt-controller@20000 {
1178c2ecf20Sopenharmony_ci            compatible = "ti,pruss-intc";
1188c2ecf20Sopenharmony_ci            reg = <0x20000 0x2000>;
1198c2ecf20Sopenharmony_ci            interrupts = <20 21 22 23 24 25 26 27>;
1208c2ecf20Sopenharmony_ci            interrupt-names = "host_intr0", "host_intr1",
1218c2ecf20Sopenharmony_ci                              "host_intr2", "host_intr3",
1228c2ecf20Sopenharmony_ci                              "host_intr4", "host_intr5",
1238c2ecf20Sopenharmony_ci                              "host_intr6", "host_intr7";
1248c2ecf20Sopenharmony_ci            interrupt-controller;
1258c2ecf20Sopenharmony_ci            #interrupt-cells = <3>;
1268c2ecf20Sopenharmony_ci        };
1278c2ecf20Sopenharmony_ci    };
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci  - |
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci    /* AM4376 PRU-ICSS */
1328c2ecf20Sopenharmony_ci    #include <dt-bindings/interrupt-controller/arm-gic.h>
1338c2ecf20Sopenharmony_ci    pruss@0 {
1348c2ecf20Sopenharmony_ci        compatible = "ti,am4376-pruss";
1358c2ecf20Sopenharmony_ci        reg = <0x0 0x40000>;
1368c2ecf20Sopenharmony_ci        #address-cells = <1>;
1378c2ecf20Sopenharmony_ci        #size-cells = <1>;
1388c2ecf20Sopenharmony_ci        ranges;
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_ci        interrupt-controller@20000 {
1418c2ecf20Sopenharmony_ci            compatible = "ti,pruss-intc";
1428c2ecf20Sopenharmony_ci            reg = <0x20000 0x2000>;
1438c2ecf20Sopenharmony_ci            interrupt-controller;
1448c2ecf20Sopenharmony_ci            #interrupt-cells = <3>;
1458c2ecf20Sopenharmony_ci            interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>,
1468c2ecf20Sopenharmony_ci                   <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
1478c2ecf20Sopenharmony_ci                   <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>,
1488c2ecf20Sopenharmony_ci                   <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>,
1498c2ecf20Sopenharmony_ci                   <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>,
1508c2ecf20Sopenharmony_ci                   <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>,
1518c2ecf20Sopenharmony_ci                   <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
1528c2ecf20Sopenharmony_ci            interrupt-names = "host_intr0", "host_intr1",
1538c2ecf20Sopenharmony_ci                              "host_intr2", "host_intr3",
1548c2ecf20Sopenharmony_ci                              "host_intr4",
1558c2ecf20Sopenharmony_ci                              "host_intr6", "host_intr7";
1568c2ecf20Sopenharmony_ci            ti,irqs-reserved = /bits/ 8 <0x20>; /* BIT(5) */
1578c2ecf20Sopenharmony_ci        };
1588c2ecf20Sopenharmony_ci    };
159