1*c66ec88fSEmmanuel VadotSpecifying interrupt information for devices 2*c66ec88fSEmmanuel Vadot============================================ 3*c66ec88fSEmmanuel Vadot 4*c66ec88fSEmmanuel Vadot1) Interrupt client nodes 5*c66ec88fSEmmanuel Vadot------------------------- 6*c66ec88fSEmmanuel Vadot 7*c66ec88fSEmmanuel VadotNodes that describe devices which generate interrupts must contain an 8*c66ec88fSEmmanuel Vadot"interrupts" property, an "interrupts-extended" property, or both. If both are 9*c66ec88fSEmmanuel Vadotpresent, the latter should take precedence; the former may be provided simply 10*c66ec88fSEmmanuel Vadotfor compatibility with software that does not recognize the latter. These 11*c66ec88fSEmmanuel Vadotproperties contain a list of interrupt specifiers, one per output interrupt. The 12*c66ec88fSEmmanuel Vadotformat of the interrupt specifier is determined by the interrupt controller to 13*c66ec88fSEmmanuel Vadotwhich the interrupts are routed; see section 2 below for details. 14*c66ec88fSEmmanuel Vadot 15*c66ec88fSEmmanuel Vadot Example: 16*c66ec88fSEmmanuel Vadot interrupt-parent = <&intc1>; 17*c66ec88fSEmmanuel Vadot interrupts = <5 0>, <6 0>; 18*c66ec88fSEmmanuel Vadot 19*c66ec88fSEmmanuel VadotThe "interrupt-parent" property is used to specify the controller to which 20*c66ec88fSEmmanuel Vadotinterrupts are routed and contains a single phandle referring to the interrupt 21*c66ec88fSEmmanuel Vadotcontroller node. This property is inherited, so it may be specified in an 22*c66ec88fSEmmanuel Vadotinterrupt client node or in any of its parent nodes. Interrupts listed in the 23*c66ec88fSEmmanuel Vadot"interrupts" property are always in reference to the node's interrupt parent. 24*c66ec88fSEmmanuel Vadot 25*c66ec88fSEmmanuel VadotThe "interrupts-extended" property is a special form; useful when a node needs 26*c66ec88fSEmmanuel Vadotto reference multiple interrupt parents or a different interrupt parent than 27*c66ec88fSEmmanuel Vadotthe inherited one. Each entry in this property contains both the parent phandle 28*c66ec88fSEmmanuel Vadotand the interrupt specifier. 29*c66ec88fSEmmanuel Vadot 30*c66ec88fSEmmanuel Vadot Example: 31*c66ec88fSEmmanuel Vadot interrupts-extended = <&intc1 5 1>, <&intc2 1 0>; 32*c66ec88fSEmmanuel Vadot 33*c66ec88fSEmmanuel Vadot2) Interrupt controller nodes 34*c66ec88fSEmmanuel Vadot----------------------------- 35*c66ec88fSEmmanuel Vadot 36*c66ec88fSEmmanuel VadotA device is marked as an interrupt controller with the "interrupt-controller" 37*c66ec88fSEmmanuel Vadotproperty. This is a empty, boolean property. An additional "#interrupt-cells" 38*c66ec88fSEmmanuel Vadotproperty defines the number of cells needed to specify a single interrupt. 39*c66ec88fSEmmanuel Vadot 40*c66ec88fSEmmanuel VadotIt is the responsibility of the interrupt controller's binding to define the 41*c66ec88fSEmmanuel Vadotlength and format of the interrupt specifier. The following two variants are 42*c66ec88fSEmmanuel Vadotcommonly used: 43*c66ec88fSEmmanuel Vadot 44*c66ec88fSEmmanuel Vadot a) one cell 45*c66ec88fSEmmanuel Vadot ----------- 46*c66ec88fSEmmanuel Vadot The #interrupt-cells property is set to 1 and the single cell defines the 47*c66ec88fSEmmanuel Vadot index of the interrupt within the controller. 48*c66ec88fSEmmanuel Vadot 49*c66ec88fSEmmanuel Vadot Example: 50*c66ec88fSEmmanuel Vadot 51*c66ec88fSEmmanuel Vadot vic: intc@10140000 { 52*c66ec88fSEmmanuel Vadot compatible = "arm,versatile-vic"; 53*c66ec88fSEmmanuel Vadot interrupt-controller; 54*c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 55*c66ec88fSEmmanuel Vadot reg = <0x10140000 0x1000>; 56*c66ec88fSEmmanuel Vadot }; 57*c66ec88fSEmmanuel Vadot 58*c66ec88fSEmmanuel Vadot sic: intc@10003000 { 59*c66ec88fSEmmanuel Vadot compatible = "arm,versatile-sic"; 60*c66ec88fSEmmanuel Vadot interrupt-controller; 61*c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 62*c66ec88fSEmmanuel Vadot reg = <0x10003000 0x1000>; 63*c66ec88fSEmmanuel Vadot interrupt-parent = <&vic>; 64*c66ec88fSEmmanuel Vadot interrupts = <31>; /* Cascaded to vic */ 65*c66ec88fSEmmanuel Vadot }; 66*c66ec88fSEmmanuel Vadot 67*c66ec88fSEmmanuel Vadot b) two cells 68*c66ec88fSEmmanuel Vadot ------------ 69*c66ec88fSEmmanuel Vadot The #interrupt-cells property is set to 2 and the first cell defines the 70*c66ec88fSEmmanuel Vadot index of the interrupt within the controller, while the second cell is used 71*c66ec88fSEmmanuel Vadot to specify any of the following flags: 72*c66ec88fSEmmanuel Vadot - bits[3:0] trigger type and level flags 73*c66ec88fSEmmanuel Vadot 1 = low-to-high edge triggered 74*c66ec88fSEmmanuel Vadot 2 = high-to-low edge triggered 75*c66ec88fSEmmanuel Vadot 4 = active high level-sensitive 76*c66ec88fSEmmanuel Vadot 8 = active low level-sensitive 77*c66ec88fSEmmanuel Vadot 78*c66ec88fSEmmanuel Vadot Example: 79*c66ec88fSEmmanuel Vadot 80*c66ec88fSEmmanuel Vadot i2c@7000c000 { 81*c66ec88fSEmmanuel Vadot gpioext: gpio-adnp@41 { 82*c66ec88fSEmmanuel Vadot compatible = "ad,gpio-adnp"; 83*c66ec88fSEmmanuel Vadot reg = <0x41>; 84*c66ec88fSEmmanuel Vadot 85*c66ec88fSEmmanuel Vadot interrupt-parent = <&gpio>; 86*c66ec88fSEmmanuel Vadot interrupts = <160 1>; 87*c66ec88fSEmmanuel Vadot 88*c66ec88fSEmmanuel Vadot gpio-controller; 89*c66ec88fSEmmanuel Vadot #gpio-cells = <1>; 90*c66ec88fSEmmanuel Vadot 91*c66ec88fSEmmanuel Vadot interrupt-controller; 92*c66ec88fSEmmanuel Vadot #interrupt-cells = <2>; 93*c66ec88fSEmmanuel Vadot 94*c66ec88fSEmmanuel Vadot nr-gpios = <64>; 95*c66ec88fSEmmanuel Vadot }; 96*c66ec88fSEmmanuel Vadot 97*c66ec88fSEmmanuel Vadot sx8634@2b { 98*c66ec88fSEmmanuel Vadot compatible = "smtc,sx8634"; 99*c66ec88fSEmmanuel Vadot reg = <0x2b>; 100*c66ec88fSEmmanuel Vadot 101*c66ec88fSEmmanuel Vadot interrupt-parent = <&gpioext>; 102*c66ec88fSEmmanuel Vadot interrupts = <3 0x8>; 103*c66ec88fSEmmanuel Vadot 104*c66ec88fSEmmanuel Vadot #address-cells = <1>; 105*c66ec88fSEmmanuel Vadot #size-cells = <0>; 106*c66ec88fSEmmanuel Vadot 107*c66ec88fSEmmanuel Vadot threshold = <0x40>; 108*c66ec88fSEmmanuel Vadot sensitivity = <7>; 109*c66ec88fSEmmanuel Vadot }; 110*c66ec88fSEmmanuel Vadot }; 111*c66ec88fSEmmanuel Vadot 112*c66ec88fSEmmanuel Vadot3) Interrupt wakeup parent 113*c66ec88fSEmmanuel Vadot-------------------------- 114*c66ec88fSEmmanuel Vadot 115*c66ec88fSEmmanuel VadotSome interrupt controllers in a SoC, are always powered on and have a select 116*c66ec88fSEmmanuel Vadotinterrupts routed to them, so that they can wakeup the SoC from suspend. These 117*c66ec88fSEmmanuel Vadotinterrupt controllers do not fall into the category of a parent interrupt 118*c66ec88fSEmmanuel Vadotcontroller and can be specified by the "wakeup-parent" property and contain a 119*c66ec88fSEmmanuel Vadotsingle phandle referring to the wakeup capable interrupt controller. 120*c66ec88fSEmmanuel Vadot 121*c66ec88fSEmmanuel Vadot Example: 122*c66ec88fSEmmanuel Vadot wakeup-parent = <&pdc_intc>; 123