interrupts.txt 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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; useful when a node needs
  21. to reference multiple interrupt parents or a different interrupt parent than
  22. the inherited one. Each entry in this property contains both the parent phandle
  23. and the interrupt specifier.
  24. Example:
  25. interrupts-extended = <&intc1 5 1>, <&intc2 1 0>;
  26. (NOTE: only this 'special form' is supported in U-Boot)
  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. };
  88. Example of special form (supported by U-Boot):
  89. acpi_gpe: general-purpose-events {
  90. reg = <IOMAP_ACPI_BASE IOMAP_ACPI_SIZE>;
  91. compatible = "intel,acpi-gpe";
  92. interrupt-controller;
  93. #interrupt-cells = <2>;
  94. };
  95. tpm@50 {
  96. reg = <0x50>;
  97. compatible = "google,cr50";
  98. u-boot,i2c-offset-len = <0>;
  99. ready-gpio = <&gpio_n 28 GPIO_ACTIVE_LOW>;
  100. interrupts-extended = <&acpi_gpe 0x3c 0>;
  101. };