nvidia,tegra-timer.yaml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/timer/nvidia,tegra-timer.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: NVIDIA Tegra timer
  7. maintainers:
  8. - Stephen Warren <swarren@nvidia.com>
  9. allOf:
  10. - if:
  11. properties:
  12. compatible:
  13. contains:
  14. const: nvidia,tegra210-timer
  15. then:
  16. properties:
  17. interrupts:
  18. # Either a single combined interrupt or up to 14 individual interrupts
  19. minItems: 1
  20. maxItems: 14
  21. description: >
  22. A list of 14 interrupts; one per each timer channels 0 through 13
  23. - if:
  24. properties:
  25. compatible:
  26. oneOf:
  27. - items:
  28. - enum:
  29. - nvidia,tegra114-timer
  30. - nvidia,tegra124-timer
  31. - nvidia,tegra132-timer
  32. - const: nvidia,tegra30-timer
  33. - items:
  34. - const: nvidia,tegra30-timer
  35. - const: nvidia,tegra20-timer
  36. then:
  37. properties:
  38. interrupts:
  39. # Either a single combined interrupt or up to 6 individual interrupts
  40. minItems: 1
  41. maxItems: 6
  42. description: >
  43. A list of 6 interrupts; one per each of timer channels 1 through 5,
  44. and one for the shared interrupt for the remaining channels.
  45. - if:
  46. properties:
  47. compatible:
  48. const: nvidia,tegra20-timer
  49. then:
  50. properties:
  51. interrupts:
  52. # Either a single combined interrupt or up to 4 individual interrupts
  53. minItems: 1
  54. maxItems: 4
  55. description: |
  56. A list of 4 interrupts; one per timer channel.
  57. properties:
  58. compatible:
  59. oneOf:
  60. - const: nvidia,tegra210-timer
  61. description: >
  62. The Tegra210 timer provides fourteen 29-bit timer counters and one 32-bit
  63. timestamp counter. The TMRs run at either a fixed 1 MHz clock rate derived
  64. from the oscillator clock (TMR0-TMR9) or directly at the oscillator clock
  65. (TMR10-TMR13). Each TMR can be programmed to generate one-shot, periodic,
  66. or watchdog interrupts.
  67. - items:
  68. - enum:
  69. - nvidia,tegra114-timer
  70. - nvidia,tegra124-timer
  71. - nvidia,tegra132-timer
  72. - const: nvidia,tegra30-timer
  73. - items:
  74. - const: nvidia,tegra30-timer
  75. - const: nvidia,tegra20-timer
  76. description: >
  77. The Tegra30 timer provides ten 29-bit timer channels, a single 32-bit free
  78. running counter, and 5 watchdog modules. The first two channels may also
  79. trigger a legacy watchdog reset.
  80. - const: nvidia,tegra20-timer
  81. description: >
  82. The Tegra20 timer provides four 29-bit timer channels and a single 32-bit free
  83. running counter. The first two channels may also trigger a watchdog reset.
  84. reg:
  85. maxItems: 1
  86. interrupts: true
  87. clocks:
  88. maxItems: 1
  89. clock-names:
  90. items:
  91. - const: timer
  92. required:
  93. - compatible
  94. - reg
  95. - interrupts
  96. - clocks
  97. additionalProperties: false
  98. examples:
  99. - |
  100. #include <dt-bindings/interrupt-controller/irq.h>
  101. timer@60005000 {
  102. compatible = "nvidia,tegra30-timer", "nvidia,tegra20-timer";
  103. reg = <0x60005000 0x400>;
  104. interrupts = <0 0 IRQ_TYPE_LEVEL_HIGH>,
  105. <0 1 IRQ_TYPE_LEVEL_HIGH>,
  106. <0 41 IRQ_TYPE_LEVEL_HIGH>,
  107. <0 42 IRQ_TYPE_LEVEL_HIGH>,
  108. <0 121 IRQ_TYPE_LEVEL_HIGH>,
  109. <0 122 IRQ_TYPE_LEVEL_HIGH>;
  110. clocks = <&tegra_car 214>;
  111. };
  112. - |
  113. #include <dt-bindings/clock/tegra210-car.h>
  114. #include <dt-bindings/interrupt-controller/arm-gic.h>
  115. #include <dt-bindings/interrupt-controller/irq.h>
  116. timer@60005000 {
  117. compatible = "nvidia,tegra210-timer";
  118. reg = <0x60005000 0x400>;
  119. interrupts = <GIC_SPI 156 IRQ_TYPE_LEVEL_HIGH>,
  120. <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
  121. <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
  122. <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
  123. <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>,
  124. <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
  125. <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>,
  126. <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>,
  127. <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>,
  128. <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>,
  129. <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH>,
  130. <GIC_SPI 177 IRQ_TYPE_LEVEL_HIGH>,
  131. <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH>,
  132. <GIC_SPI 179 IRQ_TYPE_LEVEL_HIGH>;
  133. clocks = <&tegra_car TEGRA210_CLK_TIMER>;
  134. clock-names = "timer";
  135. };