1*c66ec88fSEmmanuel VadotTexas Instruments K3 Interrupt Router 2*c66ec88fSEmmanuel Vadot===================================== 3*c66ec88fSEmmanuel Vadot 4*c66ec88fSEmmanuel VadotThe Interrupt Router (INTR) module provides a mechanism to mux M 5*c66ec88fSEmmanuel Vadotinterrupt inputs to N interrupt outputs, where all M inputs are selectable 6*c66ec88fSEmmanuel Vadotto be driven per N output. An Interrupt Router can either handle edge triggered 7*c66ec88fSEmmanuel Vadotor level triggered interrupts and that is fixed in hardware. 8*c66ec88fSEmmanuel Vadot 9*c66ec88fSEmmanuel Vadot Interrupt Router 10*c66ec88fSEmmanuel Vadot +----------------------+ 11*c66ec88fSEmmanuel Vadot | Inputs Outputs | 12*c66ec88fSEmmanuel Vadot +-------+ | +------+ +-----+ | 13*c66ec88fSEmmanuel Vadot | GPIO |----------->| | irq0 | | 0 | | Host IRQ 14*c66ec88fSEmmanuel Vadot +-------+ | +------+ +-----+ | controller 15*c66ec88fSEmmanuel Vadot | . . | +-------+ 16*c66ec88fSEmmanuel Vadot +-------+ | . . |----->| IRQ | 17*c66ec88fSEmmanuel Vadot | INTA |----------->| . . | +-------+ 18*c66ec88fSEmmanuel Vadot +-------+ | . +-----+ | 19*c66ec88fSEmmanuel Vadot | +------+ | N | | 20*c66ec88fSEmmanuel Vadot | | irqM | +-----+ | 21*c66ec88fSEmmanuel Vadot | +------+ | 22*c66ec88fSEmmanuel Vadot | | 23*c66ec88fSEmmanuel Vadot +----------------------+ 24*c66ec88fSEmmanuel Vadot 25*c66ec88fSEmmanuel VadotThere is one register per output (MUXCNTL_N) that controls the selection. 26*c66ec88fSEmmanuel VadotConfiguration of these MUXCNTL_N registers is done by a system controller 27*c66ec88fSEmmanuel Vadot(like the Device Memory and Security Controller on K3 AM654 SoC). System 28*c66ec88fSEmmanuel Vadotcontroller will keep track of the used and unused registers within the Router. 29*c66ec88fSEmmanuel VadotDriver should request the system controller to get the range of GIC IRQs 30*c66ec88fSEmmanuel Vadotassigned to the requesting hosts. It is the drivers responsibility to keep 31*c66ec88fSEmmanuel Vadottrack of Host IRQs. 32*c66ec88fSEmmanuel Vadot 33*c66ec88fSEmmanuel VadotCommunication between the host processor running an OS and the system 34*c66ec88fSEmmanuel Vadotcontroller happens through a protocol called TI System Control Interface 35*c66ec88fSEmmanuel Vadot(TISCI protocol). For more details refer: 36*c66ec88fSEmmanuel VadotDocumentation/devicetree/bindings/arm/keystone/ti,sci.txt 37*c66ec88fSEmmanuel Vadot 38*c66ec88fSEmmanuel VadotTISCI Interrupt Router Node: 39*c66ec88fSEmmanuel Vadot---------------------------- 40*c66ec88fSEmmanuel VadotRequired Properties: 41*c66ec88fSEmmanuel Vadot- compatible: Must be "ti,sci-intr". 42*c66ec88fSEmmanuel Vadot- ti,intr-trigger-type: Should be one of the following: 43*c66ec88fSEmmanuel Vadot 1: If intr supports edge triggered interrupts. 44*c66ec88fSEmmanuel Vadot 4: If intr supports level triggered interrupts. 45*c66ec88fSEmmanuel Vadot- interrupt-controller: Identifies the node as an interrupt controller 46*c66ec88fSEmmanuel Vadot- #interrupt-cells: Specifies the number of cells needed to encode an 47*c66ec88fSEmmanuel Vadot interrupt source. The value should be 2. 48*c66ec88fSEmmanuel Vadot First cell should contain the TISCI device ID of source 49*c66ec88fSEmmanuel Vadot Second cell should contain the interrupt source offset 50*c66ec88fSEmmanuel Vadot within the device. 51*c66ec88fSEmmanuel Vadot- ti,sci: Phandle to TI-SCI compatible System controller node. 52*c66ec88fSEmmanuel Vadot- ti,sci-dst-id: TISCI device ID of the destination IRQ controller. 53*c66ec88fSEmmanuel Vadot- ti,sci-rm-range-girq: Array of TISCI subtype ids representing the host irqs 54*c66ec88fSEmmanuel Vadot assigned to this interrupt router. Each subtype id 55*c66ec88fSEmmanuel Vadot corresponds to a range of host irqs. 56*c66ec88fSEmmanuel Vadot 57*c66ec88fSEmmanuel VadotFor more details on TISCI IRQ resource management refer: 58*c66ec88fSEmmanuel Vadothttp://downloads.ti.com/tisci/esd/latest/2_tisci_msgs/rm/rm_irq.html 59*c66ec88fSEmmanuel Vadot 60*c66ec88fSEmmanuel VadotExample: 61*c66ec88fSEmmanuel Vadot-------- 62*c66ec88fSEmmanuel VadotThe following example demonstrates both interrupt router node and the consumer 63*c66ec88fSEmmanuel Vadotnode(main gpio) on the AM654 SoC: 64*c66ec88fSEmmanuel Vadot 65*c66ec88fSEmmanuel Vadotmain_intr: interrupt-controller0 { 66*c66ec88fSEmmanuel Vadot compatible = "ti,sci-intr"; 67*c66ec88fSEmmanuel Vadot ti,intr-trigger-type = <1>; 68*c66ec88fSEmmanuel Vadot interrupt-controller; 69*c66ec88fSEmmanuel Vadot interrupt-parent = <&gic500>; 70*c66ec88fSEmmanuel Vadot #interrupt-cells = <2>; 71*c66ec88fSEmmanuel Vadot ti,sci = <&dmsc>; 72*c66ec88fSEmmanuel Vadot ti,sci-dst-id = <56>; 73*c66ec88fSEmmanuel Vadot ti,sci-rm-range-girq = <0x1>; 74*c66ec88fSEmmanuel Vadot}; 75*c66ec88fSEmmanuel Vadot 76*c66ec88fSEmmanuel Vadotmain_gpio0: gpio@600000 { 77*c66ec88fSEmmanuel Vadot ... 78*c66ec88fSEmmanuel Vadot interrupt-parent = <&main_intr>; 79*c66ec88fSEmmanuel Vadot interrupts = <57 256>, <57 257>, <57 258>, 80*c66ec88fSEmmanuel Vadot <57 259>, <57 260>, <57 261>; 81*c66ec88fSEmmanuel Vadot ... 82*c66ec88fSEmmanuel Vadot}; 83