162306a36Sopenharmony_ci# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
262306a36Sopenharmony_ci%YAML 1.2
362306a36Sopenharmony_ci---
462306a36Sopenharmony_ci$id: http://devicetree.org/schemas/interrupt-controller/ti,sci-intr.yaml#
562306a36Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
662306a36Sopenharmony_ci
762306a36Sopenharmony_cititle: Texas Instruments K3 Interrupt Router
862306a36Sopenharmony_ci
962306a36Sopenharmony_cimaintainers:
1062306a36Sopenharmony_ci  - Lokesh Vutla <lokeshvutla@ti.com>
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ciallOf:
1362306a36Sopenharmony_ci  - $ref: /schemas/arm/keystone/ti,k3-sci-common.yaml#
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_cidescription: |
1662306a36Sopenharmony_ci  The Interrupt Router (INTR) module provides a mechanism to mux M
1762306a36Sopenharmony_ci  interrupt inputs to N interrupt outputs, where all M inputs are selectable
1862306a36Sopenharmony_ci  to be driven per N output. An Interrupt Router can either handle edge
1962306a36Sopenharmony_ci  triggered or level triggered interrupts and that is fixed in hardware.
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci                                   Interrupt Router
2262306a36Sopenharmony_ci                               +----------------------+
2362306a36Sopenharmony_ci                               |  Inputs     Outputs  |
2462306a36Sopenharmony_ci          +-------+            | +------+    +-----+  |
2562306a36Sopenharmony_ci          | GPIO  |----------->| | irq0 |    |  0  |  |       Host IRQ
2662306a36Sopenharmony_ci          +-------+            | +------+    +-----+  |      controller
2762306a36Sopenharmony_ci                               |    .           .     |      +-------+
2862306a36Sopenharmony_ci          +-------+            |    .           .     |----->|  IRQ  |
2962306a36Sopenharmony_ci          | INTA  |----------->|    .           .     |      +-------+
3062306a36Sopenharmony_ci          +-------+            |    .        +-----+  |
3162306a36Sopenharmony_ci                               | +------+    |  N  |  |
3262306a36Sopenharmony_ci                               | | irqM |    +-----+  |
3362306a36Sopenharmony_ci                               | +------+             |
3462306a36Sopenharmony_ci                               |                      |
3562306a36Sopenharmony_ci                               +----------------------+
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci  There is one register per output (MUXCNTL_N) that controls the selection.
3862306a36Sopenharmony_ci  Configuration of these MUXCNTL_N registers is done by a system controller
3962306a36Sopenharmony_ci  (like the Device Memory and Security Controller on K3 AM654 SoC). System
4062306a36Sopenharmony_ci  controller will keep track of the used and unused registers within the Router.
4162306a36Sopenharmony_ci  Driver should request the system controller to get the range of GIC IRQs
4262306a36Sopenharmony_ci  assigned to the requesting hosts. It is the drivers responsibility to keep
4362306a36Sopenharmony_ci  track of Host IRQs.
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci  Communication between the host processor running an OS and the system
4662306a36Sopenharmony_ci  controller happens through a protocol called TI System Control Interface
4762306a36Sopenharmony_ci  (TISCI protocol).
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ciproperties:
5062306a36Sopenharmony_ci  compatible:
5162306a36Sopenharmony_ci    const: ti,sci-intr
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci  ti,intr-trigger-type:
5462306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
5562306a36Sopenharmony_ci    enum: [1, 4]
5662306a36Sopenharmony_ci    description: |
5762306a36Sopenharmony_ci      Should be one of the following.
5862306a36Sopenharmony_ci        1 = If intr supports edge triggered interrupts.
5962306a36Sopenharmony_ci        4 = If intr supports level triggered interrupts.
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_ci  reg:
6262306a36Sopenharmony_ci    maxItems: 1
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_ci  interrupt-controller: true
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci  '#interrupt-cells':
6762306a36Sopenharmony_ci    const: 1
6862306a36Sopenharmony_ci    description: |
6962306a36Sopenharmony_ci      The 1st cell should contain interrupt router input hw number.
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci  ti,interrupt-ranges:
7262306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32-matrix
7362306a36Sopenharmony_ci    description: |
7462306a36Sopenharmony_ci      Interrupt ranges that converts the INTR output hw irq numbers
7562306a36Sopenharmony_ci      to parents's input interrupt numbers.
7662306a36Sopenharmony_ci    items:
7762306a36Sopenharmony_ci      items:
7862306a36Sopenharmony_ci        - description: |
7962306a36Sopenharmony_ci            "output_irq" specifies the base for intr output irq
8062306a36Sopenharmony_ci        - description: |
8162306a36Sopenharmony_ci            "parent's input irq" specifies the base for parent irq
8262306a36Sopenharmony_ci        - description: |
8362306a36Sopenharmony_ci            "limit" specifies the limit for translation
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_cirequired:
8662306a36Sopenharmony_ci  - compatible
8762306a36Sopenharmony_ci  - ti,intr-trigger-type
8862306a36Sopenharmony_ci  - interrupt-controller
8962306a36Sopenharmony_ci  - '#interrupt-cells'
9062306a36Sopenharmony_ci  - ti,sci
9162306a36Sopenharmony_ci  - ti,sci-dev-id
9262306a36Sopenharmony_ci  - ti,interrupt-ranges
9362306a36Sopenharmony_ci
9462306a36Sopenharmony_ciunevaluatedProperties: false
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ciexamples:
9762306a36Sopenharmony_ci  - |
9862306a36Sopenharmony_ci    main_gpio_intr: interrupt-controller0 {
9962306a36Sopenharmony_ci        compatible = "ti,sci-intr";
10062306a36Sopenharmony_ci        ti,intr-trigger-type = <1>;
10162306a36Sopenharmony_ci        interrupt-controller;
10262306a36Sopenharmony_ci        interrupt-parent = <&gic500>;
10362306a36Sopenharmony_ci        #interrupt-cells = <1>;
10462306a36Sopenharmony_ci        ti,sci = <&dmsc>;
10562306a36Sopenharmony_ci        ti,sci-dev-id = <131>;
10662306a36Sopenharmony_ci        ti,interrupt-ranges = <0 360 32>;
10762306a36Sopenharmony_ci    };
108