interrupts.txt 3.4 KB

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