18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
28c2ecf20Sopenharmony_ci%YAML 1.2
38c2ecf20Sopenharmony_ci---
48c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/interrupt-controller/ti,sci-intr.yaml#
58c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cititle: Texas Instruments K3 Interrupt Router
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cimaintainers:
108c2ecf20Sopenharmony_ci  - Lokesh Vutla <lokeshvutla@ti.com>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ciallOf:
138c2ecf20Sopenharmony_ci  - $ref: /schemas/arm/keystone/ti,k3-sci-common.yaml#
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_cidescription: |
168c2ecf20Sopenharmony_ci  The Interrupt Router (INTR) module provides a mechanism to mux M
178c2ecf20Sopenharmony_ci  interrupt inputs to N interrupt outputs, where all M inputs are selectable
188c2ecf20Sopenharmony_ci  to be driven per N output. An Interrupt Router can either handle edge
198c2ecf20Sopenharmony_ci  triggered or level triggered interrupts and that is fixed in hardware.
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci                                   Interrupt Router
228c2ecf20Sopenharmony_ci                               +----------------------+
238c2ecf20Sopenharmony_ci                               |  Inputs     Outputs  |
248c2ecf20Sopenharmony_ci          +-------+            | +------+    +-----+  |
258c2ecf20Sopenharmony_ci          | GPIO  |----------->| | irq0 |    |  0  |  |       Host IRQ
268c2ecf20Sopenharmony_ci          +-------+            | +------+    +-----+  |      controller
278c2ecf20Sopenharmony_ci                               |    .           .     |      +-------+
288c2ecf20Sopenharmony_ci          +-------+            |    .           .     |----->|  IRQ  |
298c2ecf20Sopenharmony_ci          | INTA  |----------->|    .           .     |      +-------+
308c2ecf20Sopenharmony_ci          +-------+            |    .        +-----+  |
318c2ecf20Sopenharmony_ci                               | +------+    |  N  |  |
328c2ecf20Sopenharmony_ci                               | | irqM |    +-----+  |
338c2ecf20Sopenharmony_ci                               | +------+             |
348c2ecf20Sopenharmony_ci                               |                      |
358c2ecf20Sopenharmony_ci                               +----------------------+
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci  There is one register per output (MUXCNTL_N) that controls the selection.
388c2ecf20Sopenharmony_ci  Configuration of these MUXCNTL_N registers is done by a system controller
398c2ecf20Sopenharmony_ci  (like the Device Memory and Security Controller on K3 AM654 SoC). System
408c2ecf20Sopenharmony_ci  controller will keep track of the used and unused registers within the Router.
418c2ecf20Sopenharmony_ci  Driver should request the system controller to get the range of GIC IRQs
428c2ecf20Sopenharmony_ci  assigned to the requesting hosts. It is the drivers responsibility to keep
438c2ecf20Sopenharmony_ci  track of Host IRQs.
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci  Communication between the host processor running an OS and the system
468c2ecf20Sopenharmony_ci  controller happens through a protocol called TI System Control Interface
478c2ecf20Sopenharmony_ci  (TISCI protocol).
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ciproperties:
508c2ecf20Sopenharmony_ci  compatible:
518c2ecf20Sopenharmony_ci    const: ti,sci-intr
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci  ti,intr-trigger-type:
548c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
558c2ecf20Sopenharmony_ci    enum: [1, 4]
568c2ecf20Sopenharmony_ci    description: |
578c2ecf20Sopenharmony_ci      Should be one of the following.
588c2ecf20Sopenharmony_ci        1 = If intr supports edge triggered interrupts.
598c2ecf20Sopenharmony_ci        4 = If intr supports level triggered interrupts.
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci  interrupt-controller: true
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci  '#interrupt-cells':
648c2ecf20Sopenharmony_ci    const: 1
658c2ecf20Sopenharmony_ci    description: |
668c2ecf20Sopenharmony_ci      The 1st cell should contain interrupt router input hw number.
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci  ti,interrupt-ranges:
698c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32-matrix
708c2ecf20Sopenharmony_ci    description: |
718c2ecf20Sopenharmony_ci      Interrupt ranges that converts the INTR output hw irq numbers
728c2ecf20Sopenharmony_ci      to parents's input interrupt numbers.
738c2ecf20Sopenharmony_ci    items:
748c2ecf20Sopenharmony_ci      items:
758c2ecf20Sopenharmony_ci        - description: |
768c2ecf20Sopenharmony_ci            "output_irq" specifies the base for intr output irq
778c2ecf20Sopenharmony_ci        - description: |
788c2ecf20Sopenharmony_ci            "parent's input irq" specifies the base for parent irq
798c2ecf20Sopenharmony_ci        - description: |
808c2ecf20Sopenharmony_ci            "limit" specifies the limit for translation
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_cirequired:
838c2ecf20Sopenharmony_ci  - compatible
848c2ecf20Sopenharmony_ci  - ti,intr-trigger-type
858c2ecf20Sopenharmony_ci  - interrupt-controller
868c2ecf20Sopenharmony_ci  - '#interrupt-cells'
878c2ecf20Sopenharmony_ci  - ti,sci
888c2ecf20Sopenharmony_ci  - ti,sci-dev-id
898c2ecf20Sopenharmony_ci  - ti,interrupt-ranges
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ciunevaluatedProperties: false
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ciexamples:
948c2ecf20Sopenharmony_ci  - |
958c2ecf20Sopenharmony_ci    main_gpio_intr: interrupt-controller0 {
968c2ecf20Sopenharmony_ci        compatible = "ti,sci-intr";
978c2ecf20Sopenharmony_ci        ti,intr-trigger-type = <1>;
988c2ecf20Sopenharmony_ci        interrupt-controller;
998c2ecf20Sopenharmony_ci        interrupt-parent = <&gic500>;
1008c2ecf20Sopenharmony_ci        #interrupt-cells = <1>;
1018c2ecf20Sopenharmony_ci        ti,sci = <&dmsc>;
1028c2ecf20Sopenharmony_ci        ti,sci-dev-id = <131>;
1038c2ecf20Sopenharmony_ci        ti,interrupt-ranges = <0 360 32>;
1048c2ecf20Sopenharmony_ci    };
105