Hi Rafael,
All the bindings are Reviewed by Stephen now and Rob didn't had a problem with them (though he didn't Ack them separately yet) :)
The first patch enables us to select only a subset of OPPs from the bigger table, based on what version of the hardware we are running on.
The second one enables us to select slightly different values for multiple properties, based on what kind of hardware they are running on.
The third one removes an (unused) binding, which is replaced by the second patch with a better solution.
The fourth patch is based on what Stephen suggested (and then reviewed) in the earlier series, and the 5th one updates the existing users of these bindings for it.
Viresh Kumar (5): PM / OPP: Add "opp-supported-hw" binding PM / OPP: Add {opp-microvolt|opp-microamp|turbo-mode|opp-suspend}-<name> binding PM / OPP: Remove 'operating-points-names' binding PM / OPP: Rename OPP nodes as opp@<opp-hz> ARM: dts: exynos4412: Rename OPP nodes as opp@<opp-hz>
Documentation/devicetree/bindings/opp/opp.txt | 143 +++++++++++++++++++------- arch/arm/boot/dts/exynos4412.dtsi | 28 ++--- 2 files changed, 118 insertions(+), 53 deletions(-)
We may want to enable only a subset of OPPs, from the bigger list of OPPs, based on what version of the hardware we are running on. This would enable us to not duplicate OPP tables for every version of the hardware we support.
To enable that, this patch defines a new property 'opp-supported-hw'. It can support any number of hierarchy levels of the versions the hardware follows. And based on the selected hardware versions, we can pick only the relevant OPPs at runtime.
Reviewed-by: Stephen Boyd sboyd@codeaurora.org Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- Documentation/devicetree/bindings/opp/opp.txt | 65 +++++++++++++++++++++++++++ 1 file changed, 65 insertions(+)
diff --git a/Documentation/devicetree/bindings/opp/opp.txt b/Documentation/devicetree/bindings/opp/opp.txt index 0cb44dc21f97..d072fa0ffbd4 100644 --- a/Documentation/devicetree/bindings/opp/opp.txt +++ b/Documentation/devicetree/bindings/opp/opp.txt @@ -123,6 +123,26 @@ properties. - opp-suspend: Marks the OPP to be used during device suspend. Only one OPP in the table should have this.
+- opp-supported-hw: This enables us to select only a subset of OPPs from the + larger OPP table, based on what version of the hardware we are running on. We + still can't have multiple nodes with the same opp-hz value in OPP table. + + It's an user defined array containing a hierarchy of hardware version numbers, + supported by the OPP. For example: a platform with hierarchy of three levels + of versions (A, B and C), this field should be like <X Y Z>, where X + corresponds to Version hierarchy A, Y corresponds to version hierarchy B and Z + corresponds to version hierarchy C. + + Each level of hierarchy is represented by a 32 bit value, and so there can be + only 32 different supported version per hierarchy. i.e. 1 bit per version. A + value of 0xFFFFFFFF will enable the OPP for all versions for that hierarchy + level. And a value of 0x00000000 will disable the OPP completely, and so we + never want that to happen. + + If 32 values aren't sufficient for a version hierarchy, than that version + hierarchy can be contained in multiple 32 bit values. i.e. <X Y Z1 Z2> in the + above example, Z1 & Z2 refer to the version hierarchy Z. + - status: Marks the node enabled/disabled.
Example 1: Single cluster Dual-core ARM cortex A9, switch DVFS states together. @@ -463,3 +483,48 @@ Example 5: Multiple OPP tables }; }; }; + +Example 6: opp-supported-hw +(example: three level hierarchy of versions: cuts, substrate and process) + +/ { + cpus { + cpu@0 { + compatible = "arm,cortex-a7"; + ... + + cpu-supply = <&cpu_supply> + operating-points-v2 = <&cpu0_opp_table_slow>; + }; + }; + + opp_table { + compatible = "operating-points-v2"; + status = "okay"; + opp-shared; + + opp00 { + /* + * Supports all substrate and process versions for 0xF + * cuts, i.e. only first four cuts. + */ + opp-supported-hw = <0xF 0xFFFFFFFF 0xFFFFFFFF> + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <900000 915000 925000>; + ... + }; + + opp01 { + /* + * Supports: + * - cuts: only one, 6th cut (represented by 6th bit). + * - substrate: supports 16 different substrate versions + * - process: supports 9 different process versions + */ + opp-supported-hw = <0x20 0xff0000ff 0x0000f4f0> + opp-hz = /bits/ 64 <800000000>; + opp-microvolt = <900000 915000 925000>; + ... + }; + }; +};
On Thu, Nov 05, 2015 at 07:11:52AM +0530, Viresh Kumar wrote:
We may want to enable only a subset of OPPs, from the bigger list of OPPs, based on what version of the hardware we are running on. This would enable us to not duplicate OPP tables for every version of the hardware we support.
To enable that, this patch defines a new property 'opp-supported-hw'. It can support any number of hierarchy levels of the versions the hardware follows. And based on the selected hardware versions, we can pick only the relevant OPPs at runtime.
Reviewed-by: Stephen Boyd sboyd@codeaurora.org Signed-off-by: Viresh Kumar viresh.kumar@linaro.org
Acked-by: Rob Herring robh@kernel.org
Documentation/devicetree/bindings/opp/opp.txt | 65 +++++++++++++++++++++++++++ 1 file changed, 65 insertions(+)
diff --git a/Documentation/devicetree/bindings/opp/opp.txt b/Documentation/devicetree/bindings/opp/opp.txt index 0cb44dc21f97..d072fa0ffbd4 100644 --- a/Documentation/devicetree/bindings/opp/opp.txt +++ b/Documentation/devicetree/bindings/opp/opp.txt @@ -123,6 +123,26 @@ properties.
- opp-suspend: Marks the OPP to be used during device suspend. Only one OPP in the table should have this.
+- opp-supported-hw: This enables us to select only a subset of OPPs from the
- larger OPP table, based on what version of the hardware we are running on. We
- still can't have multiple nodes with the same opp-hz value in OPP table.
- It's an user defined array containing a hierarchy of hardware version numbers,
- supported by the OPP. For example: a platform with hierarchy of three levels
- of versions (A, B and C), this field should be like <X Y Z>, where X
- corresponds to Version hierarchy A, Y corresponds to version hierarchy B and Z
- corresponds to version hierarchy C.
- Each level of hierarchy is represented by a 32 bit value, and so there can be
- only 32 different supported version per hierarchy. i.e. 1 bit per version. A
- value of 0xFFFFFFFF will enable the OPP for all versions for that hierarchy
- level. And a value of 0x00000000 will disable the OPP completely, and so we
- never want that to happen.
- If 32 values aren't sufficient for a version hierarchy, than that version
- hierarchy can be contained in multiple 32 bit values. i.e. <X Y Z1 Z2> in the
- above example, Z1 & Z2 refer to the version hierarchy Z.
- status: Marks the node enabled/disabled.
Example 1: Single cluster Dual-core ARM cortex A9, switch DVFS states together. @@ -463,3 +483,48 @@ Example 5: Multiple OPP tables }; }; };
+Example 6: opp-supported-hw +(example: three level hierarchy of versions: cuts, substrate and process)
+/ {
- cpus {
cpu@0 {
compatible = "arm,cortex-a7";
...
cpu-supply = <&cpu_supply>
operating-points-v2 = <&cpu0_opp_table_slow>;
};
- };
- opp_table {
compatible = "operating-points-v2";
status = "okay";
opp-shared;
opp00 {
/*
* Supports all substrate and process versions for 0xF
* cuts, i.e. only first four cuts.
*/
opp-supported-hw = <0xF 0xFFFFFFFF 0xFFFFFFFF>
opp-hz = /bits/ 64 <600000000>;
opp-microvolt = <900000 915000 925000>;
...
};
opp01 {
/*
* Supports:
* - cuts: only one, 6th cut (represented by 6th bit).
* - substrate: supports 16 different substrate versions
* - process: supports 9 different process versions
*/
opp-supported-hw = <0x20 0xff0000ff 0x0000f4f0>
opp-hz = /bits/ 64 <800000000>;
opp-microvolt = <900000 915000 925000>;
...
};
- };
+};
2.6.2.198.g614a2ac
Depending on the version of hardware or its properties, which are only known at runtime, various properties of the OPP can change. For example, an OPP with frequency 1.2 GHz, may have different voltage/current requirements based on the version of the hardware it is running on. Similarly, it may or may not be a turbo or suspend OPP on those circumstances.
In order to not replicate the same OPP tables for varying values of all such fields, this commit introduces the concept of opp-property-<name>. The <name> can be chosen by the platform at runtime, and OPPs will be initialized depending on that name string. Currently support is extended for the following properties: - opp-microvolt-<name> - opp-microamp-<name> - turbo-mode-<name> - opp-suspend-<name>
If the name string isn't provided by the platform, or if it is provided but doesn't match the properties present in the OPP node, we will fall back to the original properties without the -<name> string, if they are available.
Reviewed-by: Stephen Boyd sboyd@codeaurora.org Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- Documentation/devicetree/bindings/opp/opp.txt | 58 +++++++++++++++++++++++++++ 1 file changed, 58 insertions(+)
diff --git a/Documentation/devicetree/bindings/opp/opp.txt b/Documentation/devicetree/bindings/opp/opp.txt index d072fa0ffbd4..61c6f25cf8e2 100644 --- a/Documentation/devicetree/bindings/opp/opp.txt +++ b/Documentation/devicetree/bindings/opp/opp.txt @@ -100,6 +100,14 @@ properties. Entries for multiple regulators must be present in the same order as regulators are specified in device's DT node.
+- opp-microvolt-<name>: Named opp-microvolt property. This is exactly similar to + the above opp-microvolt property, but allows multiple voltage ranges to be + provided for the same OPP. At runtime, the platform can pick a <name> and + matching opp-microvolt-<name> property will be enabled for all OPPs. If the + platform doesn't pick a specific <name> or the <name> doesn't match with any + opp-microvolt-<name> properties, then opp-microvolt property shall be used, if + present. + - opp-microamp: The maximum current drawn by the device in microamperes considering system specific parameters (such as transients, process, aging, maximum operating temperature range etc.) as necessary. This may be used to @@ -112,6 +120,9 @@ properties. for few regulators, then this should be marked as zero for them. If it isn't required for any regulator, then this property need not be present.
+- opp-microamp-<name>: Named opp-microamp property. Similar to + opp-microvolt-<name> property, but for microamp instead. + - clock-latency-ns: Specifies the maximum possible transition latency (in nanoseconds) for switching to this OPP from any other OPP.
@@ -120,9 +131,15 @@ properties. frequency for a short duration of time limited by the device's power, current and thermal limits.
+- turbo-mode-<name>: Named turbo-mode property. Similar to opp-microvolt-<name> + property, but for turbo mode instead. + - opp-suspend: Marks the OPP to be used during device suspend. Only one OPP in the table should have this.
+- opp-suspend-<name>: Named opp-suspend property. Similar to + opp-microvolt-<name> property, but for suspend opp instead. + - opp-supported-hw: This enables us to select only a subset of OPPs from the larger OPP table, based on what version of the hardware we are running on. We still can't have multiple nodes with the same opp-hz value in OPP table. @@ -528,3 +545,44 @@ Example 6: opp-supported-hw }; }; }; + +Example 7: opp-microvolt-<name>, opp-microamp-<name>, turbo-mode-<name>, +opp-suspend-<name>: +(example: device with two possible microvolt ranges: slow and fast) + +/ { + cpus { + cpu@0 { + compatible = "arm,cortex-a7"; + ... + + operating-points-v2 = <&cpu0_opp_table>; + }; + }; + + cpu0_opp_table: opp_table0 { + compatible = "operating-points-v2"; + opp-shared; + + opp00 { + opp-hz = /bits/ 64 <1000000000>; + opp-microvolt-slow = <900000 915000 925000>; + opp-microvolt-fast = <970000 975000 985000>; + opp-microamp-slow = <70000>; + opp-microamp-fast = <71000>; + turbo-mode-slow; /* Will be used as turbo only if 'slow' is chosen */ + opp-suspend-slow; /* Will be used as suspend-opp only if 'slow' is chosen */ + }; + + opp01 { + opp-hz = /bits/ 64 <1200000000>; + opp-microvolt-slow = <900000 915000 925000>, /* Supply vcc0 */ + <910000 925000 935000>; /* Supply vcc1 */ + opp-microvolt-fast = <970000 975000 985000>, /* Supply vcc0 */ + <960000 965000 975000>; /* Supply vcc1 */ + opp-microamp = <70000>; /* Will be used for both slow/fast */ + turbo-mode; /* Always used as turbo */ + opp-suspend-fast; /* Will be used as suspend opp only if 'fast' is chosen */ + }; + }; +};
On Thu, Nov 05, 2015 at 07:11:53AM +0530, Viresh Kumar wrote:
Depending on the version of hardware or its properties, which are only known at runtime, various properties of the OPP can change. For example, an OPP with frequency 1.2 GHz, may have different voltage/current requirements based on the version of the hardware it is running on. Similarly, it may or may not be a turbo or suspend OPP on those circumstances.
In order to not replicate the same OPP tables for varying values of all such fields, this commit introduces the concept of opp-property-<name>. The <name> can be chosen by the platform at runtime, and OPPs will be initialized depending on that name string. Currently support is extended for the following properties:
- opp-microvolt-<name>
- opp-microamp-<name>
- turbo-mode-<name>
- opp-suspend-<name>
If the name string isn't provided by the platform, or if it is provided but doesn't match the properties present in the OPP node, we will fall back to the original properties without the -<name> string, if they are available.
Reviewed-by: Stephen Boyd sboyd@codeaurora.org Signed-off-by: Viresh Kumar viresh.kumar@linaro.org
Documentation/devicetree/bindings/opp/opp.txt | 58 +++++++++++++++++++++++++++ 1 file changed, 58 insertions(+)
diff --git a/Documentation/devicetree/bindings/opp/opp.txt b/Documentation/devicetree/bindings/opp/opp.txt index d072fa0ffbd4..61c6f25cf8e2 100644 --- a/Documentation/devicetree/bindings/opp/opp.txt +++ b/Documentation/devicetree/bindings/opp/opp.txt @@ -100,6 +100,14 @@ properties. Entries for multiple regulators must be present in the same order as regulators are specified in device's DT node. +- opp-microvolt-<name>: Named opp-microvolt property. This is exactly similar to
- the above opp-microvolt property, but allows multiple voltage ranges to be
- provided for the same OPP. At runtime, the platform can pick a <name> and
- matching opp-microvolt-<name> property will be enabled for all OPPs. If the
- platform doesn't pick a specific <name> or the <name> doesn't match with any
- opp-microvolt-<name> properties, then opp-microvolt property shall be used, if
- present.
- opp-microamp: The maximum current drawn by the device in microamperes considering system specific parameters (such as transients, process, aging, maximum operating temperature range etc.) as necessary. This may be used to
@@ -112,6 +120,9 @@ properties. for few regulators, then this should be marked as zero for them. If it isn't required for any regulator, then this property need not be present. +- opp-microamp-<name>: Named opp-microamp property. Similar to
- opp-microvolt-<name> property, but for microamp instead.
- clock-latency-ns: Specifies the maximum possible transition latency (in nanoseconds) for switching to this OPP from any other OPP.
@@ -120,9 +131,15 @@ properties. frequency for a short duration of time limited by the device's power, current and thermal limits. +- turbo-mode-<name>: Named turbo-mode property. Similar to opp-microvolt-<name>
- property, but for turbo mode instead.
- opp-suspend: Marks the OPP to be used during device suspend. Only one OPP in the table should have this.
+- opp-suspend-<name>: Named opp-suspend property. Similar to
- opp-microvolt-<name> property, but for suspend opp instead.
I don't think these last 2 make sense. turbo-mode is a flag that the mode has restrictions such as other cores have to be idle or something. Similarly, opp-suspend should not vary by <name>.
Rob
On 04-11-15, 21:02, Rob Herring wrote:
+- turbo-mode-<name>: Named turbo-mode property. Similar to opp-microvolt-<name>
- property, but for turbo mode instead.
- opp-suspend: Marks the OPP to be used during device suspend. Only one OPP in the table should have this.
+- opp-suspend-<name>: Named opp-suspend property. Similar to
- opp-microvolt-<name> property, but for suspend opp instead.
I don't think these last 2 make sense. turbo-mode is a flag that the mode has restrictions such as other cores have to be idle or something. Similarly, opp-suspend should not vary by <name>.
Based on what version of the hardware you are running, via opp-supported-hw property, the platform can enable a different set of OPPs. And in that case we may want to select different OPPs marked as turbo or suspend freq. That's what I thought at least.
For example, on version A of the hardware we have following available frequencies: 800, 1000, 1100, 1200 MHz. Where 800 MHz is the suspend freq and 1200 is the turbo one.
But on a slightly different version of hardware B, we have two more OPPs available: 700 and 1400 MHz. And in that case we want the suspend freq to be 700 and turbo OPP to be only 1400 MHz.
On Wed, Nov 4, 2015 at 9:19 PM, Viresh Kumar viresh.kumar@linaro.org wrote:
On 04-11-15, 21:02, Rob Herring wrote:
+- turbo-mode-<name>: Named turbo-mode property. Similar to opp-microvolt-<name>
- property, but for turbo mode instead.
- opp-suspend: Marks the OPP to be used during device suspend. Only one OPP in the table should have this.
+- opp-suspend-<name>: Named opp-suspend property. Similar to
- opp-microvolt-<name> property, but for suspend opp instead.
I don't think these last 2 make sense. turbo-mode is a flag that the mode has restrictions such as other cores have to be idle or something. Similarly, opp-suspend should not vary by <name>.
Based on what version of the hardware you are running, via opp-supported-hw property, the platform can enable a different set of OPPs. And in that case we may want to select different OPPs marked as turbo or suspend freq. That's what I thought at least.
For example, on version A of the hardware we have following available frequencies: 800, 1000, 1100, 1200 MHz. Where 800 MHz is the suspend freq and 1200 is the turbo one.
But on a slightly different version of hardware B, we have two more OPPs available: 700 and 1400 MHz. And in that case we want the suspend freq to be 700 and turbo OPP to be only 1400 MHz.
But different frequencies are different OPP nodes (since that is the unit address now), so it is not going to hurt to set turbo-mode on both 1200 and 1400.
Rob
-- viresh
On 05-11-15, 17:33, Rob Herring wrote:
On Wed, Nov 4, 2015 at 9:19 PM, Viresh Kumar viresh.kumar@linaro.org wrote:
On 04-11-15, 21:02, Rob Herring wrote:
+- turbo-mode-<name>: Named turbo-mode property. Similar to opp-microvolt-<name>
- property, but for turbo mode instead.
- opp-suspend: Marks the OPP to be used during device suspend. Only one OPP in the table should have this.
+- opp-suspend-<name>: Named opp-suspend property. Similar to
- opp-microvolt-<name> property, but for suspend opp instead.
I don't think these last 2 make sense. turbo-mode is a flag that the mode has restrictions such as other cores have to be idle or something. Similarly, opp-suspend should not vary by <name>.
Based on what version of the hardware you are running, via opp-supported-hw property, the platform can enable a different set of OPPs. And in that case we may want to select different OPPs marked as turbo or suspend freq. That's what I thought at least.
For example, on version A of the hardware we have following available frequencies: 800, 1000, 1100, 1200 MHz. Where 800 MHz is the suspend freq and 1200 is the turbo one.
But on a slightly different version of hardware B, we have two more OPPs available: 700 and 1400 MHz. And in that case we want the suspend freq to be 700 and turbo OPP to be only 1400 MHz.
But different frequencies are different OPP nodes (since that is the unit address now), so it is not going to hurt to set turbo-mode on both 1200 and 1400.
Yeah, but in that case 1200 *may* not be a turbo frequency anymore, as the voltage constraints might have changed.
So turbo frequency is something that should be used only in small bursts, as they are consume lot of power. They aren't available to be used freely. They may also have thermal side effects..
In a similar way, for suspend-freq, we may or may not want the lowest frequency to be used during suspend and so that can change as well. And we shouldn't have suspend-freq set for two OPP nodes.
On 06-11-15, 07:23, Viresh Kumar wrote:
Yeah, but in that case 1200 *may* not be a turbo frequency anymore, as the voltage constraints might have changed.
So turbo frequency is something that should be used only in small bursts, as they are consume lot of power. They aren't available to be used freely. They may also have thermal side effects..
In a similar way, for suspend-freq, we may or may not want the lowest frequency to be used during suspend and so that can change as well. And we shouldn't have suspend-freq set for two OPP nodes.
@Rob: Does my comments make any sense now? Or you still think we are doing something wrong here?
On Tue, Nov 10, 2015 at 8:55 AM, Viresh Kumar viresh.kumar@linaro.org wrote:
On 06-11-15, 07:23, Viresh Kumar wrote:
Yeah, but in that case 1200 *may* not be a turbo frequency anymore, as the voltage constraints might have changed.
So turbo frequency is something that should be used only in small bursts, as they are consume lot of power. They aren't available to be used freely. They may also have thermal side effects..
In a similar way, for suspend-freq, we may or may not want the lowest frequency to be used during suspend and so that can change as well. And we shouldn't have suspend-freq set for two OPP nodes.
@Rob: Does my comments make any sense now? Or you still think we are doing something wrong here?
What you said could be possible, but I'm still doubtful. I would drop these until you have an actual user.
Rob
These aren't used until now by any DT files and wouldn't be used now as we have a better scheme in place now, i.e. opp-property-<name> properties.
Remove the (useless) binding without breaking ABI.
Reviewed-by: Stephen Boyd sboyd@codeaurora.org Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- Documentation/devicetree/bindings/opp/opp.txt | 62 +-------------------------- 1 file changed, 2 insertions(+), 60 deletions(-)
diff --git a/Documentation/devicetree/bindings/opp/opp.txt b/Documentation/devicetree/bindings/opp/opp.txt index 61c6f25cf8e2..30c4bb3718bc 100644 --- a/Documentation/devicetree/bindings/opp/opp.txt +++ b/Documentation/devicetree/bindings/opp/opp.txt @@ -45,21 +45,10 @@ Devices supporting OPPs must set their "operating-points-v2" property with phandle to a OPP table in their DT node. The OPP core will use this phandle to find the operating points for the device.
-Devices may want to choose OPP tables at runtime and so can provide a list of -phandles here. But only *one* of them should be chosen at runtime. This must be -accompanied by a corresponding "operating-points-names" property, to uniquely -identify the OPP tables. - If required, this can be extended for SoC vendor specfic bindings. Such bindings should be documented as Documentation/devicetree/bindings/power/<vendor>-opp.txt and should have a compatible description like: "operating-points-v2-<vendor>".
-Optional properties: -- operating-points-names: Names of OPP tables (required if multiple OPP - tables are present), to uniquely identify them. The same list must be present - for all the CPUs which are sharing clock/voltage rails and hence the OPP - tables. - * OPP Table Node
This describes the OPPs belonging to a device. This node can have following @@ -454,54 +443,7 @@ Example 4: Handling multiple regulators }; };
-Example 5: Multiple OPP tables - -/ { - cpus { - cpu@0 { - compatible = "arm,cortex-a7"; - ... - - cpu-supply = <&cpu_supply> - operating-points-v2 = <&cpu0_opp_table_slow>, <&cpu0_opp_table_fast>; - operating-points-names = "slow", "fast"; - }; - }; - - cpu0_opp_table_slow: opp_table_slow { - compatible = "operating-points-v2"; - status = "okay"; - opp-shared; - - opp00 { - opp-hz = /bits/ 64 <600000000>; - ... - }; - - opp01 { - opp-hz = /bits/ 64 <800000000>; - ... - }; - }; - - cpu0_opp_table_fast: opp_table_fast { - compatible = "operating-points-v2"; - status = "okay"; - opp-shared; - - opp10 { - opp-hz = /bits/ 64 <1000000000>; - ... - }; - - opp11 { - opp-hz = /bits/ 64 <1100000000>; - ... - }; - }; -}; - -Example 6: opp-supported-hw +Example 5: opp-supported-hw (example: three level hierarchy of versions: cuts, substrate and process)
/ { @@ -546,7 +488,7 @@ Example 6: opp-supported-hw }; };
-Example 7: opp-microvolt-<name>, opp-microamp-<name>, turbo-mode-<name>, +Example 6: opp-microvolt-<name>, opp-microamp-<name>, turbo-mode-<name>, opp-suspend-<name>: (example: device with two possible microvolt ranges: slow and fast)
On Thu, Nov 05, 2015 at 07:11:54AM +0530, Viresh Kumar wrote:
These aren't used until now by any DT files and wouldn't be used now as we have a better scheme in place now, i.e. opp-property-<name> properties.
Remove the (useless) binding without breaking ABI.
Reviewed-by: Stephen Boyd sboyd@codeaurora.org Signed-off-by: Viresh Kumar viresh.kumar@linaro.org
Acked-by: Rob Herring robh@kernel.org
Documentation/devicetree/bindings/opp/opp.txt | 62 +-------------------------- 1 file changed, 2 insertions(+), 60 deletions(-)
diff --git a/Documentation/devicetree/bindings/opp/opp.txt b/Documentation/devicetree/bindings/opp/opp.txt index 61c6f25cf8e2..30c4bb3718bc 100644 --- a/Documentation/devicetree/bindings/opp/opp.txt +++ b/Documentation/devicetree/bindings/opp/opp.txt @@ -45,21 +45,10 @@ Devices supporting OPPs must set their "operating-points-v2" property with phandle to a OPP table in their DT node. The OPP core will use this phandle to find the operating points for the device. -Devices may want to choose OPP tables at runtime and so can provide a list of -phandles here. But only *one* of them should be chosen at runtime. This must be -accompanied by a corresponding "operating-points-names" property, to uniquely -identify the OPP tables.
If required, this can be extended for SoC vendor specfic bindings. Such bindings should be documented as Documentation/devicetree/bindings/power/<vendor>-opp.txt and should have a compatible description like: "operating-points-v2-<vendor>". -Optional properties: -- operating-points-names: Names of OPP tables (required if multiple OPP
- tables are present), to uniquely identify them. The same list must be present
- for all the CPUs which are sharing clock/voltage rails and hence the OPP
- tables.
- OPP Table Node
This describes the OPPs belonging to a device. This node can have following @@ -454,54 +443,7 @@ Example 4: Handling multiple regulators }; }; -Example 5: Multiple OPP tables
-/ {
- cpus {
cpu@0 {
compatible = "arm,cortex-a7";
...
cpu-supply = <&cpu_supply>
operating-points-v2 = <&cpu0_opp_table_slow>, <&cpu0_opp_table_fast>;
operating-points-names = "slow", "fast";
};
- };
- cpu0_opp_table_slow: opp_table_slow {
compatible = "operating-points-v2";
status = "okay";
opp-shared;
opp00 {
opp-hz = /bits/ 64 <600000000>;
...
};
opp01 {
opp-hz = /bits/ 64 <800000000>;
...
};
- };
- cpu0_opp_table_fast: opp_table_fast {
compatible = "operating-points-v2";
status = "okay";
opp-shared;
opp10 {
opp-hz = /bits/ 64 <1000000000>;
...
};
opp11 {
opp-hz = /bits/ 64 <1100000000>;
...
};
- };
-};
-Example 6: opp-supported-hw +Example 5: opp-supported-hw (example: three level hierarchy of versions: cuts, substrate and process) / { @@ -546,7 +488,7 @@ Example 6: opp-supported-hw }; }; -Example 7: opp-microvolt-<name>, opp-microamp-<name>, turbo-mode-<name>, +Example 6: opp-microvolt-<name>, opp-microamp-<name>, turbo-mode-<name>, opp-suspend-<name>: (example: device with two possible microvolt ranges: slow and fast) -- 2.6.2.198.g614a2ac
It would be better to name OPP nodes as opp@<opp-hz> as that will ensure that multiple DT nodes don't contain the same frequency. Of course we expect the writer to name the node with its opp-hz frequency and not any other frequency.
And that will let the compile error out if multiple nodes are using the same opp-hz frequency.
Suggested-by: Stephen Boyd sboyd@codeaurora.org Reviewed-by: Stephen Boyd sboyd@codeaurora.org Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- Documentation/devicetree/bindings/opp/opp.txt | 38 +++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/Documentation/devicetree/bindings/opp/opp.txt b/Documentation/devicetree/bindings/opp/opp.txt index 30c4bb3718bc..10ef08dc1b4c 100644 --- a/Documentation/devicetree/bindings/opp/opp.txt +++ b/Documentation/devicetree/bindings/opp/opp.txt @@ -183,20 +183,20 @@ Example 1: Single cluster Dual-core ARM cortex A9, switch DVFS states together. compatible = "operating-points-v2"; opp-shared;
- opp00 { + opp@1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <970000 975000 985000>; opp-microamp = <70000>; clock-latency-ns = <300000>; opp-suspend; }; - opp01 { + opp@1100000000 { opp-hz = /bits/ 64 <1100000000>; opp-microvolt = <980000 1000000 1010000>; opp-microamp = <80000>; clock-latency-ns = <310000>; }; - opp02 { + opp@1200000000 { opp-hz = /bits/ 64 <1200000000>; opp-microvolt = <1025000>; clock-latency-ns = <290000>; @@ -262,20 +262,20 @@ independently. * independently. */
- opp00 { + opp@1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <970000 975000 985000>; opp-microamp = <70000>; clock-latency-ns = <300000>; opp-suspend; }; - opp01 { + opp@1100000000 { opp-hz = /bits/ 64 <1100000000>; opp-microvolt = <980000 1000000 1010000>; opp-microamp = <80000>; clock-latency-ns = <310000>; }; - opp02 { + opp@1200000000 { opp-hz = /bits/ 64 <1200000000>; opp-microvolt = <1025000>; opp-microamp = <90000; @@ -338,20 +338,20 @@ DVFS state together. compatible = "operating-points-v2"; opp-shared;
- opp00 { + opp@1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <970000 975000 985000>; opp-microamp = <70000>; clock-latency-ns = <300000>; opp-suspend; }; - opp01 { + opp@1100000000 { opp-hz = /bits/ 64 <1100000000>; opp-microvolt = <980000 1000000 1010000>; opp-microamp = <80000>; clock-latency-ns = <310000>; }; - opp02 { + opp@1200000000 { opp-hz = /bits/ 64 <1200000000>; opp-microvolt = <1025000>; opp-microamp = <90000>; @@ -364,20 +364,20 @@ DVFS state together. compatible = "operating-points-v2"; opp-shared;
- opp10 { + opp@1300000000 { opp-hz = /bits/ 64 <1300000000>; opp-microvolt = <1045000 1050000 1055000>; opp-microamp = <95000>; clock-latency-ns = <400000>; opp-suspend; }; - opp11 { + opp@1400000000 { opp-hz = /bits/ 64 <1400000000>; opp-microvolt = <1075000>; opp-microamp = <100000>; clock-latency-ns = <400000>; }; - opp12 { + opp@1500000000 { opp-hz = /bits/ 64 <1500000000>; opp-microvolt = <1010000 1100000 1110000>; opp-microamp = <95000>; @@ -404,7 +404,7 @@ Example 4: Handling multiple regulators compatible = "operating-points-v2"; opp-shared;
- opp00 { + opp@1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <970000>, /* Supply 0 */ <960000>, /* Supply 1 */ @@ -417,7 +417,7 @@ Example 4: Handling multiple regulators
/* OR */
- opp00 { + opp@1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <970000 975000 985000>, /* Supply 0 */ <960000 965000 975000>, /* Supply 1 */ @@ -430,7 +430,7 @@ Example 4: Handling multiple regulators
/* OR */
- opp00 { + opp@1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <970000 975000 985000>, /* Supply 0 */ <960000 965000 975000>, /* Supply 1 */ @@ -462,7 +462,7 @@ Example 5: opp-supported-hw status = "okay"; opp-shared;
- opp00 { + opp@600000000 { /* * Supports all substrate and process versions for 0xF * cuts, i.e. only first four cuts. @@ -473,7 +473,7 @@ Example 5: opp-supported-hw ... };
- opp01 { + opp@800000000 { /* * Supports: * - cuts: only one, 6th cut (represented by 6th bit). @@ -506,7 +506,7 @@ Example 6: opp-microvolt-<name>, opp-microamp-<name>, turbo-mode-<name>, compatible = "operating-points-v2"; opp-shared;
- opp00 { + opp@1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt-slow = <900000 915000 925000>; opp-microvolt-fast = <970000 975000 985000>; @@ -516,7 +516,7 @@ Example 6: opp-microvolt-<name>, opp-microamp-<name>, turbo-mode-<name>, opp-suspend-slow; /* Will be used as suspend-opp only if 'slow' is chosen */ };
- opp01 { + opp@1200000000 { opp-hz = /bits/ 64 <1200000000>; opp-microvolt-slow = <900000 915000 925000>, /* Supply vcc0 */ <910000 925000 935000>; /* Supply vcc1 */
On Thu, Nov 05, 2015 at 07:11:55AM +0530, Viresh Kumar wrote:
It would be better to name OPP nodes as opp@<opp-hz> as that will ensure that multiple DT nodes don't contain the same frequency. Of course we expect the writer to name the node with its opp-hz frequency and not any other frequency.
And that will let the compile error out if multiple nodes are using the same opp-hz frequency.
Suggested-by: Stephen Boyd sboyd@codeaurora.org Reviewed-by: Stephen Boyd sboyd@codeaurora.org Signed-off-by: Viresh Kumar viresh.kumar@linaro.org
Acked-by: Rob Herring robh@kernel.org
Documentation/devicetree/bindings/opp/opp.txt | 38 +++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/Documentation/devicetree/bindings/opp/opp.txt b/Documentation/devicetree/bindings/opp/opp.txt index 30c4bb3718bc..10ef08dc1b4c 100644 --- a/Documentation/devicetree/bindings/opp/opp.txt +++ b/Documentation/devicetree/bindings/opp/opp.txt @@ -183,20 +183,20 @@ Example 1: Single cluster Dual-core ARM cortex A9, switch DVFS states together. compatible = "operating-points-v2"; opp-shared;
opp00 {
};opp@1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <970000 975000 985000>; opp-microamp = <70000>; clock-latency-ns = <300000>; opp-suspend;
opp01 {
};opp@1100000000 { opp-hz = /bits/ 64 <1100000000>; opp-microvolt = <980000 1000000 1010000>; opp-microamp = <80000>; clock-latency-ns = <310000>;
opp02 {
opp@1200000000 { opp-hz = /bits/ 64 <1200000000>; opp-microvolt = <1025000>; clock-latency-ns = <290000>;
@@ -262,20 +262,20 @@ independently. * independently. */
opp00 {
};opp@1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <970000 975000 985000>; opp-microamp = <70000>; clock-latency-ns = <300000>; opp-suspend;
opp01 {
};opp@1100000000 { opp-hz = /bits/ 64 <1100000000>; opp-microvolt = <980000 1000000 1010000>; opp-microamp = <80000>; clock-latency-ns = <310000>;
opp02 {
opp@1200000000 { opp-hz = /bits/ 64 <1200000000>; opp-microvolt = <1025000>; opp-microamp = <90000;
@@ -338,20 +338,20 @@ DVFS state together. compatible = "operating-points-v2"; opp-shared;
opp00 {
};opp@1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <970000 975000 985000>; opp-microamp = <70000>; clock-latency-ns = <300000>; opp-suspend;
opp01 {
};opp@1100000000 { opp-hz = /bits/ 64 <1100000000>; opp-microvolt = <980000 1000000 1010000>; opp-microamp = <80000>; clock-latency-ns = <310000>;
opp02 {
opp@1200000000 { opp-hz = /bits/ 64 <1200000000>; opp-microvolt = <1025000>; opp-microamp = <90000>;
@@ -364,20 +364,20 @@ DVFS state together. compatible = "operating-points-v2"; opp-shared;
opp10 {
};opp@1300000000 { opp-hz = /bits/ 64 <1300000000>; opp-microvolt = <1045000 1050000 1055000>; opp-microamp = <95000>; clock-latency-ns = <400000>; opp-suspend;
opp11 {
};opp@1400000000 { opp-hz = /bits/ 64 <1400000000>; opp-microvolt = <1075000>; opp-microamp = <100000>; clock-latency-ns = <400000>;
opp12 {
opp@1500000000 { opp-hz = /bits/ 64 <1500000000>; opp-microvolt = <1010000 1100000 1110000>; opp-microamp = <95000>;
@@ -404,7 +404,7 @@ Example 4: Handling multiple regulators compatible = "operating-points-v2"; opp-shared;
opp00 {
opp@1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <970000>, /* Supply 0 */ <960000>, /* Supply 1 */
@@ -417,7 +417,7 @@ Example 4: Handling multiple regulators /* OR */
opp00 {
opp@1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <970000 975000 985000>, /* Supply 0 */ <960000 965000 975000>, /* Supply 1 */
@@ -430,7 +430,7 @@ Example 4: Handling multiple regulators /* OR */
opp00 {
opp@1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <970000 975000 985000>, /* Supply 0 */ <960000 965000 975000>, /* Supply 1 */
@@ -462,7 +462,7 @@ Example 5: opp-supported-hw status = "okay"; opp-shared;
opp00 {
opp@600000000 { /* * Supports all substrate and process versions for 0xF * cuts, i.e. only first four cuts.
@@ -473,7 +473,7 @@ Example 5: opp-supported-hw ... };
opp01 {
opp@800000000 { /* * Supports: * - cuts: only one, 6th cut (represented by 6th bit).
@@ -506,7 +506,7 @@ Example 6: opp-microvolt-<name>, opp-microamp-<name>, turbo-mode-<name>, compatible = "operating-points-v2"; opp-shared;
opp00 {
opp@1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt-slow = <900000 915000 925000>; opp-microvolt-fast = <970000 975000 985000>;
@@ -516,7 +516,7 @@ Example 6: opp-microvolt-<name>, opp-microamp-<name>, turbo-mode-<name>, opp-suspend-slow; /* Will be used as suspend-opp only if 'slow' is chosen */ };
opp01 {
opp@1200000000 { opp-hz = /bits/ 64 <1200000000>; opp-microvolt-slow = <900000 915000 925000>, /* Supply vcc0 */ <910000 925000 935000>; /* Supply vcc1 */
-- 2.6.2.198.g614a2ac
OPP bindings got updated to name OPP nodes this way, make changes according to that.
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- arch/arm/boot/dts/exynos4412.dtsi | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/arch/arm/boot/dts/exynos4412.dtsi b/arch/arm/boot/dts/exynos4412.dtsi index 294cfe40388d..40beede46e55 100644 --- a/arch/arm/boot/dts/exynos4412.dtsi +++ b/arch/arm/boot/dts/exynos4412.dtsi @@ -64,73 +64,73 @@ compatible = "operating-points-v2"; opp-shared;
- opp00 { + opp@200000000 { opp-hz = /bits/ 64 <200000000>; opp-microvolt = <900000>; clock-latency-ns = <200000>; }; - opp01 { + opp@300000000 { opp-hz = /bits/ 64 <300000000>; opp-microvolt = <900000>; clock-latency-ns = <200000>; }; - opp02 { + opp@400000000 { opp-hz = /bits/ 64 <400000000>; opp-microvolt = <925000>; clock-latency-ns = <200000>; }; - opp03 { + opp@500000000 { opp-hz = /bits/ 64 <500000000>; opp-microvolt = <950000>; clock-latency-ns = <200000>; }; - opp04 { + opp@600000000 { opp-hz = /bits/ 64 <600000000>; opp-microvolt = <975000>; clock-latency-ns = <200000>; }; - opp05 { + opp@700000000 { opp-hz = /bits/ 64 <700000000>; opp-microvolt = <987500>; clock-latency-ns = <200000>; }; - opp06 { + opp@800000000 { opp-hz = /bits/ 64 <800000000>; opp-microvolt = <1000000>; clock-latency-ns = <200000>; opp-suspend; }; - opp07 { + opp@900000000 { opp-hz = /bits/ 64 <900000000>; opp-microvolt = <1037500>; clock-latency-ns = <200000>; }; - opp08 { + opp@1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <1087500>; clock-latency-ns = <200000>; }; - opp09 { + opp@1100000000 { opp-hz = /bits/ 64 <1100000000>; opp-microvolt = <1137500>; clock-latency-ns = <200000>; }; - opp10 { + opp@1200000000 { opp-hz = /bits/ 64 <1200000000>; opp-microvolt = <1187500>; clock-latency-ns = <200000>; }; - opp11 { + opp@1300000000 { opp-hz = /bits/ 64 <1300000000>; opp-microvolt = <1250000>; clock-latency-ns = <200000>; }; - opp12 { + opp@1400000000 { opp-hz = /bits/ 64 <1400000000>; opp-microvolt = <1287500>; clock-latency-ns = <200000>; }; - opp13 { + opp@1500000000 { opp-hz = /bits/ 64 <1500000000>; opp-microvolt = <1350000>; clock-latency-ns = <200000>;
On 05.11.2015 10:41, Viresh Kumar wrote:
OPP bindings got updated to name OPP nodes this way, make changes according to that.
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org
arch/arm/boot/dts/exynos4412.dtsi | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
I see this patch does not depend on the rest of patchset so I presume this can co through samsung-soc?
Reviewed-by: Krzysztof Kozlowski k.kozlowski@samsung.com
Best regards, Krzysztof
On 05-11-15, 10:51, Krzysztof Kozlowski wrote:
I see this patch does not depend on the rest of patchset so I presume this can co through samsung-soc?
Yeah, I wouldn't mind that. But I would wait for a confirmation from Rafael for the bindings first, for an unlikely case where he doesn't like the fourth patch ;)
On Thursday, November 05, 2015 07:11:51 AM Viresh Kumar wrote:
Hi Rafael,
All the bindings are Reviewed by Stephen now and Rob didn't had a problem with them (though he didn't Ack them separately yet) :)
The first patch enables us to select only a subset of OPPs from the bigger table, based on what version of the hardware we are running on.
The second one enables us to select slightly different values for multiple properties, based on what kind of hardware they are running on.
The third one removes an (unused) binding, which is replaced by the second patch with a better solution.
The fourth patch is based on what Stephen suggested (and then reviewed) in the earlier series, and the 5th one updates the existing users of these bindings for it.
Viresh Kumar (5): PM / OPP: Add "opp-supported-hw" binding PM / OPP: Add {opp-microvolt|opp-microamp|turbo-mode|opp-suspend}-<name> binding PM / OPP: Remove 'operating-points-names' binding PM / OPP: Rename OPP nodes as opp@<opp-hz> ARM: dts: exynos4412: Rename OPP nodes as opp@<opp-hz>
Documentation/devicetree/bindings/opp/opp.txt | 143 +++++++++++++++++++------- arch/arm/boot/dts/exynos4412.dtsi | 28 ++--- 2 files changed, 118 insertions(+), 53 deletions(-)
So this clearly is a new feature and it clearly missed the merge window boundary for v4.4. I can queue it up for v4.5.
Thanks, Rafael
linaro-kernel@lists.linaro.org