interrupts.txt 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. Specifying interrupt information for devices
  2. ============================================
  3. 1) Interrupt client nodes
  4. -------------------------
  5. Nodes that describe devices which generate interrupts must contain an
  6. "interrupts" property, an "interrupts-extended" property, or both. If both are
  7. present, the latter should take precedence; the former may be provided simply
  8. for compatibility with software that does not recognize the latter. These
  9. properties contain a list of interrupt specifiers, one per output interrupt. The
  10. format of the interrupt specifier is determined by the interrupt controller to
  11. which the interrupts are routed; see section 2 below for details.
  12. Example:
  13. interrupt-parent = <&intc1>;
  14. interrupts = <5 0>, <6 0>;
  15. The "interrupt-parent" property is used to specify the controller to which
  16. interrupts are routed and contains a single phandle referring to the interrupt
  17. controller node. This property is inherited, so it may be specified in an
  18. interrupt client node or in any of its parent nodes. Interrupts listed in the
  19. "interrupts" property are always in reference to the node's interrupt parent.
  20. The "interrupts-extended" property is a special form for use when a node needs
  21. to reference multiple interrupt parents. Each entry in this property contains
  22. both the parent phandle and the interrupt specifier. "interrupts-extended"
  23. should only be used when a device has multiple interrupt parents.
  24. Example:
  25. interrupts-extended = <&intc1 5 1>, <&intc2 1 0>;
  26. 2) Interrupt controller nodes
  27. -----------------------------
  28. A device is marked as an interrupt controller with the "interrupt-controller"
  29. property. This is a empty, boolean property. An additional "#interrupt-cells"
  30. property defines the number of cells needed to specify a single interrupt.
  31. It is the responsibility of the interrupt controller's binding to define the
  32. length and format of the interrupt specifier. The following two variants are
  33. commonly used:
  34. a) one cell
  35. -----------
  36. The #interrupt-cells property is set to 1 and the single cell defines the
  37. index of the interrupt within the controller.
  38. Example:
  39. vic: intc@10140000 {
  40. compatible = "arm,versatile-vic";
  41. interrupt-controller;
  42. #interrupt-cells = <1>;
  43. reg = <0x10140000 0x1000>;
  44. };
  45. sic: intc@10003000 {
  46. compatible = "arm,versatile-sic";
  47. interrupt-controller;
  48. #interrupt-cells = <1>;
  49. reg = <0x10003000 0x1000>;
  50. interrupt-parent = <&vic>;
  51. interrupts = <31>; /* Cascaded to vic */
  52. };
  53. b) two cells
  54. ------------
  55. The #interrupt-cells property is set to 2 and the first cell defines the
  56. index of the interrupt within the controller, while the second cell is used
  57. to specify any of the following flags:
  58. - bits[3:0] trigger type and level flags
  59. 1 = low-to-high edge triggered
  60. 2 = high-to-low edge triggered
  61. 4 = active high level-sensitive
  62. 8 = active low level-sensitive
  63. Example:
  64. i2c@7000c000 {
  65. gpioext: gpio-adnp@41 {
  66. compatible = "ad,gpio-adnp";
  67. reg = <0x41>;
  68. interrupt-parent = <&gpio>;
  69. interrupts = <160 1>;
  70. gpio-controller;
  71. #gpio-cells = <1>;
  72. interrupt-controller;
  73. #interrupt-cells = <2>;
  74. nr-gpios = <64>;
  75. };
  76. sx8634@2b {
  77. compatible = "smtc,sx8634";
  78. reg = <0x2b>;
  79. interrupt-parent = <&gpioext>;
  80. interrupts = <3 0x8>;
  81. #address-cells = <1>;
  82. #size-cells = <0>;
  83. threshold = <0x40>;
  84. sensitivity = <7>;
  85. };
  86. };