@@ -45,21 +45,10 @@ Devices supporting OPPs must set their "operating-points-v2" property with
4545phandle to a OPP table in their DT node. The OPP core will use this phandle to
4646find the operating points for the device.
4747
48- Devices may want to choose OPP tables at runtime and so can provide a list of
49- phandles here. But only *one* of them should be chosen at runtime. This must be
50- accompanied by a corresponding "operating-points-names" property, to uniquely
51- identify the OPP tables.
52-
5348If required, this can be extended for SoC vendor specfic bindings. Such bindings
5449should be documented as Documentation/devicetree/bindings/power/<vendor>-opp.txt
5550and should have a compatible description like: "operating-points-v2-<vendor>".
5651
57- Optional properties:
58- - operating-points-names: Names of OPP tables (required if multiple OPP
59- tables are present), to uniquely identify them. The same list must be present
60- for all the CPUs which are sharing clock/voltage rails and hence the OPP
61- tables.
62-
6352* OPP Table Node
6453
6554This describes the OPPs belonging to a device. This node can have following
@@ -100,6 +89,14 @@ Optional properties:
10089 Entries for multiple regulators must be present in the same order as
10190 regulators are specified in device's DT node.
10291
92+ - opp-microvolt-<name>: Named opp-microvolt property. This is exactly similar to
93+ the above opp-microvolt property, but allows multiple voltage ranges to be
94+ provided for the same OPP. At runtime, the platform can pick a <name> and
95+ matching opp-microvolt-<name> property will be enabled for all OPPs. If the
96+ platform doesn't pick a specific <name> or the <name> doesn't match with any
97+ opp-microvolt-<name> properties, then opp-microvolt property shall be used, if
98+ present.
99+
103100- opp-microamp: The maximum current drawn by the device in microamperes
104101 considering system specific parameters (such as transients, process, aging,
105102 maximum operating temperature range etc.) as necessary. This may be used to
@@ -112,6 +109,9 @@ Optional properties:
112109 for few regulators, then this should be marked as zero for them. If it isn't
113110 required for any regulator, then this property need not be present.
114111
112+ - opp-microamp-<name>: Named opp-microamp property. Similar to
113+ opp-microvolt-<name> property, but for microamp instead.
114+
115115- clock-latency-ns: Specifies the maximum possible transition latency (in
116116 nanoseconds) for switching to this OPP from any other OPP.
117117
@@ -123,6 +123,26 @@ Optional properties:
123123- opp-suspend: Marks the OPP to be used during device suspend. Only one OPP in
124124 the table should have this.
125125
126+ - opp-supported-hw: This enables us to select only a subset of OPPs from the
127+ larger OPP table, based on what version of the hardware we are running on. We
128+ still can't have multiple nodes with the same opp-hz value in OPP table.
129+
130+ It's an user defined array containing a hierarchy of hardware version numbers,
131+ supported by the OPP. For example: a platform with hierarchy of three levels
132+ of versions (A, B and C), this field should be like <X Y Z>, where X
133+ corresponds to Version hierarchy A, Y corresponds to version hierarchy B and Z
134+ corresponds to version hierarchy C.
135+
136+ Each level of hierarchy is represented by a 32 bit value, and so there can be
137+ only 32 different supported version per hierarchy. i.e. 1 bit per version. A
138+ value of 0xFFFFFFFF will enable the OPP for all versions for that hierarchy
139+ level. And a value of 0x00000000 will disable the OPP completely, and so we
140+ never want that to happen.
141+
142+ If 32 values aren't sufficient for a version hierarchy, than that version
143+ hierarchy can be contained in multiple 32 bit values. i.e. <X Y Z1 Z2> in the
144+ above example, Z1 & Z2 refer to the version hierarchy Z.
145+
126146- status: Marks the node enabled/disabled.
127147
128148Example 1: Single cluster Dual-core ARM cortex A9, switch DVFS states together.
@@ -157,20 +177,20 @@ Example 1: Single cluster Dual-core ARM cortex A9, switch DVFS states together.
157177 compatible = "operating-points-v2";
158178 opp-shared;
159179
160- opp00 {
180+ opp@1000000000 {
161181 opp-hz = /bits/ 64 <1000000000>;
162182 opp-microvolt = <970000 975000 985000>;
163183 opp-microamp = <70000>;
164184 clock-latency-ns = <300000>;
165185 opp-suspend;
166186 };
167- opp01 {
187+ opp@1100000000 {
168188 opp-hz = /bits/ 64 <1100000000>;
169189 opp-microvolt = <980000 1000000 1010000>;
170190 opp-microamp = <80000>;
171191 clock-latency-ns = <310000>;
172192 };
173- opp02 {
193+ opp@1200000000 {
174194 opp-hz = /bits/ 64 <1200000000>;
175195 opp-microvolt = <1025000>;
176196 clock-latency-ns = <290000>;
@@ -236,20 +256,20 @@ independently.
236256 * independently.
237257 */
238258
239- opp00 {
259+ opp@1000000000 {
240260 opp-hz = /bits/ 64 <1000000000>;
241261 opp-microvolt = <970000 975000 985000>;
242262 opp-microamp = <70000>;
243263 clock-latency-ns = <300000>;
244264 opp-suspend;
245265 };
246- opp01 {
266+ opp@1100000000 {
247267 opp-hz = /bits/ 64 <1100000000>;
248268 opp-microvolt = <980000 1000000 1010000>;
249269 opp-microamp = <80000>;
250270 clock-latency-ns = <310000>;
251271 };
252- opp02 {
272+ opp@1200000000 {
253273 opp-hz = /bits/ 64 <1200000000>;
254274 opp-microvolt = <1025000>;
255275 opp-microamp = <90000;
@@ -312,20 +332,20 @@ DVFS state together.
312332 compatible = "operating-points-v2";
313333 opp-shared;
314334
315- opp00 {
335+ opp@1000000000 {
316336 opp-hz = /bits/ 64 <1000000000>;
317337 opp-microvolt = <970000 975000 985000>;
318338 opp-microamp = <70000>;
319339 clock-latency-ns = <300000>;
320340 opp-suspend;
321341 };
322- opp01 {
342+ opp@1100000000 {
323343 opp-hz = /bits/ 64 <1100000000>;
324344 opp-microvolt = <980000 1000000 1010000>;
325345 opp-microamp = <80000>;
326346 clock-latency-ns = <310000>;
327347 };
328- opp02 {
348+ opp@1200000000 {
329349 opp-hz = /bits/ 64 <1200000000>;
330350 opp-microvolt = <1025000>;
331351 opp-microamp = <90000>;
@@ -338,20 +358,20 @@ DVFS state together.
338358 compatible = "operating-points-v2";
339359 opp-shared;
340360
341- opp10 {
361+ opp@1300000000 {
342362 opp-hz = /bits/ 64 <1300000000>;
343363 opp-microvolt = <1045000 1050000 1055000>;
344364 opp-microamp = <95000>;
345365 clock-latency-ns = <400000>;
346366 opp-suspend;
347367 };
348- opp11 {
368+ opp@1400000000 {
349369 opp-hz = /bits/ 64 <1400000000>;
350370 opp-microvolt = <1075000>;
351371 opp-microamp = <100000>;
352372 clock-latency-ns = <400000>;
353373 };
354- opp12 {
374+ opp@1500000000 {
355375 opp-hz = /bits/ 64 <1500000000>;
356376 opp-microvolt = <1010000 1100000 1110000>;
357377 opp-microamp = <95000>;
@@ -378,7 +398,7 @@ Example 4: Handling multiple regulators
378398 compatible = "operating-points-v2";
379399 opp-shared;
380400
381- opp00 {
401+ opp@1000000000 {
382402 opp-hz = /bits/ 64 <1000000000>;
383403 opp-microvolt = <970000>, /* Supply 0 */
384404 <960000>, /* Supply 1 */
@@ -391,7 +411,7 @@ Example 4: Handling multiple regulators
391411
392412 /* OR */
393413
394- opp00 {
414+ opp@1000000000 {
395415 opp-hz = /bits/ 64 <1000000000>;
396416 opp-microvolt = <970000 975000 985000>, /* Supply 0 */
397417 <960000 965000 975000>, /* Supply 1 */
@@ -404,7 +424,7 @@ Example 4: Handling multiple regulators
404424
405425 /* OR */
406426
407- opp00 {
427+ opp@1000000000 {
408428 opp-hz = /bits/ 64 <1000000000>;
409429 opp-microvolt = <970000 975000 985000>, /* Supply 0 */
410430 <960000 965000 975000>, /* Supply 1 */
@@ -417,7 +437,8 @@ Example 4: Handling multiple regulators
417437 };
418438};
419439
420- Example 5: Multiple OPP tables
440+ Example 5: opp-supported-hw
441+ (example: three level hierarchy of versions: cuts, substrate and process)
421442
422443/ {
423444 cpus {
@@ -426,40 +447,73 @@ Example 5: Multiple OPP tables
426447 ...
427448
428449 cpu-supply = <&cpu_supply>
429- operating-points-v2 = <&cpu0_opp_table_slow>, <&cpu0_opp_table_fast>;
430- operating-points-names = "slow", "fast";
450+ operating-points-v2 = <&cpu0_opp_table_slow>;
431451 };
432452 };
433453
434- cpu0_opp_table_slow: opp_table_slow {
454+ opp_table {
435455 compatible = "operating-points-v2";
436456 status = "okay";
437457 opp-shared;
438458
439- opp00 {
459+ opp@600000000 {
460+ /*
461+ * Supports all substrate and process versions for 0xF
462+ * cuts, i.e. only first four cuts.
463+ */
464+ opp-supported-hw = <0xF 0xFFFFFFFF 0xFFFFFFFF>
440465 opp-hz = /bits/ 64 <600000000>;
466+ opp-microvolt = <900000 915000 925000>;
441467 ...
442468 };
443469
444- opp01 {
470+ opp@800000000 {
471+ /*
472+ * Supports:
473+ * - cuts: only one, 6th cut (represented by 6th bit).
474+ * - substrate: supports 16 different substrate versions
475+ * - process: supports 9 different process versions
476+ */
477+ opp-supported-hw = <0x20 0xff0000ff 0x0000f4f0>
445478 opp-hz = /bits/ 64 <800000000>;
479+ opp-microvolt = <900000 915000 925000>;
446480 ...
447481 };
448482 };
483+ };
484+
485+ Example 6: opp-microvolt-<name>, opp-microamp-<name>:
486+ (example: device with two possible microvolt ranges: slow and fast)
449487
450- cpu0_opp_table_fast: opp_table_fast {
488+ / {
489+ cpus {
490+ cpu@0 {
491+ compatible = "arm,cortex-a7";
492+ ...
493+
494+ operating-points-v2 = <&cpu0_opp_table>;
495+ };
496+ };
497+
498+ cpu0_opp_table: opp_table0 {
451499 compatible = "operating-points-v2";
452- status = "okay";
453500 opp-shared;
454501
455- opp10 {
502+ opp@1000000000 {
456503 opp-hz = /bits/ 64 <1000000000>;
457- ...
504+ opp-microvolt-slow = <900000 915000 925000>;
505+ opp-microvolt-fast = <970000 975000 985000>;
506+ opp-microamp-slow = <70000>;
507+ opp-microamp-fast = <71000>;
458508 };
459509
460- opp11 {
461- opp-hz = /bits/ 64 <1100000000>;
462- ...
510+ opp@1200000000 {
511+ opp-hz = /bits/ 64 <1200000000>;
512+ opp-microvolt-slow = <900000 915000 925000>, /* Supply vcc0 */
513+ <910000 925000 935000>; /* Supply vcc1 */
514+ opp-microvolt-fast = <970000 975000 985000>, /* Supply vcc0 */
515+ <960000 965000 975000>; /* Supply vcc1 */
516+ opp-microamp = <70000>; /* Will be used for both slow/fast */
463517 };
464518 };
465519};
0 commit comments