nvidia,tegra20-i2c.yaml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/i2c/nvidia,tegra20-i2c.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. maintainers:
  7. - Thierry Reding <thierry.reding@gmail.com>
  8. - Jon Hunter <jonathanh@nvidia.com>
  9. title: NVIDIA Tegra I2C controller driver
  10. properties:
  11. compatible:
  12. oneOf:
  13. - description: Tegra20 has 4 generic I2C controller. This can support
  14. master and slave mode of I2C communication. The i2c-tegra driver
  15. only support master mode of I2C communication. Driver of I2C
  16. controller is only compatible with "nvidia,tegra20-i2c".
  17. const: nvidia,tegra20-i2c
  18. - description: Tegra20 has specific I2C controller called as DVC I2C
  19. controller. This only support master mode of I2C communication.
  20. Register interface/offset and interrupts handling are different than
  21. generic I2C controller. Driver of DVC I2C controller is only
  22. compatible with "nvidia,tegra20-i2c-dvc".
  23. const: nvidia,tegra20-i2c-dvc
  24. - description: |
  25. Tegra30 has 5 generic I2C controller. This controller is very much
  26. similar to Tegra20 I2C controller with additional feature: Continue
  27. Transfer Support. This feature helps to implement M_NO_START as per
  28. I2C core API transfer flags. Driver of I2C controller is compatible
  29. with "nvidia,tegra30-i2c" to enable the continue transfer support.
  30. This is also compatible with "nvidia,tegra20-i2c" without continue
  31. transfer support.
  32. items:
  33. - const: nvidia,tegra30-i2c
  34. - const: nvidia,tegra20-i2c
  35. - description: |
  36. Tegra114 has 5 generic I2C controllers. This controller is very much
  37. similar to Tegra30 I2C controller with some hardware modification:
  38. - Tegra30/Tegra20 I2C controller has 2 clock source called div-clk
  39. and fast-clk. Tegra114 has only one clock source called as
  40. div-clk and hence clock mechanism is changed in I2C controller.
  41. - Tegra30/Tegra20 I2C controller has enabled per packet transfer
  42. by default and there is no way to disable it. Tegra114 has this
  43. interrupt disable by default and SW need to enable explicitly.
  44. Due to above changes, Tegra114 I2C driver makes incompatible with
  45. previous hardware driver. Hence, Tegra114 I2C controller is
  46. compatible with "nvidia,tegra114-i2c".
  47. const: nvidia,tegra114-i2c
  48. - description: |
  49. Tegra124 has 6 generic I2C controllers. These controllers are very
  50. similar to those found on Tegra114 but also contain several hardware
  51. improvements and new registers.
  52. const: nvidia,tegra124-i2c
  53. - description: |
  54. Tegra210 has 6 generic I2C controllers. These controllers are very
  55. similar to those found on Tegra124.
  56. items:
  57. - const: nvidia,tegra210-i2c
  58. - const: nvidia,tegra124-i2c
  59. - description: |
  60. Tegra210 has one I2C controller that is on host1x bus and is part of
  61. the VE power domain and typically used for camera use-cases. This VI
  62. I2C controller is mostly compatible with the programming model of
  63. the regular I2C controllers with a few exceptions. The I2C registers
  64. start at an offset of 0xc00 (instead of 0), registers are 16 bytes
  65. apart (rather than 4) and the controller does not support slave
  66. mode.
  67. const: nvidia,tegra210-i2c-vi
  68. - description: |
  69. Tegra186 has 9 generic I2C controllers, two of which are in the AON
  70. (always-on) partition of the SoC. All of these controllers are very
  71. similar to those found on Tegra210.
  72. const: nvidia,tegra186-i2c
  73. - description: |
  74. Tegra194 has 8 generic I2C controllers, two of which are in the AON
  75. (always-on) partition of the SoC. All of these controllers are very
  76. similar to those found on Tegra186. However, these controllers have
  77. support for 64 KiB transactions whereas earlier chips supported no
  78. more than 4 KiB per transactions.
  79. const: nvidia,tegra194-i2c
  80. - description: |
  81. Tegra256 has 8 generic I2C controllers. The controllers are similar to
  82. the previous generations, but have a different parent clock and hence
  83. the timing parameters are configured differently.
  84. const: nvidia,tegra256-i2c
  85. - description:
  86. Tegra264 has 17 generic I2C controllers, two of which are in the AON
  87. (always-on) partition of the SoC. In addition to the features from
  88. Tegra194, a SW mutex register is added to support use of the same I2C
  89. instance across multiple firmwares.
  90. const: nvidia,tegra264-i2c
  91. reg:
  92. maxItems: 1
  93. interrupts:
  94. maxItems: 1
  95. clocks:
  96. minItems: 1
  97. maxItems: 2
  98. clock-names:
  99. minItems: 1
  100. maxItems: 2
  101. resets:
  102. items:
  103. - description:
  104. Module reset. This property is optional for controllers in Tegra194,
  105. Tegra234 etc where an internal software reset is available as an
  106. alternative.
  107. reset-names:
  108. items:
  109. - const: i2c
  110. power-domains:
  111. maxItems: 1
  112. dmas:
  113. items:
  114. - description: DMA channel for the reception FIFO
  115. - description: DMA channel for the transmission FIFO
  116. dma-names:
  117. items:
  118. - const: rx
  119. - const: tx
  120. required:
  121. - compatible
  122. - reg
  123. - interrupts
  124. - clocks
  125. - clock-names
  126. allOf:
  127. - $ref: /schemas/i2c/i2c-controller.yaml
  128. - if:
  129. properties:
  130. compatible:
  131. contains:
  132. enum:
  133. - nvidia,tegra20-i2c
  134. - nvidia,tegra30-i2c
  135. then:
  136. properties:
  137. clocks:
  138. minItems: 2
  139. clock-names:
  140. items:
  141. - const: div-clk
  142. - const: fast-clk
  143. - if:
  144. properties:
  145. compatible:
  146. contains:
  147. enum:
  148. - nvidia,tegra114-i2c
  149. - nvidia,tegra210-i2c
  150. then:
  151. properties:
  152. clocks:
  153. maxItems: 1
  154. clock-names:
  155. items:
  156. - const: div-clk
  157. - if:
  158. properties:
  159. compatible:
  160. contains:
  161. const: nvidia,tegra210-i2c-vi
  162. then:
  163. properties:
  164. clocks:
  165. minItems: 2
  166. clock-names:
  167. items:
  168. - const: div-clk
  169. - const: slow
  170. power-domains:
  171. items:
  172. - description: phandle to the VENC power domain
  173. else:
  174. properties:
  175. power-domains: false
  176. - if:
  177. not:
  178. properties:
  179. compatible:
  180. contains:
  181. enum:
  182. - nvidia,tegra194-i2c
  183. - nvidia,tegra256-i2c
  184. - nvidia,tegra264-i2c
  185. then:
  186. required:
  187. - resets
  188. - reset-names
  189. unevaluatedProperties: false
  190. examples:
  191. - |
  192. i2c@7000c000 {
  193. compatible = "nvidia,tegra20-i2c";
  194. reg = <0x7000c000 0x100>;
  195. interrupts = <0 38 0x04>;
  196. clocks = <&tegra_car 12>, <&tegra_car 124>;
  197. clock-names = "div-clk", "fast-clk";
  198. resets = <&tegra_car 12>;
  199. reset-names = "i2c";
  200. dmas = <&apbdma 16>, <&apbdma 16>;
  201. dma-names = "rx", "tx";
  202. #address-cells = <1>;
  203. #size-cells = <0>;
  204. };