Skip to content

Commit 757e282

Browse files
committed
Merge branch 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm
Pull opertaing performance points (OPP) framework fixes for 5.10-rc1 from Viresh Kumar: "- Return -EPROBE_DEFER properly from dev_pm_opp_get_opp_table() (Stephan Gerhold). - Minor cleanups around required-opps (Stephan Gerhold). - Extends opp-supported-hw property to contain multiple versions (Viresh Kumar). - Multiple cleanups around dev_pm_opp_attach_genpd() (Viresh Kumar). - Multiple fixes, cleanups in the OPP core for overall better design (Viresh Kumar)." * 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: opp: Allow opp-level to be set to 0 opp: Prevent memory leak in dev_pm_opp_attach_genpd() ARM: tegra: Pass multiple versions in opp-supported-hw property opp: Allow opp-supported-hw to contain multiple versions dt-bindings: opp: Allow opp-supported-hw to contain multiple versions opp: Set required OPPs in reverse order when scaling down opp: Reduce code duplication in _set_required_opps() opp: Drop unnecessary check from dev_pm_opp_attach_genpd() opp: Handle multiple calls for same OPP table in _of_add_opp_table_v1() opp: Allow dev_pm_opp_get_opp_table() to return -EPROBE_DEFER opp: Remove _dev_pm_opp_find_and_remove_table() wrapper opp: Split out _opp_set_rate_zero() opp: Reuse the enabled flag in !target_freq path opp: Rename regulator_enabled and use it as status of all resources
2 parents 549738f + a5663c9 commit 757e282

11 files changed

Lines changed: 381 additions & 1637 deletions

File tree

Documentation/devicetree/bindings/opp/opp.txt

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -154,25 +154,27 @@ Optional properties:
154154
- opp-suspend: Marks the OPP to be used during device suspend. If multiple OPPs
155155
in the table have this, the OPP with highest opp-hz will be used.
156156

157-
- opp-supported-hw: This enables us to select only a subset of OPPs from the
158-
larger OPP table, based on what version of the hardware we are running on. We
159-
still can't have multiple nodes with the same opp-hz value in OPP table.
160-
161-
It's a user defined array containing a hierarchy of hardware version numbers,
162-
supported by the OPP. For example: a platform with hierarchy of three levels
163-
of versions (A, B and C), this field should be like <X Y Z>, where X
164-
corresponds to Version hierarchy A, Y corresponds to version hierarchy B and Z
165-
corresponds to version hierarchy C.
166-
167-
Each level of hierarchy is represented by a 32 bit value, and so there can be
168-
only 32 different supported version per hierarchy. i.e. 1 bit per version. A
169-
value of 0xFFFFFFFF will enable the OPP for all versions for that hierarchy
170-
level. And a value of 0x00000000 will disable the OPP completely, and so we
171-
never want that to happen.
172-
173-
If 32 values aren't sufficient for a version hierarchy, than that version
174-
hierarchy can be contained in multiple 32 bit values. i.e. <X Y Z1 Z2> in the
175-
above example, Z1 & Z2 refer to the version hierarchy Z.
157+
- opp-supported-hw: This property allows a platform to enable only a subset of
158+
the OPPs from the larger set present in the OPP table, based on the current
159+
version of the hardware (already known to the operating system).
160+
161+
Each block present in the array of blocks in this property, represents a
162+
sub-group of hardware versions supported by the OPP. i.e. <sub-group A>,
163+
<sub-group B>, etc. The OPP will be enabled if _any_ of these sub-groups match
164+
the hardware's version.
165+
166+
Each sub-group is a platform defined array representing the hierarchy of
167+
hardware versions supported by the platform. For a platform with three
168+
hierarchical levels of version (X.Y.Z), this field shall look like
169+
170+
opp-supported-hw = <X1 Y1 Z1>, <X2 Y2 Z2>, <X3 Y3 Z3>.
171+
172+
Each level (eg. X1) in version hierarchy is represented by a 32 bit value, one
173+
bit per version and so there can be maximum 32 versions per level. Logical AND
174+
(&) operation is performed for each level with the hardware's level version
175+
and a non-zero output for _all_ the levels in a sub-group means the OPP is
176+
supported by hardware. A value of 0xFFFFFFFF for each level in the sub-group
177+
will enable the OPP for all versions for the hardware.
176178

177179
- status: Marks the node enabled/disabled.
178180

@@ -503,7 +505,6 @@ Example 5: opp-supported-hw
503505
*/
504506
opp-supported-hw = <0xF 0xFFFFFFFF 0xFFFFFFFF>
505507
opp-hz = /bits/ 64 <600000000>;
506-
opp-microvolt = <915000 900000 925000>;
507508
...
508509
};
509510

@@ -516,7 +517,17 @@ Example 5: opp-supported-hw
516517
*/
517518
opp-supported-hw = <0x20 0xff0000ff 0x0000f4f0>
518519
opp-hz = /bits/ 64 <800000000>;
519-
opp-microvolt = <915000 900000 925000>;
520+
...
521+
};
522+
523+
opp-900000000 {
524+
/*
525+
* Supports:
526+
* - All cuts and substrate where process version is 0x2.
527+
* - All cuts and process where substrate version is 0x2.
528+
*/
529+
opp-supported-hw = <0xFFFFFFFF 0xFFFFFFFF 0x02>, <0xFFFFFFFF 0x01 0xFFFFFFFF>
530+
opp-hz = /bits/ 64 <900000000>;
520531
...
521532
};
522533
};

arch/arm/boot/dts/tegra20-cpu-opp-microvolt.dtsi

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@
2626
opp-microvolt = <800000 800000 1125000>;
2727
};
2828

29-
opp@456000000,800,2,2 {
30-
opp-microvolt = <800000 800000 1125000>;
31-
};
32-
33-
opp@456000000,800,3,2 {
34-
opp-microvolt = <800000 800000 1125000>;
35-
};
36-
3729
opp@456000000,825 {
3830
opp-microvolt = <825000 825000 1125000>;
3931
};
@@ -46,10 +38,6 @@
4638
opp-microvolt = <800000 800000 1125000>;
4739
};
4840

49-
opp@608000000,800,3,2 {
50-
opp-microvolt = <800000 800000 1125000>;
51-
};
52-
5341
opp@608000000,825 {
5442
opp-microvolt = <825000 825000 1125000>;
5543
};
@@ -78,18 +66,6 @@
7866
opp-microvolt = <875000 875000 1125000>;
7967
};
8068

81-
opp@760000000,875,1,1 {
82-
opp-microvolt = <875000 875000 1125000>;
83-
};
84-
85-
opp@760000000,875,0,2 {
86-
opp-microvolt = <875000 875000 1125000>;
87-
};
88-
89-
opp@760000000,875,1,2 {
90-
opp-microvolt = <875000 875000 1125000>;
91-
};
92-
9369
opp@760000000,900 {
9470
opp-microvolt = <900000 900000 1125000>;
9571
};
@@ -134,14 +110,6 @@
134110
opp-microvolt = <950000 950000 1125000>;
135111
};
136112

137-
opp@912000000,950,0,2 {
138-
opp-microvolt = <950000 950000 1125000>;
139-
};
140-
141-
opp@912000000,950,2,2 {
142-
opp-microvolt = <950000 950000 1125000>;
143-
};
144-
145113
opp@912000000,1000 {
146114
opp-microvolt = <1000000 1000000 1125000>;
147115
};
@@ -170,10 +138,6 @@
170138
opp-microvolt = <1000000 1000000 1125000>;
171139
};
172140

173-
opp@1000000000,1000,0,2 {
174-
opp-microvolt = <1000000 1000000 1125000>;
175-
};
176-
177141
opp@1000000000,1025 {
178142
opp-microvolt = <1025000 1025000 1125000>;
179143
};

arch/arm/boot/dts/tegra20-cpu-opp.dtsi

Lines changed: 8 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,8 @@
3737

3838
opp@456000000,800 {
3939
clock-latency-ns = <400000>;
40-
opp-supported-hw = <0x03 0x0006>;
41-
opp-hz = /bits/ 64 <456000000>;
42-
};
43-
44-
opp@456000000,800,2,2 {
45-
clock-latency-ns = <400000>;
46-
opp-supported-hw = <0x04 0x0004>;
47-
opp-hz = /bits/ 64 <456000000>;
48-
};
49-
50-
opp@456000000,800,3,2 {
51-
clock-latency-ns = <400000>;
52-
opp-supported-hw = <0x08 0x0004>;
40+
opp-supported-hw = <0x03 0x0006>, <0x04 0x0004>,
41+
<0x08 0x0004>;
5342
opp-hz = /bits/ 64 <456000000>;
5443
};
5544

@@ -67,13 +56,7 @@
6756

6857
opp@608000000,800 {
6958
clock-latency-ns = <400000>;
70-
opp-supported-hw = <0x04 0x0006>;
71-
opp-hz = /bits/ 64 <608000000>;
72-
};
73-
74-
opp@608000000,800,3,2 {
75-
clock-latency-ns = <400000>;
76-
opp-supported-hw = <0x08 0x0004>;
59+
opp-supported-hw = <0x04 0x0006>, <0x08 0x0004>;
7760
opp-hz = /bits/ 64 <608000000>;
7861
};
7962

@@ -115,25 +98,8 @@
11598

11699
opp@760000000,875 {
117100
clock-latency-ns = <400000>;
118-
opp-supported-hw = <0x04 0x0001>;
119-
opp-hz = /bits/ 64 <760000000>;
120-
};
121-
122-
opp@760000000,875,1,1 {
123-
clock-latency-ns = <400000>;
124-
opp-supported-hw = <0x02 0x0002>;
125-
opp-hz = /bits/ 64 <760000000>;
126-
};
127-
128-
opp@760000000,875,0,2 {
129-
clock-latency-ns = <400000>;
130-
opp-supported-hw = <0x01 0x0004>;
131-
opp-hz = /bits/ 64 <760000000>;
132-
};
133-
134-
opp@760000000,875,1,2 {
135-
clock-latency-ns = <400000>;
136-
opp-supported-hw = <0x02 0x0004>;
101+
opp-supported-hw = <0x04 0x0001>, <0x02 0x0002>,
102+
<0x01 0x0004>, <0x02 0x0004>;
137103
opp-hz = /bits/ 64 <760000000>;
138104
};
139105

@@ -199,19 +165,8 @@
199165

200166
opp@912000000,950 {
201167
clock-latency-ns = <400000>;
202-
opp-supported-hw = <0x02 0x0006>;
203-
opp-hz = /bits/ 64 <912000000>;
204-
};
205-
206-
opp@912000000,950,0,2 {
207-
clock-latency-ns = <400000>;
208-
opp-supported-hw = <0x01 0x0004>;
209-
opp-hz = /bits/ 64 <912000000>;
210-
};
211-
212-
opp@912000000,950,2,2 {
213-
clock-latency-ns = <400000>;
214-
opp-supported-hw = <0x04 0x0004>;
168+
opp-supported-hw = <0x02 0x0006>, <0x01 0x0004>,
169+
<0x04 0x0004>;
215170
opp-hz = /bits/ 64 <912000000>;
216171
};
217172

@@ -253,13 +208,7 @@
253208

254209
opp@1000000000,1000 {
255210
clock-latency-ns = <400000>;
256-
opp-supported-hw = <0x02 0x0006>;
257-
opp-hz = /bits/ 64 <1000000000>;
258-
};
259-
260-
opp@1000000000,1000,0,2 {
261-
clock-latency-ns = <400000>;
262-
opp-supported-hw = <0x01 0x0004>;
211+
opp-supported-hw = <0x02 0x0006>, <0x01 0x0004>;
263212
opp-hz = /bits/ 64 <1000000000>;
264213
};
265214

0 commit comments

Comments
 (0)