opp-v2-base.yaml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/opp/opp-v2-base.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Generic OPP (Operating Performance Points) Common Properties
  7. maintainers:
  8. - Viresh Kumar <viresh.kumar@linaro.org>
  9. description: |
  10. Devices work at voltage-current-frequency combinations and some implementations
  11. have the liberty of choosing these. These combinations are called Operating
  12. Performance Points aka OPPs. This document defines bindings for these OPPs
  13. applicable across wide range of devices. For illustration purpose, this document
  14. uses CPU as a device.
  15. This describes the OPPs belonging to a device.
  16. select: false
  17. properties:
  18. $nodename:
  19. pattern: '^opp-table(-[a-z0-9]+)?$'
  20. opp-shared:
  21. description:
  22. Indicates that device nodes using this OPP Table Node's phandle switch
  23. their DVFS state together, i.e. they share clock/voltage/current lines.
  24. Missing property means devices have independent clock/voltage/current
  25. lines, but they share OPP tables.
  26. type: boolean
  27. patternProperties:
  28. '^opp(-?[0-9]+)*$':
  29. type: object
  30. description:
  31. One or more OPP nodes describing voltage-current-frequency combinations.
  32. Their name isn't significant but their phandle can be used to reference an
  33. OPP. These are mandatory except for the case where the OPP table is
  34. present only to indicate dependency between devices using the opp-shared
  35. property.
  36. properties:
  37. opp-hz:
  38. description:
  39. Frequency in Hz, expressed as a 64-bit big-endian integer. This is a
  40. required property for all device nodes, unless another "required"
  41. property to uniquely identify the OPP nodes exists. Devices like power
  42. domains must have another (implementation dependent) property.
  43. Entries for multiple clocks shall be provided in the same field, as
  44. array of frequencies. The OPP binding doesn't provide any provisions
  45. to relate the values to their clocks or the order in which the clocks
  46. need to be configured and that is left for the implementation
  47. specific binding.
  48. minItems: 1
  49. maxItems: 32
  50. opp-microvolt:
  51. description: |
  52. Voltage for the OPP
  53. A single regulator's voltage is specified with an array of size one or three.
  54. Single entry is for target voltage and three entries are for <target min max>
  55. voltages.
  56. Entries for multiple regulators shall be provided in the same field separated
  57. by angular brackets <>. The OPP binding doesn't provide any provisions to
  58. relate the values to their power supplies or the order in which the supplies
  59. need to be configured and that is left for the implementation specific
  60. binding.
  61. Entries for all regulators shall be of the same size, i.e. either all use a
  62. single value or triplets.
  63. minItems: 1
  64. maxItems: 8 # Should be enough regulators
  65. items:
  66. minItems: 1
  67. maxItems: 3
  68. opp-microamp:
  69. description: |
  70. The maximum current drawn by the device in microamperes considering
  71. system specific parameters (such as transients, process, aging,
  72. maximum operating temperature range etc.) as necessary. This may be
  73. used to set the most efficient regulator operating mode.
  74. Should only be set if opp-microvolt or opp-microvolt-<name> is set for
  75. the OPP.
  76. Entries for multiple regulators shall be provided in the same field
  77. separated by angular brackets <>. If current values aren't required
  78. for a regulator, then it shall be filled with 0. If current values
  79. aren't required for any of the regulators, then this field is not
  80. required. The OPP binding doesn't provide any provisions to relate the
  81. values to their power supplies or the order in which the supplies need
  82. to be configured and that is left for the implementation specific
  83. binding.
  84. minItems: 1
  85. maxItems: 8 # Should be enough regulators
  86. opp-microwatt:
  87. description: |
  88. The power for the OPP in micro-Watts.
  89. Entries for multiple regulators shall be provided in the same field
  90. separated by angular brackets <>. If power values aren't required
  91. for a regulator, then it shall be filled with 0. If power values
  92. aren't required for any of the regulators, then this field is not
  93. required. The OPP binding doesn't provide any provisions to relate the
  94. values to their power supplies or the order in which the supplies need
  95. to be configured and that is left for the implementation specific
  96. binding.
  97. minItems: 1
  98. maxItems: 8 # Should be enough regulators
  99. opp-level:
  100. description:
  101. A value representing the performance level of the device.
  102. $ref: /schemas/types.yaml#/definitions/uint32
  103. opp-peak-kBps:
  104. description:
  105. Peak bandwidth in kilobytes per second, expressed as an array of
  106. 32-bit big-endian integers. Each element of the array represents the
  107. peak bandwidth value of each interconnect path. The number of elements
  108. should match the number of interconnect paths.
  109. minItems: 1
  110. maxItems: 32 # Should be enough
  111. opp-avg-kBps:
  112. description:
  113. Average bandwidth in kilobytes per second, expressed as an array
  114. of 32-bit big-endian integers. Each element of the array represents the
  115. average bandwidth value of each interconnect path. The number of elements
  116. should match the number of interconnect paths. This property is only
  117. meaningful in OPP tables where opp-peak-kBps is present.
  118. minItems: 1
  119. maxItems: 32 # Should be enough
  120. clock-latency-ns:
  121. description:
  122. Specifies the maximum possible transition latency (in nanoseconds) for
  123. switching to this OPP from any other OPP.
  124. turbo-mode:
  125. description:
  126. Marks the OPP to be used only for turbo modes. Turbo mode is available
  127. on some platforms, where the device can run over its operating
  128. frequency for a short duration of time limited by the device's power,
  129. current and thermal limits.
  130. type: boolean
  131. opp-suspend:
  132. description:
  133. Marks the OPP to be used during device suspend. If multiple OPPs in
  134. the table have this, the OPP with highest opp-hz will be used.
  135. type: boolean
  136. opp-supported-hw:
  137. description: |
  138. This property allows a platform to enable only a subset of the OPPs
  139. from the larger set present in the OPP table, based on the current
  140. version of the hardware (already known to the operating system).
  141. Each block present in the array of blocks in this property, represents
  142. a sub-group of hardware versions supported by the OPP. i.e. <sub-group
  143. A>, <sub-group B>, etc. The OPP will be enabled if _any_ of these
  144. sub-groups match the hardware's version.
  145. Each sub-group is a platform defined array representing the hierarchy
  146. of hardware versions supported by the platform. For a platform with
  147. three hierarchical levels of version (X.Y.Z), this field shall look
  148. like
  149. opp-supported-hw = <X1 Y1 Z1>, <X2 Y2 Z2>, <X3 Y3 Z3>.
  150. Each level (eg. X1) in version hierarchy is represented by a 32 bit
  151. value, one bit per version and so there can be maximum 32 versions per
  152. level. Logical AND (&) operation is performed for each level with the
  153. hardware's level version and a non-zero output for _all_ the levels in
  154. a sub-group means the OPP is supported by hardware. A value of
  155. 0xFFFFFFFF for each level in the sub-group will enable the OPP for all
  156. versions for the hardware.
  157. $ref: /schemas/types.yaml#/definitions/uint32-matrix
  158. maxItems: 32
  159. items:
  160. minItems: 1
  161. maxItems: 4
  162. required-opps:
  163. description:
  164. This contains phandle to an OPP node in another device's OPP table. It
  165. may contain an array of phandles, where each phandle points to an OPP
  166. of a different device. It should not contain multiple phandles to the
  167. OPP nodes in the same OPP table. This specifies the minimum required
  168. OPP of the device(s), whose OPP's phandle is present in this property,
  169. for the functioning of the current device at the current OPP (where
  170. this property is present).
  171. $ref: /schemas/types.yaml#/definitions/phandle-array
  172. items:
  173. maxItems: 1
  174. patternProperties:
  175. '^opp-microvolt-':
  176. description:
  177. Named opp-microvolt property. This is exactly similar to the above
  178. opp-microvolt property, but allows multiple voltage ranges to be
  179. provided for the same OPP. At runtime, the platform can pick a <name>
  180. and matching opp-microvolt-<name> property will be enabled for all
  181. OPPs. If the platform doesn't pick a specific <name> or the <name>
  182. doesn't match with any opp-microvolt-<name> properties, then
  183. opp-microvolt property shall be used, if present.
  184. $ref: /schemas/types.yaml#/definitions/uint32-matrix
  185. minItems: 1
  186. maxItems: 8 # Should be enough regulators
  187. items:
  188. minItems: 1
  189. maxItems: 3
  190. '^opp-microamp-':
  191. description:
  192. Named opp-microamp property. Similar to opp-microvolt-<name> property,
  193. but for microamp instead.
  194. $ref: /schemas/types.yaml#/definitions/uint32-array
  195. minItems: 1
  196. maxItems: 8 # Should be enough regulators
  197. '^opp-microwatt-':
  198. description:
  199. Named opp-microwatt property. Similar to opp-microamp-<name> property,
  200. but for microwatt instead.
  201. $ref: /schemas/types.yaml#/definitions/uint32-array
  202. minItems: 1
  203. maxItems: 8 # Should be enough regulators
  204. dependencies:
  205. opp-avg-kBps: [ opp-peak-kBps ]
  206. required:
  207. - compatible
  208. additionalProperties: true
  209. ...