162306a36Sopenharmony_ciSpecifying interrupt information for devices 262306a36Sopenharmony_ci============================================ 362306a36Sopenharmony_ci 462306a36Sopenharmony_ci1) Interrupt client nodes 562306a36Sopenharmony_ci------------------------- 662306a36Sopenharmony_ci 762306a36Sopenharmony_ciNodes that describe devices which generate interrupts must contain an 862306a36Sopenharmony_ci"interrupts" property, an "interrupts-extended" property, or both. If both are 962306a36Sopenharmony_cipresent, the latter should take precedence; the former may be provided simply 1062306a36Sopenharmony_cifor compatibility with software that does not recognize the latter. These 1162306a36Sopenharmony_ciproperties contain a list of interrupt specifiers, one per output interrupt. The 1262306a36Sopenharmony_ciformat of the interrupt specifier is determined by the interrupt controller to 1362306a36Sopenharmony_ciwhich the interrupts are routed; see section 2 below for details. 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ci Example: 1662306a36Sopenharmony_ci interrupt-parent = <&intc1>; 1762306a36Sopenharmony_ci interrupts = <5 0>, <6 0>; 1862306a36Sopenharmony_ci 1962306a36Sopenharmony_ciThe "interrupt-parent" property is used to specify the controller to which 2062306a36Sopenharmony_ciinterrupts are routed and contains a single phandle referring to the interrupt 2162306a36Sopenharmony_cicontroller node. This property is inherited, so it may be specified in an 2262306a36Sopenharmony_ciinterrupt client node or in any of its parent nodes. Interrupts listed in the 2362306a36Sopenharmony_ci"interrupts" property are always in reference to the node's interrupt parent. 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ciThe "interrupts-extended" property is a special form; useful when a node needs 2662306a36Sopenharmony_cito reference multiple interrupt parents or a different interrupt parent than 2762306a36Sopenharmony_cithe inherited one. Each entry in this property contains both the parent phandle 2862306a36Sopenharmony_ciand the interrupt specifier. 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci Example: 3162306a36Sopenharmony_ci interrupts-extended = <&intc1 5 1>, <&intc2 1 0>; 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci2) Interrupt controller nodes 3462306a36Sopenharmony_ci----------------------------- 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ciA device is marked as an interrupt controller with the "interrupt-controller" 3762306a36Sopenharmony_ciproperty. This is a empty, boolean property. An additional "#interrupt-cells" 3862306a36Sopenharmony_ciproperty defines the number of cells needed to specify a single interrupt. 3962306a36Sopenharmony_ci 4062306a36Sopenharmony_ciIt is the responsibility of the interrupt controller's binding to define the 4162306a36Sopenharmony_cilength and format of the interrupt specifier. The following two variants are 4262306a36Sopenharmony_cicommonly used: 4362306a36Sopenharmony_ci 4462306a36Sopenharmony_ci a) one cell 4562306a36Sopenharmony_ci ----------- 4662306a36Sopenharmony_ci The #interrupt-cells property is set to 1 and the single cell defines the 4762306a36Sopenharmony_ci index of the interrupt within the controller. 4862306a36Sopenharmony_ci 4962306a36Sopenharmony_ci Example: 5062306a36Sopenharmony_ci 5162306a36Sopenharmony_ci vic: intc@10140000 { 5262306a36Sopenharmony_ci compatible = "arm,versatile-vic"; 5362306a36Sopenharmony_ci interrupt-controller; 5462306a36Sopenharmony_ci #interrupt-cells = <1>; 5562306a36Sopenharmony_ci reg = <0x10140000 0x1000>; 5662306a36Sopenharmony_ci }; 5762306a36Sopenharmony_ci 5862306a36Sopenharmony_ci sic: intc@10003000 { 5962306a36Sopenharmony_ci compatible = "arm,versatile-sic"; 6062306a36Sopenharmony_ci interrupt-controller; 6162306a36Sopenharmony_ci #interrupt-cells = <1>; 6262306a36Sopenharmony_ci reg = <0x10003000 0x1000>; 6362306a36Sopenharmony_ci interrupt-parent = <&vic>; 6462306a36Sopenharmony_ci interrupts = <31>; /* Cascaded to vic */ 6562306a36Sopenharmony_ci }; 6662306a36Sopenharmony_ci 6762306a36Sopenharmony_ci b) two cells 6862306a36Sopenharmony_ci ------------ 6962306a36Sopenharmony_ci The #interrupt-cells property is set to 2 and the first cell defines the 7062306a36Sopenharmony_ci index of the interrupt within the controller, while the second cell is used 7162306a36Sopenharmony_ci to specify any of the following flags: 7262306a36Sopenharmony_ci - bits[3:0] trigger type and level flags 7362306a36Sopenharmony_ci 1 = low-to-high edge triggered 7462306a36Sopenharmony_ci 2 = high-to-low edge triggered 7562306a36Sopenharmony_ci 4 = active high level-sensitive 7662306a36Sopenharmony_ci 8 = active low level-sensitive 7762306a36Sopenharmony_ci 7862306a36Sopenharmony_ci Example: 7962306a36Sopenharmony_ci 8062306a36Sopenharmony_ci i2c@7000c000 { 8162306a36Sopenharmony_ci gpioext: gpio-adnp@41 { 8262306a36Sopenharmony_ci compatible = "ad,gpio-adnp"; 8362306a36Sopenharmony_ci reg = <0x41>; 8462306a36Sopenharmony_ci 8562306a36Sopenharmony_ci interrupt-parent = <&gpio>; 8662306a36Sopenharmony_ci interrupts = <160 1>; 8762306a36Sopenharmony_ci 8862306a36Sopenharmony_ci gpio-controller; 8962306a36Sopenharmony_ci #gpio-cells = <1>; 9062306a36Sopenharmony_ci 9162306a36Sopenharmony_ci interrupt-controller; 9262306a36Sopenharmony_ci #interrupt-cells = <2>; 9362306a36Sopenharmony_ci 9462306a36Sopenharmony_ci nr-gpios = <64>; 9562306a36Sopenharmony_ci }; 9662306a36Sopenharmony_ci 9762306a36Sopenharmony_ci sx8634@2b { 9862306a36Sopenharmony_ci compatible = "smtc,sx8634"; 9962306a36Sopenharmony_ci reg = <0x2b>; 10062306a36Sopenharmony_ci 10162306a36Sopenharmony_ci interrupt-parent = <&gpioext>; 10262306a36Sopenharmony_ci interrupts = <3 0x8>; 10362306a36Sopenharmony_ci 10462306a36Sopenharmony_ci #address-cells = <1>; 10562306a36Sopenharmony_ci #size-cells = <0>; 10662306a36Sopenharmony_ci 10762306a36Sopenharmony_ci threshold = <0x40>; 10862306a36Sopenharmony_ci sensitivity = <7>; 10962306a36Sopenharmony_ci }; 11062306a36Sopenharmony_ci }; 11162306a36Sopenharmony_ci 11262306a36Sopenharmony_ci3) Interrupt wakeup parent 11362306a36Sopenharmony_ci-------------------------- 11462306a36Sopenharmony_ci 11562306a36Sopenharmony_ciSome interrupt controllers in a SoC, are always powered on and have a select 11662306a36Sopenharmony_ciinterrupts routed to them, so that they can wakeup the SoC from suspend. These 11762306a36Sopenharmony_ciinterrupt controllers do not fall into the category of a parent interrupt 11862306a36Sopenharmony_cicontroller and can be specified by the "wakeup-parent" property and contain a 11962306a36Sopenharmony_cisingle phandle referring to the wakeup capable interrupt controller. 12062306a36Sopenharmony_ci 12162306a36Sopenharmony_ci Example: 12262306a36Sopenharmony_ci wakeup-parent = <&pdc_intc>; 123