opp.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. Generic OPP (Operating Performance Points) Bindings
  2. ----------------------------------------------------
  3. Devices work at voltage-current-frequency combinations and some implementations
  4. have the liberty of choosing these. These combinations are called Operating
  5. Performance Points aka OPPs. This document defines bindings for these OPPs
  6. applicable across wide range of devices. For illustration purpose, this document
  7. uses CPU as a device.
  8. This document contain multiple versions of OPP binding and only one of them
  9. should be used per device.
  10. Binding 1: operating-points
  11. ============================
  12. This binding only supports voltage-frequency pairs.
  13. Properties:
  14. - operating-points: An array of 2-tuples items, and each item consists
  15. of frequency and voltage like <freq-kHz vol-uV>.
  16. freq: clock frequency in kHz
  17. vol: voltage in microvolt
  18. Examples:
  19. cpu@0 {
  20. compatible = "arm,cortex-a9";
  21. reg = <0>;
  22. next-level-cache = <&L2>;
  23. operating-points = <
  24. /* kHz uV */
  25. 792000 1100000
  26. 396000 950000
  27. 198000 850000
  28. >;
  29. };
  30. Binding 2: operating-points-v2
  31. ============================
  32. * Property: operating-points-v2
  33. Devices supporting OPPs must set their "operating-points-v2" property with
  34. phandle to a OPP table in their DT node. The OPP core will use this phandle to
  35. find the operating points for the device.
  36. Devices may want to choose OPP tables at runtime and so can provide a list of
  37. phandles here. But only *one* of them should be chosen at runtime. This must be
  38. accompanied by a corresponding "operating-points-names" property, to uniquely
  39. identify the OPP tables.
  40. If required, this can be extended for SoC vendor specfic bindings. Such bindings
  41. should be documented as Documentation/devicetree/bindings/power/<vendor>-opp.txt
  42. and should have a compatible description like: "operating-points-v2-<vendor>".
  43. Optional properties:
  44. - operating-points-names: Names of OPP tables (required if multiple OPP
  45. tables are present), to uniquely identify them. The same list must be present
  46. for all the CPUs which are sharing clock/voltage rails and hence the OPP
  47. tables.
  48. * OPP Table Node
  49. This describes the OPPs belonging to a device. This node can have following
  50. properties:
  51. Required properties:
  52. - compatible: Allow OPPs to express their compatibility. It should be:
  53. "operating-points-v2".
  54. - OPP nodes: One or more OPP nodes describing voltage-current-frequency
  55. combinations. Their name isn't significant but their phandle can be used to
  56. reference an OPP.
  57. Optional properties:
  58. - opp-shared: Indicates that device nodes using this OPP Table Node's phandle
  59. switch their DVFS state together, i.e. they share clock/voltage/current lines.
  60. Missing property means devices have independent clock/voltage/current lines,
  61. but they share OPP tables.
  62. - status: Marks the OPP table enabled/disabled.
  63. * OPP Node
  64. This defines voltage-current-frequency combinations along with other related
  65. properties.
  66. Required properties:
  67. - opp-hz: Frequency in Hz
  68. Optional properties:
  69. - opp-microvolt: voltage in micro Volts.
  70. A single regulator's voltage is specified with an array of size one or three.
  71. Single entry is for target voltage and three entries are for <target min max>
  72. voltages.
  73. Entries for multiple regulators must be present in the same order as
  74. regulators are specified in device's DT node.
  75. - opp-microamp: The maximum current drawn by the device in microamperes
  76. considering system specific parameters (such as transients, process, aging,
  77. maximum operating temperature range etc.) as necessary. This may be used to
  78. set the most efficient regulator operating mode.
  79. Should only be set if opp-microvolt is set for the OPP.
  80. Entries for multiple regulators must be present in the same order as
  81. regulators are specified in device's DT node. If this property isn't required
  82. for few regulators, then this should be marked as zero for them. If it isn't
  83. required for any regulator, then this property need not be present.
  84. - clock-latency-ns: Specifies the maximum possible transition latency (in
  85. nanoseconds) for switching to this OPP from any other OPP.
  86. - turbo-mode: Marks the OPP to be used only for turbo modes. Turbo mode is
  87. available on some platforms, where the device can run over its operating
  88. frequency for a short duration of time limited by the device's power, current
  89. and thermal limits.
  90. - opp-suspend: Marks the OPP to be used during device suspend. Only one OPP in
  91. the table should have this.
  92. - status: Marks the node enabled/disabled.
  93. Example 1: Single cluster Dual-core ARM cortex A9, switch DVFS states together.
  94. / {
  95. cpus {
  96. #address-cells = <1>;
  97. #size-cells = <0>;
  98. cpu@0 {
  99. compatible = "arm,cortex-a9";
  100. reg = <0>;
  101. next-level-cache = <&L2>;
  102. clocks = <&clk_controller 0>;
  103. clock-names = "cpu";
  104. cpu-supply = <&cpu_supply0>;
  105. operating-points-v2 = <&cpu0_opp_table>;
  106. };
  107. cpu@1 {
  108. compatible = "arm,cortex-a9";
  109. reg = <1>;
  110. next-level-cache = <&L2>;
  111. clocks = <&clk_controller 0>;
  112. clock-names = "cpu";
  113. cpu-supply = <&cpu_supply0>;
  114. operating-points-v2 = <&cpu0_opp_table>;
  115. };
  116. };
  117. cpu0_opp_table: opp_table0 {
  118. compatible = "operating-points-v2";
  119. opp-shared;
  120. opp00 {
  121. opp-hz = <1000000000>;
  122. opp-microvolt = <970000 975000 985000>;
  123. opp-microamp = <70000>;
  124. clock-latency-ns = <300000>;
  125. opp-suspend;
  126. };
  127. opp01 {
  128. opp-hz = <1100000000>;
  129. opp-microvolt = <980000 1000000 1010000>;
  130. opp-microamp = <80000>;
  131. clock-latency-ns = <310000>;
  132. };
  133. opp02 {
  134. opp-hz = <1200000000>;
  135. opp-microvolt = <1025000>;
  136. clock-latency-ns = <290000>;
  137. turbo-mode;
  138. };
  139. };
  140. };
  141. Example 2: Single cluster, Quad-core Qualcom-krait, switches DVFS states
  142. independently.
  143. / {
  144. cpus {
  145. #address-cells = <1>;
  146. #size-cells = <0>;
  147. cpu@0 {
  148. compatible = "qcom,krait";
  149. reg = <0>;
  150. next-level-cache = <&L2>;
  151. clocks = <&clk_controller 0>;
  152. clock-names = "cpu";
  153. cpu-supply = <&cpu_supply0>;
  154. operating-points-v2 = <&cpu_opp_table>;
  155. };
  156. cpu@1 {
  157. compatible = "qcom,krait";
  158. reg = <1>;
  159. next-level-cache = <&L2>;
  160. clocks = <&clk_controller 1>;
  161. clock-names = "cpu";
  162. cpu-supply = <&cpu_supply1>;
  163. operating-points-v2 = <&cpu_opp_table>;
  164. };
  165. cpu@2 {
  166. compatible = "qcom,krait";
  167. reg = <2>;
  168. next-level-cache = <&L2>;
  169. clocks = <&clk_controller 2>;
  170. clock-names = "cpu";
  171. cpu-supply = <&cpu_supply2>;
  172. operating-points-v2 = <&cpu_opp_table>;
  173. };
  174. cpu@3 {
  175. compatible = "qcom,krait";
  176. reg = <3>;
  177. next-level-cache = <&L2>;
  178. clocks = <&clk_controller 3>;
  179. clock-names = "cpu";
  180. cpu-supply = <&cpu_supply3>;
  181. operating-points-v2 = <&cpu_opp_table>;
  182. };
  183. };
  184. cpu_opp_table: opp_table {
  185. compatible = "operating-points-v2";
  186. /*
  187. * Missing opp-shared property means CPUs switch DVFS states
  188. * independently.
  189. */
  190. opp00 {
  191. opp-hz = <1000000000>;
  192. opp-microvolt = <970000 975000 985000>;
  193. opp-microamp = <70000>;
  194. clock-latency-ns = <300000>;
  195. opp-suspend;
  196. };
  197. opp01 {
  198. opp-hz = <1100000000>;
  199. opp-microvolt = <980000 1000000 1010000>;
  200. opp-microamp = <80000>;
  201. clock-latency-ns = <310000>;
  202. };
  203. opp02 {
  204. opp-hz = <1200000000>;
  205. opp-microvolt = <1025000>;
  206. opp-microamp = <90000;
  207. lock-latency-ns = <290000>;
  208. turbo-mode;
  209. };
  210. };
  211. };
  212. Example 3: Dual-cluster, Dual-core per cluster. CPUs within a cluster switch
  213. DVFS state together.
  214. / {
  215. cpus {
  216. #address-cells = <1>;
  217. #size-cells = <0>;
  218. cpu@0 {
  219. compatible = "arm,cortex-a7";
  220. reg = <0>;
  221. next-level-cache = <&L2>;
  222. clocks = <&clk_controller 0>;
  223. clock-names = "cpu";
  224. cpu-supply = <&cpu_supply0>;
  225. operating-points-v2 = <&cluster0_opp>;
  226. };
  227. cpu@1 {
  228. compatible = "arm,cortex-a7";
  229. reg = <1>;
  230. next-level-cache = <&L2>;
  231. clocks = <&clk_controller 0>;
  232. clock-names = "cpu";
  233. cpu-supply = <&cpu_supply0>;
  234. operating-points-v2 = <&cluster0_opp>;
  235. };
  236. cpu@100 {
  237. compatible = "arm,cortex-a15";
  238. reg = <100>;
  239. next-level-cache = <&L2>;
  240. clocks = <&clk_controller 1>;
  241. clock-names = "cpu";
  242. cpu-supply = <&cpu_supply1>;
  243. operating-points-v2 = <&cluster1_opp>;
  244. };
  245. cpu@101 {
  246. compatible = "arm,cortex-a15";
  247. reg = <101>;
  248. next-level-cache = <&L2>;
  249. clocks = <&clk_controller 1>;
  250. clock-names = "cpu";
  251. cpu-supply = <&cpu_supply1>;
  252. operating-points-v2 = <&cluster1_opp>;
  253. };
  254. };
  255. cluster0_opp: opp_table0 {
  256. compatible = "operating-points-v2";
  257. opp-shared;
  258. opp00 {
  259. opp-hz = <1000000000>;
  260. opp-microvolt = <970000 975000 985000>;
  261. opp-microamp = <70000>;
  262. clock-latency-ns = <300000>;
  263. opp-suspend;
  264. };
  265. opp01 {
  266. opp-hz = <1100000000>;
  267. opp-microvolt = <980000 1000000 1010000>;
  268. opp-microamp = <80000>;
  269. clock-latency-ns = <310000>;
  270. };
  271. opp02 {
  272. opp-hz = <1200000000>;
  273. opp-microvolt = <1025000>;
  274. opp-microamp = <90000>;
  275. clock-latency-ns = <290000>;
  276. turbo-mode;
  277. };
  278. };
  279. cluster1_opp: opp_table1 {
  280. compatible = "operating-points-v2";
  281. opp-shared;
  282. opp10 {
  283. opp-hz = <1300000000>;
  284. opp-microvolt = <1045000 1050000 1055000>;
  285. opp-microamp = <95000>;
  286. clock-latency-ns = <400000>;
  287. opp-suspend;
  288. };
  289. opp11 {
  290. opp-hz = <1400000000>;
  291. opp-microvolt = <1075000>;
  292. opp-microamp = <100000>;
  293. clock-latency-ns = <400000>;
  294. };
  295. opp12 {
  296. opp-hz = <1500000000>;
  297. opp-microvolt = <1010000 1100000 1110000>;
  298. opp-microamp = <95000>;
  299. clock-latency-ns = <400000>;
  300. turbo-mode;
  301. };
  302. };
  303. };
  304. Example 4: Handling multiple regulators
  305. / {
  306. cpus {
  307. cpu@0 {
  308. compatible = "arm,cortex-a7";
  309. ...
  310. cpu-supply = <&cpu_supply0>, <&cpu_supply1>, <&cpu_supply2>;
  311. operating-points-v2 = <&cpu0_opp_table>;
  312. };
  313. };
  314. cpu0_opp_table: opp_table0 {
  315. compatible = "operating-points-v2";
  316. opp-shared;
  317. opp00 {
  318. opp-hz = <1000000000>;
  319. opp-microvolt = <970000>, /* Supply 0 */
  320. <960000>, /* Supply 1 */
  321. <960000>; /* Supply 2 */
  322. opp-microamp = <70000>, /* Supply 0 */
  323. <70000>, /* Supply 1 */
  324. <70000>; /* Supply 2 */
  325. clock-latency-ns = <300000>;
  326. };
  327. /* OR */
  328. opp00 {
  329. opp-hz = <1000000000>;
  330. opp-microvolt = <970000 975000 985000>, /* Supply 0 */
  331. <960000 965000 975000>, /* Supply 1 */
  332. <960000 965000 975000>; /* Supply 2 */
  333. opp-microamp = <70000>, /* Supply 0 */
  334. <70000>, /* Supply 1 */
  335. <70000>; /* Supply 2 */
  336. clock-latency-ns = <300000>;
  337. };
  338. /* OR */
  339. opp00 {
  340. opp-hz = <1000000000>;
  341. opp-microvolt = <970000 975000 985000>, /* Supply 0 */
  342. <960000 965000 975000>, /* Supply 1 */
  343. <960000 965000 975000>; /* Supply 2 */
  344. opp-microamp = <70000>, /* Supply 0 */
  345. <0>, /* Supply 1 doesn't need this */
  346. <70000>; /* Supply 2 */
  347. clock-latency-ns = <300000>;
  348. };
  349. };
  350. };
  351. Example 5: Multiple OPP tables
  352. / {
  353. cpus {
  354. cpu@0 {
  355. compatible = "arm,cortex-a7";
  356. ...
  357. cpu-supply = <&cpu_supply>
  358. operating-points-v2 = <&cpu0_opp_table_slow>, <&cpu0_opp_table_fast>;
  359. operating-points-names = "slow", "fast";
  360. };
  361. };
  362. cpu0_opp_table_slow: opp_table_slow {
  363. compatible = "operating-points-v2";
  364. status = "okay";
  365. opp-shared;
  366. opp00 {
  367. opp-hz = <600000000>;
  368. ...
  369. };
  370. opp01 {
  371. opp-hz = <800000000>;
  372. ...
  373. };
  374. };
  375. cpu0_opp_table_fast: opp_table_fast {
  376. compatible = "operating-points-v2";
  377. status = "okay";
  378. opp-shared;
  379. opp10 {
  380. opp-hz = <1000000000>;
  381. ...
  382. };
  383. opp11 {
  384. opp-hz = <1100000000>;
  385. ...
  386. };
  387. };
  388. };