18c2ecf20Sopenharmony_ciSpecifying interrupt information for devices 28c2ecf20Sopenharmony_ci============================================ 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci1) Interrupt client nodes 58c2ecf20Sopenharmony_ci------------------------- 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ciNodes that describe devices which generate interrupts must contain an 88c2ecf20Sopenharmony_ci"interrupts" property, an "interrupts-extended" property, or both. If both are 98c2ecf20Sopenharmony_cipresent, the latter should take precedence; the former may be provided simply 108c2ecf20Sopenharmony_cifor compatibility with software that does not recognize the latter. These 118c2ecf20Sopenharmony_ciproperties contain a list of interrupt specifiers, one per output interrupt. The 128c2ecf20Sopenharmony_ciformat of the interrupt specifier is determined by the interrupt controller to 138c2ecf20Sopenharmony_ciwhich the interrupts are routed; see section 2 below for details. 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci Example: 168c2ecf20Sopenharmony_ci interrupt-parent = <&intc1>; 178c2ecf20Sopenharmony_ci interrupts = <5 0>, <6 0>; 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ciThe "interrupt-parent" property is used to specify the controller to which 208c2ecf20Sopenharmony_ciinterrupts are routed and contains a single phandle referring to the interrupt 218c2ecf20Sopenharmony_cicontroller node. This property is inherited, so it may be specified in an 228c2ecf20Sopenharmony_ciinterrupt client node or in any of its parent nodes. Interrupts listed in the 238c2ecf20Sopenharmony_ci"interrupts" property are always in reference to the node's interrupt parent. 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ciThe "interrupts-extended" property is a special form; useful when a node needs 268c2ecf20Sopenharmony_cito reference multiple interrupt parents or a different interrupt parent than 278c2ecf20Sopenharmony_cithe inherited one. Each entry in this property contains both the parent phandle 288c2ecf20Sopenharmony_ciand the interrupt specifier. 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci Example: 318c2ecf20Sopenharmony_ci interrupts-extended = <&intc1 5 1>, <&intc2 1 0>; 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci2) Interrupt controller nodes 348c2ecf20Sopenharmony_ci----------------------------- 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ciA device is marked as an interrupt controller with the "interrupt-controller" 378c2ecf20Sopenharmony_ciproperty. This is a empty, boolean property. An additional "#interrupt-cells" 388c2ecf20Sopenharmony_ciproperty defines the number of cells needed to specify a single interrupt. 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ciIt is the responsibility of the interrupt controller's binding to define the 418c2ecf20Sopenharmony_cilength and format of the interrupt specifier. The following two variants are 428c2ecf20Sopenharmony_cicommonly used: 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci a) one cell 458c2ecf20Sopenharmony_ci ----------- 468c2ecf20Sopenharmony_ci The #interrupt-cells property is set to 1 and the single cell defines the 478c2ecf20Sopenharmony_ci index of the interrupt within the controller. 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci Example: 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ci vic: intc@10140000 { 528c2ecf20Sopenharmony_ci compatible = "arm,versatile-vic"; 538c2ecf20Sopenharmony_ci interrupt-controller; 548c2ecf20Sopenharmony_ci #interrupt-cells = <1>; 558c2ecf20Sopenharmony_ci reg = <0x10140000 0x1000>; 568c2ecf20Sopenharmony_ci }; 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci sic: intc@10003000 { 598c2ecf20Sopenharmony_ci compatible = "arm,versatile-sic"; 608c2ecf20Sopenharmony_ci interrupt-controller; 618c2ecf20Sopenharmony_ci #interrupt-cells = <1>; 628c2ecf20Sopenharmony_ci reg = <0x10003000 0x1000>; 638c2ecf20Sopenharmony_ci interrupt-parent = <&vic>; 648c2ecf20Sopenharmony_ci interrupts = <31>; /* Cascaded to vic */ 658c2ecf20Sopenharmony_ci }; 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci b) two cells 688c2ecf20Sopenharmony_ci ------------ 698c2ecf20Sopenharmony_ci The #interrupt-cells property is set to 2 and the first cell defines the 708c2ecf20Sopenharmony_ci index of the interrupt within the controller, while the second cell is used 718c2ecf20Sopenharmony_ci to specify any of the following flags: 728c2ecf20Sopenharmony_ci - bits[3:0] trigger type and level flags 738c2ecf20Sopenharmony_ci 1 = low-to-high edge triggered 748c2ecf20Sopenharmony_ci 2 = high-to-low edge triggered 758c2ecf20Sopenharmony_ci 4 = active high level-sensitive 768c2ecf20Sopenharmony_ci 8 = active low level-sensitive 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_ci Example: 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci i2c@7000c000 { 818c2ecf20Sopenharmony_ci gpioext: gpio-adnp@41 { 828c2ecf20Sopenharmony_ci compatible = "ad,gpio-adnp"; 838c2ecf20Sopenharmony_ci reg = <0x41>; 848c2ecf20Sopenharmony_ci 858c2ecf20Sopenharmony_ci interrupt-parent = <&gpio>; 868c2ecf20Sopenharmony_ci interrupts = <160 1>; 878c2ecf20Sopenharmony_ci 888c2ecf20Sopenharmony_ci gpio-controller; 898c2ecf20Sopenharmony_ci #gpio-cells = <1>; 908c2ecf20Sopenharmony_ci 918c2ecf20Sopenharmony_ci interrupt-controller; 928c2ecf20Sopenharmony_ci #interrupt-cells = <2>; 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_ci nr-gpios = <64>; 958c2ecf20Sopenharmony_ci }; 968c2ecf20Sopenharmony_ci 978c2ecf20Sopenharmony_ci sx8634@2b { 988c2ecf20Sopenharmony_ci compatible = "smtc,sx8634"; 998c2ecf20Sopenharmony_ci reg = <0x2b>; 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ci interrupt-parent = <&gpioext>; 1028c2ecf20Sopenharmony_ci interrupts = <3 0x8>; 1038c2ecf20Sopenharmony_ci 1048c2ecf20Sopenharmony_ci #address-cells = <1>; 1058c2ecf20Sopenharmony_ci #size-cells = <0>; 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_ci threshold = <0x40>; 1088c2ecf20Sopenharmony_ci sensitivity = <7>; 1098c2ecf20Sopenharmony_ci }; 1108c2ecf20Sopenharmony_ci }; 1118c2ecf20Sopenharmony_ci 1128c2ecf20Sopenharmony_ci3) Interrupt wakeup parent 1138c2ecf20Sopenharmony_ci-------------------------- 1148c2ecf20Sopenharmony_ci 1158c2ecf20Sopenharmony_ciSome interrupt controllers in a SoC, are always powered on and have a select 1168c2ecf20Sopenharmony_ciinterrupts routed to them, so that they can wakeup the SoC from suspend. These 1178c2ecf20Sopenharmony_ciinterrupt controllers do not fall into the category of a parent interrupt 1188c2ecf20Sopenharmony_cicontroller and can be specified by the "wakeup-parent" property and contain a 1198c2ecf20Sopenharmony_cisingle phandle referring to the wakeup capable interrupt controller. 1208c2ecf20Sopenharmony_ci 1218c2ecf20Sopenharmony_ci Example: 1228c2ecf20Sopenharmony_ci wakeup-parent = <&pdc_intc>; 123