Skip to content

Commit 7f4a370

Browse files
committed
Merge branch 'pm-opp'
* pm-opp: PM / OPP: Use snprintf() instead of sprintf() PM / OPP: Set cpu_dev->id in cpumask first PM / OPP: Fix parsing of opp-microvolt and opp-microamp properties PM / OPP: Parse 'opp-<prop>-<name>' bindings PM / OPP: Parse 'opp-supported-hw' binding PM / OPP: Add missing doc comments ARM: dts: exynos4412: Rename OPP nodes as opp@<opp-hz> PM / OPP: Rename OPP nodes as opp@<opp-hz> PM / OPP: Remove 'operating-points-names' binding PM / OPP: Add {opp-microvolt|opp-microamp}-<name> binding PM / OPP: Add "opp-supported-hw" binding PM / OPP: Add debugfs support
2 parents a7da481 + 5ff24d6 commit 7f4a370

File tree

8 files changed

+722
-72
lines changed

8 files changed

+722
-72
lines changed

Documentation/devicetree/bindings/opp/opp.txt

Lines changed: 93 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,10 @@ Devices supporting OPPs must set their "operating-points-v2" property with
4545
phandle to a OPP table in their DT node. The OPP core will use this phandle to
4646
find 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-
5348
If required, this can be extended for SoC vendor specfic bindings. Such bindings
5449
should be documented as Documentation/devicetree/bindings/power/<vendor>-opp.txt
5550
and 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

6554
This 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

128148
Example 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
};

arch/arm/boot/dts/exynos4412.dtsi

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,73 +64,73 @@
6464
compatible = "operating-points-v2";
6565
opp-shared;
6666

67-
opp00 {
67+
opp@200000000 {
6868
opp-hz = /bits/ 64 <200000000>;
6969
opp-microvolt = <900000>;
7070
clock-latency-ns = <200000>;
7171
};
72-
opp01 {
72+
opp@300000000 {
7373
opp-hz = /bits/ 64 <300000000>;
7474
opp-microvolt = <900000>;
7575
clock-latency-ns = <200000>;
7676
};
77-
opp02 {
77+
opp@400000000 {
7878
opp-hz = /bits/ 64 <400000000>;
7979
opp-microvolt = <925000>;
8080
clock-latency-ns = <200000>;
8181
};
82-
opp03 {
82+
opp@500000000 {
8383
opp-hz = /bits/ 64 <500000000>;
8484
opp-microvolt = <950000>;
8585
clock-latency-ns = <200000>;
8686
};
87-
opp04 {
87+
opp@600000000 {
8888
opp-hz = /bits/ 64 <600000000>;
8989
opp-microvolt = <975000>;
9090
clock-latency-ns = <200000>;
9191
};
92-
opp05 {
92+
opp@700000000 {
9393
opp-hz = /bits/ 64 <700000000>;
9494
opp-microvolt = <987500>;
9595
clock-latency-ns = <200000>;
9696
};
97-
opp06 {
97+
opp@800000000 {
9898
opp-hz = /bits/ 64 <800000000>;
9999
opp-microvolt = <1000000>;
100100
clock-latency-ns = <200000>;
101101
opp-suspend;
102102
};
103-
opp07 {
103+
opp@900000000 {
104104
opp-hz = /bits/ 64 <900000000>;
105105
opp-microvolt = <1037500>;
106106
clock-latency-ns = <200000>;
107107
};
108-
opp08 {
108+
opp@1000000000 {
109109
opp-hz = /bits/ 64 <1000000000>;
110110
opp-microvolt = <1087500>;
111111
clock-latency-ns = <200000>;
112112
};
113-
opp09 {
113+
opp@1100000000 {
114114
opp-hz = /bits/ 64 <1100000000>;
115115
opp-microvolt = <1137500>;
116116
clock-latency-ns = <200000>;
117117
};
118-
opp10 {
118+
opp@1200000000 {
119119
opp-hz = /bits/ 64 <1200000000>;
120120
opp-microvolt = <1187500>;
121121
clock-latency-ns = <200000>;
122122
};
123-
opp11 {
123+
opp@1300000000 {
124124
opp-hz = /bits/ 64 <1300000000>;
125125
opp-microvolt = <1250000>;
126126
clock-latency-ns = <200000>;
127127
};
128-
opp12 {
128+
opp@1400000000 {
129129
opp-hz = /bits/ 64 <1400000000>;
130130
opp-microvolt = <1287500>;
131131
clock-latency-ns = <200000>;
132132
};
133-
opp13 {
133+
opp@1500000000 {
134134
opp-hz = /bits/ 64 <1500000000>;
135135
opp-microvolt = <1350000>;
136136
clock-latency-ns = <200000>;

drivers/base/power/opp/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
ccflags-$(CONFIG_DEBUG_DRIVER) := -DDEBUG
22
obj-y += core.o cpu.o
3+
obj-$(CONFIG_DEBUG_FS) += debugfs.o

0 commit comments

Comments
 (0)