Skip to contentSkip to conversation

OPP: Allow OPP table to be used for power-domains

RFC Superseded Viresh Kumar 4 participants 25 messages Oct 31, 2017 – Dec 28, 2017

Subsystems (3)

v7 of 13 Superseded Latest is v13 →

lore
Share & tools
lore
#0 lore raw

v7 cover OPP: Allow OPP table to be used for power-domains

Hi,

Now that the performance state of PM domains are supported by the kernel (merged in linux-next), I am trying once again to define the bindings which we dropped until the code is merged first.

This is targeted for 4.16 kernel and I am sending it now to get early reviews.

The bindings in this series have changed a bit since the time it was last sent for review [1].

I have taken care of most of the feedback given last time.

Summary:

Power-domains can also have their active states and this patchset enhances the OPP binding to define those.

The power domains can use the OPP bindings mostly as is. Though there are some changes required to support special cases:

- Allow "operating-points-v2" to contain multiple phandles for power domain providers providing multiple domains.

- A new property "power-domain-opp" is added for devices to specify the minimum required OPP of the master domain for the functioning of the device. We can add this property directly to device's node if the device has a fixed minimum OPP requirement from the master power domain. Or we can add this property to each OPP node of the device, if different OPP nodes have different minimum OPP requirement from the master power domain.

- Allow some of the OPP properties to accept magic values (firmware dependent) as the OS doesn't know the real freq/voltage values.

--
viresh

[1] https://marc.info/?l=linux-kernel&m=149320428621874&w=2

Viresh Kumar (2):
OPP: Allow OPP table to be used for power-domains
OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

 Documentation/devicetree/bindings/opp/opp.txt      | 18 +++++++
 .../devicetree/bindings/power/power_domain.txt     | 62 ++++++++++++++++++++++
 2 files changed, 80 insertions(+)
Signature · 1 line
2.15.0.rc1.236.g92ea95045093
#1 lore raw

RFC v7 1/2 OPP: Allow OPP table to be used for power-domains

Power-domains can also have their active states and this patch enhances the OPP binding to define those.

The power domains can use the OPP bindings mostly as is. Though there are some changes required to support special cases:

- Allow "operating-points-v2" to contain multiple phandles for power domain providers providing multiple domains.

- A new property "power-domain-opp" is added for devices to specify the minimum required OPP of the master domain for the functioning of the device. We can add this property directly to device's node if the device has a fixed minimum OPP requirement from the master power domain. Or we can add this property to each OPP node of the device, if different OPP nodes have different minimum OPP requirement from the master power domain.

---
 Documentation/devicetree/bindings/opp/opp.txt      | 12 +++++
 .../devicetree/bindings/power/power_domain.txt     | 62 ++++++++++++++++++++++
 2 files changed, 74 insertions(+)
Documentation/devicetree/bindings/opp/opp.txt +12 -0
index 9d733af26be7..203e09fe7698 100644
@@ -45,6 +45,11 @@ 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.
 
+This can contain more than one phandle for power domain providers that provide
+multiple power domains. That is, one phandle for each power domain. If only one
+phandle is available, then the same OPP table will be used for all power domains
+provided by the power domain provider.
+
 If required, this can be extended for SoC vendor specific 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>".
@@ -154,6 +159,13 @@ properties.
 
 - status: Marks the node enabled/disabled.
 
+- power-domain-opp: This contains phandle to one of the OPP nodes of the master
+  power domain. This specifies the minimum required OPP of the master domain for
+  the functioning of the device in this OPP (where this property is present).
+  This property can only be set for a device if the device node contains the
+  "power-domains" property. Also, either all or none of the OPP nodes in an OPP
+  table should have it set.
+
 Example 1: Single cluster Dual-core ARM cortex A9, switch DVFS states together.
 
 / {
Documentation/devicetree/bindings/power/power_domain.txt +62 -0

72 lines not on this page · raw message

Signature · 1 line
2.15.0.rc1.236.g92ea95045093
#5 lore raw

RFC v7 2/2 OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

In reply to Viresh Kumar

On some platforms the exact frequency or voltage may be hidden from the OS by the firmware. Allow such configurations to pass magic values in the "opp-hz" or the "opp-microvolt" properties, which should be interpreted in a platform dependent way.

---
 Documentation/devicetree/bindings/opp/opp.txt | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/opp/opp.txt +6 -0
index 203e09fe7698..9c5056fb120f 100644
@@ -166,6 +166,12 @@ properties.
   "power-domains" property. Also, either all or none of the OPP nodes in an OPP
   table should have it set.
 
+
+On some platforms the exact frequency or voltage may be hidden from the OS by
+the firmware and the "opp-hz" or the "opp-microvolt" properties may contain
+magic values that represent the frequency or voltage in a firmware dependent
+way, for example an index of an array in the firmware.
+
 Example 1: Single cluster Dual-core ARM cortex A9, switch DVFS states together.
 
 / {
Signature · 6 lines
2.15.0.rc1.236.g92ea95045093

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw

Re: [RFC V7 2/2] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

Quoted 4 lines · Viresh Kumar

On some platforms the exact frequency or voltage may be hidden from the OS by the firmware. Allow such configurations to pass magic values in the "opp-hz" or the "opp-microvolt" properties, which should be interpreted in a platform dependent way.

Why not a new property for magic values? opp-magic? Don't we want to know when we have magic values?

Wouldn't magic values in opp-hz get propagated to user space? I can see the complaints now. "My 4GHz processor is running at 6Hz!" Just like people complain when BogoMIPS is not high enough.

Rob

#7 lore raw

Re: [RFC V7 2/2] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

Quoted 2 lines · Rob Herring

Why not a new property for magic values? opp-magic? Don't we want to know when we have magic values?

I have kept a separate property since beginning (domain-performance-state) and moved to using these magic values in the existing field because of the suggestion Kevin gave earlier.

https://marc.info/?l=linux-kernel&m=149306082218001&w=2

I am not sure what to do now :)

Quoted 1 line

Wouldn't magic values in opp-hz get propagated to user space?

The OPP core puts them in debugfs just to know how the OPPs are set. Otherwise, I am not sure that the power domain core/drivers would be exposing that to user space.

Quoted 3 lines

I can
see the complaints now. "My 4GHz processor is running at 6Hz!" Just like people complain when BogoMIPS is not high enough.

Hmm, would adding the right user type in bindings would be good enough for that? I mean, we can clearly add that only power-domains that are managed by firmware are allowed to use magic values here. But not sure if we should put such stuff in bindings.

--
viresh

#8 lore raw

Re: [RFC V7 2/2] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

Quoted 11 lines · Viresh Kumar
Quoted 2 lines · Rob Herring

Why not a new property for magic values? opp-magic? Don't we want to know when we have magic values?

I have kept a separate property since beginning (domain-performance-state) and moved to using these magic values in the existing field because of the suggestion Kevin gave earlier.

https://marc.info/?l=linux-kernel&m=149306082218001&w=2

I am not sure what to do now :)

Okay, I guess reusing the properties is fine.

Quoted 5 lines
Quoted 1 line

Wouldn't magic values in opp-hz get propagated to user space?

The OPP core puts them in debugfs just to know how the OPPs are set. Otherwise, I am not sure that the power domain core/drivers would be exposing that to user space.

I was thinking thru the cpufreq interface, but I guess this is not for cpus.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#9 lore raw

Re: [RFC V7 2/2] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

Quoted 9 lines · Rob Herring
Quoted 8 lines · Viresh Kumar
Quoted 2 lines · Rob Herring

Why not a new property for magic values? opp-magic? Don't we want to know when we have magic values?

I have kept a separate property since beginning (domain-performance-state) and moved to using these magic values in the existing field because of the suggestion Kevin gave earlier.

Quoted 6 lines
Quoted 3 lines

https://marc.info/?l=linux-kernel&m=149306082218001&w=2

I am not sure what to do now :)

Okay, I guess reusing the properties is fine.

We call them corners on qcom platforms. Any reason we can't keep using that name? I'd rather not have to keep telling people that these fake values in some misnamed property is actually a corner.

Signature · 6 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#21 lore raw

Re: [RFC V7 2/2] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

In reply to Rob Herring
Quoted 9 lines · Rob Herring
Quoted 8 lines · Viresh Kumar
Quoted 2 lines · Rob Herring

Why not a new property for magic values? opp-magic? Don't we want to know when we have magic values?

I have kept a separate property since beginning (domain-performance-state) and moved to using these magic values in the existing field because of the suggestion Kevin gave earlier.

Quoted 5 lines
Quoted 3 lines

https://marc.info/?l=linux-kernel&m=149306082218001&w=2

I am not sure what to do now :)

Okay, I guess reusing the properties is fine.

Okay, great.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Wouldn't magic values in opp-hz get propagated to user space?

The OPP core puts them in debugfs just to know how the OPPs are set. Otherwise, I am not sure that the power domain core/drivers would be exposing that to user space.

I was thinking thru the cpufreq interface, but I guess this is not for cpus.

Oh no. That's not the target here for sure.

Signature · 5 lines
viresh
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#10 lore raw

Re: [RFC V7 2/2] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

In reply to Stephen Boyd
Quoted 12 lines · Stephen Boyd
Quoted 11 lines · Rob Herring
Quoted 10 lines · Viresh Kumar
Quoted 2 lines · Rob Herring

Why not a new property for magic values? opp-magic? Don't we want to know when we have magic values?

I have kept a separate property since beginning (domain-performance-state) and moved to using these magic values in the existing field because of the suggestion Kevin gave earlier.

https://marc.info/?l=linux-kernel&m=149306082218001&w=2

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

I am not sure what to do now :)

Okay, I guess reusing the properties is fine.

We call them corners on qcom platforms. Any reason we can't keep using that name? I'd rather not have to keep telling people that these fake values in some misnamed property is actually a corner.

Surely not "corners", as these are platform and OS independent bindings we are talking about here. Even the kernel code shouldn't generally do that. Though your platform specific genpd driver can :)

Signature · 1 line
viresh
#11 lore raw

Re: [RFC V7 2/2] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

Quoted 18 lines · Viresh Kumar
Quoted 17 lines · Stephen Boyd
Quoted 15 lines · Rob Herring
Quoted 11 lines · Viresh Kumar
Quoted 2 lines · Rob Herring

Why not a new property for magic values? opp-magic? Don't we want to know when we have magic values?

I have kept a separate property since beginning (domain-performance-state) and moved to using these magic values in the existing field because of the suggestion Kevin gave earlier.

https://marc.info/?l=linux-kernel&m=149306082218001&w=2

I am not sure what to do now :)

Okay, I guess reusing the properties is fine.

Quoted 8 lines
Quoted 3 lines

We call them corners on qcom platforms. Any reason we can't keep using that name? I'd rather not have to keep telling people that these fake values in some misnamed property is actually a corner.

Surely not "corners", as these are platform and OS independent bindings we are talking about here. Even the kernel code shouldn't generally do that. Though your platform specific genpd driver can :)

Sorry I'm not following. We're going to need to have platform specific code that understands platform specific bindings that aren't shoved into the generic OPP bindings.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
#12 lore raw

Re: [RFC V7 2/2] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

Quoted 3 lines · Stephen Boyd

Sorry I'm not following. We're going to need to have platform specific code that understands platform specific bindings that aren't shoved into the generic OPP bindings.

At least I am not targeting any platform specific binding right now. The way I see this to work is:

- We will reuse earlier bindings and allow opp-hz and opp-microvolt to contain special values (this patch).
- Platform specific DT entries will put corner numbers in opp-hz (or opp-microvolt) fields.
- Some platform specific driver (in OPP or genpd) will be used to convert OPP into a performance state (corner) value. Now that can simply read opp-hz (or opp-microvolt) and return its value.
- OPP core will request for a performance state (code is already merged for that).

And so there is no platform specific binding here. Do you want to do this differently ?

Signature · 1 line
viresh
Reviewed-by on v7 1/2
#2 lore raw
In reply to Viresh Kumar
Quoted 6 lines · Viresh Kumar

Power-domains can also have their active states and this patch enhances the OPP binding to define those.

The power domains can use the OPP bindings mostly as is. Though there are some changes required to support special cases:

Quoted 7 lines

- Allow "operating-points-v2" to contain multiple phandles for power domain providers providing multiple domains.

- A new property "power-domain-opp" is added for devices to specify the minimum required OPP of the master domain for the functioning of the device. We can add this property directly to device's node if the device has a fixed minimum OPP requirement from the master power

Please avoid the terminology "master power domain", it's confusing. Instead use only "power domain". This applies to a couple of more places of $subject patch, please fix those as well.

Quoted 109 lines

domain. Or we can add this property to each OPP node of the device, if different OPP nodes have different minimum OPP requirement from the master power domain.

---
 Documentation/devicetree/bindings/opp/opp.txt      | 12 +++++
 .../devicetree/bindings/power/power_domain.txt     | 62 ++++++++++++++++++++++
 2 files changed, 74 insertions(+)
Documentation/devicetree/bindings/opp/opp.txt +12 -0
index 9d733af26be7..203e09fe7698 100644
@@ -45,6 +45,11 @@ 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.
 
+This can contain more than one phandle for power domain providers that provide
+multiple power domains. That is, one phandle for each power domain. If only one
+phandle is available, then the same OPP table will be used for all power domains
+provided by the power domain provider.
+
 If required, this can be extended for SoC vendor specific 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>".
@@ -154,6 +159,13 @@ properties.
 
 - status: Marks the node enabled/disabled.
 
+- power-domain-opp: This contains phandle to one of the OPP nodes of the master
+  power domain. This specifies the minimum required OPP of the master domain for
+  the functioning of the device in this OPP (where this property is present).
+  This property can only be set for a device if the device node contains the
+  "power-domains" property. Also, either all or none of the OPP nodes in an OPP
+  table should have it set.
+
 Example 1: Single cluster Dual-core ARM cortex A9, switch DVFS states together.
 
 / {
Documentation/devicetree/bindings/power/power_domain.txt +54 -0
index 14bd9e945ff6..0d8608f2d133 100644
@@ -40,6 +40,12 @@ phandle arguments (so called PM domain specifiers) of length specified by the
   domain's idle states. In the absence of this property, the domain would be
   considered as capable of being powered-on or powered-off.
 
+- operating-points-v2 : Phandles to the OPP tables of power domains provided by
+  a power domain provider. If the provider provides a single power domain only
+  or all the power domains provided by the provider have identical OPP tables,
+  then this shall contain a single phandle. Refer to ../opp/opp.txt for more
+  information.
+
 Example:
 
        power: power-controller@12340000 {
@@ -120,4 +126,60 @@ The node above defines a typical PM domain consumer device, which is located
 inside a PM domain with index 0 of a power controller represented by a node
 with the label "power".
 
+Optional properties:
+- power-domain-opp: This contains phandle to one of the OPP nodes of the master
+  power domain. This specifies the minimum required OPP of the master domain for
+  the functioning of the device. This property can only be set for a device, if
+  the device node contains the "power-domains" property.
+
+Example:
+- OPP table for domain provider that provides two domains.
+
+       domain0_opp_table: opp_table0 {
+               compatible = "operating-points-v2";
+
+               domain0_opp_0: opp-1000000000 {
+                       opp-hz = /bits/ 64 <1000000000>;
+                       opp-microvolt = <975000 970000 985000>;
+               };
+               domain0_opp_1: opp-1100000000 {
+                       opp-hz = /bits/ 64 <1100000000>;
+                       opp-microvolt = <1000000 980000 1010000>;
+               };
+       };
+
+       domain1_opp_table: opp_table1 {
+               compatible = "operating-points-v2";
+
+               domain1_opp_0: opp-1200000000 {
+                       opp-hz = /bits/ 64 <1200000000>;
+                       opp-microvolt = <975000 970000 985000>;
+               };
+               domain1_opp_1: opp-1300000000 {
+                       opp-hz = /bits/ 64 <1300000000>;
+                       opp-microvolt = <1000000 980000 1010000>;
+               };
+       };
+
+       parent: power-controller@12340000 {
+               compatible = "foo,power-controller";
+               reg = <0x12340000 0x1000>;
+               #power-domain-cells = <1>;
+               operating-points-v2 = <&domain0_opp_table>, <&domain1_opp_table>;
+       };
+
+       leaky-device0@12350000 {
+               compatible = "foo,i-leak-current";
+               reg = <0x12350000 0x1000>;
+               power-domains = <&parent 0>;
+               power-domain-opp = <&domain0_opp_0>;
+       };

Documentation/devicetree/bindings/power/power_domain.txt The node above defines a typical PM domain consumer device, which is located

Quoted 10 lines
Documentation/devicetree/bindings/power/power_domain.txt +8 -1
+
+       leaky-device1@12350000 {
+               compatible = "foo,i-leak-current";
+               reg = <0x12350000 0x1000>;
+               power-domains = <&parent 1>;
+               power-domain-opp = <&domain1_opp_1>;
+       };
+
 [1]. Documentation/devicetree/bindings/power/domain-idle-state.txt
--

Besides the minor nitpick(s), this looks good to me. Feel free to add:

Kind regards
Uffe

Reviewed-by on v7 2/2
#22 lore raw

Re: [RFC V7 2/2] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

In reply to Viresh Kumar
Quoted 6 lines · Viresh Kumar

On some platforms the exact frequency or voltage may be hidden from the OS by the firmware. Allow such configurations to pass magic values in the "opp-hz" or the "opp-microvolt" properties, which should be interpreted in a platform dependent way.

This seems like a reasonable extension to me!

Kind regards
Uffe

Quoted 24 lines
---
 Documentation/devicetree/bindings/opp/opp.txt | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/opp/opp.txt +6 -1
index 203e09fe7698..9c5056fb120f 100644
@@ -166,6 +166,12 @@ properties.
   "power-domains" property. Also, either all or none of the OPP nodes in an OPP
   table should have it set.
 
+
+On some platforms the exact frequency or voltage may be hidden from the OS by
+the firmware and the "opp-hz" or the "opp-microvolt" properties may contain
+magic values that represent the frequency or voltage in a firmware dependent
+way, for example an index of an array in the firmware.
+
 Example 1: Single cluster Dual-core ARM cortex A9, switch DVFS states together.
 
 / {
--

2.15.0.rc1.236.g92ea95045093

#13 lore raw

Re: [RFC V7 2/2] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

In reply to Viresh Kumar
Quoted 8 lines · Viresh Kumar
Quoted 3 lines · Stephen Boyd

Sorry I'm not following. We're going to need to have platform specific code that understands platform specific bindings that aren't shoved into the generic OPP bindings.

At least I am not targeting any platform specific binding right now. The way I see this to work is:

Quoted 7 lines

- We will reuse earlier bindings and allow opp-hz and opp-microvolt to contain special values (this patch).
- Platform specific DT entries will put corner numbers in opp-hz (or opp-microvolt) fields.
- Some platform specific driver (in OPP or genpd) will be used to convert OPP into a performance state (corner) value. Now that can simply read opp-hz (or opp-microvolt) and return its value.

Since the "operating-points-v2" phandle(s) belongs in the power-domain controller device node, which anyway is being parsed by the genpd SoC specific driver, I assume it makes sense to start the initialization from there. Unless there is something that prevents that, of course.

Then whatever library/helper functions we need for parse and create the OPP tables, can be provided to the OPP framework and the OPP OF library.

Quoted 5 lines

- OPP core will request for a performance state (code is already merged for that).

And so there is no platform specific binding here. Do you want to do this differently ?

This makes sense to me!

Also, the SoC (QCOM) specific genpd driver is free to use the terminology "corner values", when it translates opp-hz|microvolt into such values.

Kind regards
Uffe
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#23 lore raw
In reply to Viresh Kumar
Quoted 5 lines · Viresh Kumar

Hi,

Now that the performance state of PM domains are supported by the kernel (merged in linux-next), I am trying once again to define the bindings which we dropped until the code is merged first.

@Rob/Stephen: Can I get Ack from you guys on this series, before I apply them? Ulf has already reviewed these.

Signature · 1 line
viresh
#24 lore raw
Quoted 9 lines · Viresh Kumar
Quoted 5 lines · Viresh Kumar

Hi,

Now that the performance state of PM domains are supported by the kernel (merged in linux-next), I am trying once again to define the bindings which we dropped until the code is merged first.

@Rob/Stephen: Can I get Ack from you guys on this series, before I apply them? Ulf has already reviewed these.

I don't ack RFCs. In any case, I'm waiting to see what Stephen says.

Rob

#3 lore raw
In reply to Viresh Kumar
Quoted 40 lines · Viresh Kumar

Power-domains can also have their active states and this patch enhances the OPP binding to define those.

The power domains can use the OPP bindings mostly as is. Though there are some changes required to support special cases:

- Allow "operating-points-v2" to contain multiple phandles for power domain providers providing multiple domains.

- A new property "power-domain-opp" is added for devices to specify the minimum required OPP of the master domain for the functioning of the device. We can add this property directly to device's node if the device has a fixed minimum OPP requirement from the master power domain. Or we can add this property to each OPP node of the device, if different OPP nodes have different minimum OPP requirement from the master power domain.

---
 Documentation/devicetree/bindings/opp/opp.txt      | 12 +++++
 .../devicetree/bindings/power/power_domain.txt     | 62 ++++++++++++++++++++++
 2 files changed, 74 insertions(+)
Documentation/devicetree/bindings/opp/opp.txt +5 -0
index 9d733af26be7..203e09fe7698 100644
@@ -45,6 +45,11 @@ 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.
 
+This can contain more than one phandle for power domain providers that provide
+multiple power domains. That is, one phandle for each power domain. If only one
+phandle is available, then the same OPP table will be used for all power domains
+provided by the power domain provider.
+
 If required, this can be extended for SoC vendor specific 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>".

Documentation/devicetree/bindings/opp/opp.txt properties. · line 167

Quoted 9 lines
Documentation/devicetree/bindings/opp/opp.txt +6 -0
@@ -154,6 +159,13 @@ properties.
 
 - status: Marks the node enabled/disabled.
 
+- power-domain-opp: This contains phandle to one of the OPP nodes of the master
+  power domain. This specifies the minimum required OPP of the master domain for
+  the functioning of the device in this OPP (where this property is present).
+  This property can only be set for a device if the device node contains the
+  "power-domains" property. Also, either all or none of the OPP nodes in an OPP
+  table should have it set.

This is a "this device requires OPP n" property. Couldn't we want this for cases other than a powerdomain OPP? What if a device has requirements 2 different OPPs?

On the flipside, I don't think we want devices picking things like CPU OPPs and putting policy here. But I'd rather things be extendable than reviewing yet another OPP property next month.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#14 lore raw

Re: [RFC V7 2/2] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

In reply to Ulf Hansson
Quoted 29 lines · Ulf Hansson
Quoted 8 lines · Viresh Kumar
Quoted 3 lines · Stephen Boyd

Sorry I'm not following. We're going to need to have platform specific code that understands platform specific bindings that aren't shoved into the generic OPP bindings.

At least I am not targeting any platform specific binding right now. The way I see this to work is:

Quoted 7 lines

- We will reuse earlier bindings and allow opp-hz and opp-microvolt to contain special values (this patch).
- Platform specific DT entries will put corner numbers in opp-hz (or opp-microvolt) fields.
- Some platform specific driver (in OPP or genpd) will be used to convert OPP into a performance state (corner) value. Now that can simply read opp-hz (or opp-microvolt) and return its value.

Since the "operating-points-v2" phandle(s) belongs in the power-domain controller device node, which anyway is being parsed by the genpd SoC specific driver, I assume it makes sense to start the initialization from there. Unless there is something that prevents that, of course.

Then whatever library/helper functions we need for parse and create the OPP tables, can be provided to the OPP framework and the OPP OF library.

Quoted 3 lines

- OPP core will request for a performance state (code is already merged for that).

Quoted 9 lines
Quoted 2 lines

And so there is no platform specific binding here. Do you want to do this differently ?

This makes sense to me!

Also, the SoC (QCOM) specific genpd driver is free to use the terminology "corner values", when it translates opp-hz|microvolt into such values.

Sorry it still makes zero sense to me. It seems that we're trying to make the OPP table parsing generic just for the sake of code brevity. Is this the goal? From a DT writer perspective it seems confusing to say that opp-microvolt is sometimes a microvolt and sometimes not a microvolt. Why can't the SoC specific genpd driver parse something like "qcom,corner" instead out of the node?

BTW, I don't believe I have a use-case where I want to express power domain OPP tables. I have many devices that all have different frequencies that are all tied into the same power domain. This binding makes it look like we can only have one frequency per domain which won't work.

I want to express that a device with a range of frequencies (or really multiple ranges of frequencies) is inside certain physical power domains and the frequency of the clks dictates the minimum voltage requirement of those power domains.

For the most complicated case, imagine something like our eMMC controller that has two clks (clk1,clk2) that it changes the rate of independently and those two clks rely on two different regulators (vreg1, vreg2) that supply voltage domains in the SoC which the eMMC controller happens to be part of (pd1, pd2). And the device is also part of another power domain that we use to turn everything off (pd3).

 +-------+                                 +-------+
 | vreg1 |                                 | vreg2 |
 +---+---+                                 +----+--+
     |                                          |
     |     +------------+-------------+         |
     |     | +-------+  |  +--------+ |         |
     +-----> | clk1  |  |  |  clk2  | <---------+
           | +---+---+  |  +----+---+ |
           |     |      |       |     |
      +----------v--------------v-----------+
      |    |            |             |     |
      |    |            |             |     |
      |    |   pd1      |     pd2     |     |
      |    |            |             |     |
      |    +------------+-------------+     |
      |                                     |
      |  pd3                          eMMC  |
      +-------------------------------------+
Quoted 1 line

From a DT perspective, I see this as one emmc node:

    pd: power-domain-controller {
        #power-domain-cells = <1>;
    };

    cc: clock-controller {
        #clock-cells = <1>;
    };

    emmc {
        power-domains = <&pd 1> <&pd 2>, <&pd 3>;
        clocks = <&cc 1> <&cc 2>;
    }

And then we really don't want to have to express every single possible frequency that clk1 and clk2 can be just to express the voltage/corner constraints. It could be that we have some table like so:

       clk1 Hz  |  pd1 Corner
    ------------+-----------
         40000  |   0
        960000  |   0
      19200000  |   1
      25000000  |   1
      50000000  |   2
      74000000  |   3

       clk2 Hz  |  pd2 Corner
    ------------+-----------
       19200000 |   0
      150000000 |   1
      340000000 |   2

BUT we also have another device that uses pd1 and has it's own clk3 with different frequency constraints:

       clk3 Hz   |  pd1 Corner
    -------------+-----------
      250000000  |   0
      360000000  |   1
      730000000  |   2

So when clk3 is at 730000000, we don't care what frequency clk1 is running at, pd1 needs to be at least at corner 2. If it's at corner 3 because clk1 is at 74000000 then that's fine.

I imagine DT would look like our "fmax tables" that are currently out of tree. Something like:

	clk1_fmax_table {
		fmax0 {
			reg = /bits/ 64 <960000>;
			qcom,corner = <0>;
		};
		fmax1 {
			reg = /bits/ 64 <25000000>;
			qcom,corner = <1>;
		};
		fmax2 {
			reg = /bits/ 64 <50000000>;
			qcom,corner = <2>;
		};
		fmax3 {
			reg = /bits/ 64 <740000000>;
			qcom,corner = <3>;
		};
	};

Which is similar to OPP table, but we only list the maximum frequency that requires a particular corner. We're back to the same problem we have with OPPs of figuring out how to relate a table to a certain clk and power domain though. At least for qcom, we could do that with some sort of complicated list property:

    emmc {
        performance-states = <&fmax_table &cc 1 &pd 1>
    };

or something like that which would parse a table, a clock, and a number of power domains.

Reminds me, we can have one clk frequency map to multiple power domains too. We have this case for our CPUs and PLLs where we have individual power control on two domains for one frequency. So when the PLL frequency changes, we need to turn on and set the voltage or corner of two regulators.

So I don't really know how this is all going to work. I'd really appreciate to see the full picture though. Reviewing this a bit at a time makes me lose sight of the bigger picture.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
#4 lore raw
In reply to Rob Herring
Quoted 11 lines · Rob Herring

Documentation/devicetree/bindings/opp/opp.txt properties. · line 167

Quoted 6 lines · Viresh Kumar

+- power-domain-opp: This contains phandle to one of the OPP nodes of the master

Documentation/devicetree/bindings/opp/opp.txt +5 -0
+  power domain. This specifies the minimum required OPP of the master domain for
+  the functioning of the device in this OPP (where this property is present).
+  This property can only be set for a device if the device node contains the
+  "power-domains" property. Also, either all or none of the OPP nodes in an OPP
+  table should have it set.

This is a "this device requires OPP n" property. Couldn't we want this for cases other than a powerdomain OPP? What if a device has requirements 2 different OPPs?

Hmm, I agree. We can/should make it more generic.

Quoted 3 lines

On the flipside, I don't think we want devices picking things like CPU OPPs and putting policy here. But I'd rather things be extendable than reviewing yet another OPP property next month.

Sure, I would rename this property and make necessary changes to it.

Signature · 1 line
viresh
#15 lore raw

Re: [RFC V7 2/2] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

In reply to Stephen Boyd
Quoted 3 lines · Stephen Boyd

Sorry it still makes zero sense to me. It seems that we're trying to make the OPP table parsing generic just for the sake of code brevity.

Not just the code but bindings as well to make sure we don't add a new property (similar to earlier ones) for every platform that wants to use performance states.

Quoted 3 lines

Is this the goal? From a DT writer perspective it seems confusing to say that opp-microvolt is sometimes a microvolt and sometimes not a microvolt.

Well it would still represent the voltage but not in microvolt units as the platform guys decided to hide those values from kernel and handle them directly in firmware.

Quoted 3 lines

Why can't the SoC specific genpd
driver parse something like "qcom,corner" instead out of the node?

Sure we can, but that means that a new property will be required for the next platform.

I did it this way as Kevin (and Rob) suggested NOT to add another property but use the earlier ones as we aren't passing anything new here, just that the units of the property are different. For another SoC, we may want to hide both freq and voltage values from kernel and pass firmware dependent values. Should we add two new properties for that SoC then ?

Quoted 2 lines

BTW, I don't believe I have a use-case where I want to express power domain OPP tables.

I do remember that you once said [1] that you may want to pass the real voltage values as well via DT. And so I thought that you can pass performance-state (corner) in opp-hz and real voltage values in opp-microvolt.

Quoted 4 lines

I have many devices that all have
different frequencies that are all tied into the same power domain. This binding makes it look like we can only have one frequency per domain which won't work.

No, that isn't the case. Looks like we have some confusion here. Let me try with a simple example:

        foo: foo-power-domain@09000000 {
                compatible = "foo,genpd";
                #power-domain-cells = <0>;
                operating-points-v2 = <&domain_opp_table>;
        };

        cpu0: cpu@0 {
                compatible = "arm,cortex-a53", "arm,armv8";
                ...
                operating-points-v2 = <&cpu_opp_table>;
                power-domains = <&foo>;
        };


        domain_opp_table: domain_opp_table {
                compatible = "operating-points-v2";

                domain_opp_1: opp00 {
                        opp-hz = /bits/ 64 <1>; /* These are corners AKA perf states */
                };
                domain_opp_2: opp01 {
                        opp-hz = /bits/ 64 <2>;
                };
                domain_opp_3: opp02 {
                        opp-hz = /bits/ 64 <3>;
                };
        };

        cpu_opp_table: cpu_opp_table {
                compatible = "operating-points-v2";
                opp-shared;

                opp00 {
                        opp-hz = /bits/ 64 <208000000>;
                        clock-latency-ns = <500000>;
                        power-domain-opp = <&domain_opp_1>;
                };
                opp01 {
                        opp-hz = /bits/ 64 <432000000>;
                        clock-latency-ns = <500000>;
                        power-domain-opp = <&domain_opp_2>;
                };
                opp02 {
                        opp-hz = /bits/ 64 <729000000>;
                        clock-latency-ns = <500000>;
                        power-domain-opp = <&domain_opp_2>;
                };
                opp03 {
                        opp-hz = /bits/ 64 <960000000>;
                        clock-latency-ns = <500000>;
                        power-domain-opp = <&domain_opp_3>;
                };
        };

The device frequencies are still managed by device's OPP table, just that device's OPP has OPP requirement from another device which is power domain in this case.

Quoted 111 lines

I want to express that a device with a range of frequencies (or really multiple ranges of frequencies) is inside certain physical power domains and the frequency of the clks dictates the minimum voltage requirement of those power domains.

For the most complicated case, imagine something like our eMMC controller that has two clks (clk1,clk2) that it changes the rate of independently and those two clks rely on two different regulators (vreg1, vreg2) that supply voltage domains in the SoC which the eMMC controller happens to be part of (pd1, pd2). And the device is also part of another power domain that we use to turn everything off (pd3).

 +-------+                                 +-------+
 | vreg1 |                                 | vreg2 |
 +---+---+                                 +----+--+
     |                                          |
     |     +------------+-------------+         |
     |     | +-------+  |  +--------+ |         |
     +-----> | clk1  |  |  |  clk2  | <---------+
           | +---+---+  |  +----+---+ |
           |     |      |       |     |
      +----------v--------------v-----------+
      |    |            |             |     |
      |    |            |             |     |
      |    |   pd1      |     pd2     |     |
      |    |            |             |     |
      |    +------------+-------------+     |
      |                                     |
      |  pd3                          eMMC  |
      +-------------------------------------+
Quoted 1 line

From a DT perspective, I see this as one emmc node:

    pd: power-domain-controller {
        #power-domain-cells = <1>;
    };

    cc: clock-controller {
        #clock-cells = <1>;
    };

    emmc {
        power-domains = <&pd 1> <&pd 2>, <&pd 3>;
        clocks = <&cc 1> <&cc 2>;
    }

And then we really don't want to have to express every single possible frequency that clk1 and clk2 can be just to express the voltage/corner constraints. It could be that we have some table like so:

       clk1 Hz  |  pd1 Corner
    ------------+-----------
         40000  |   0
        960000  |   0
      19200000  |   1
      25000000  |   1
      50000000  |   2
      74000000  |   3

       clk2 Hz  |  pd2 Corner
    ------------+-----------
       19200000 |   0
      150000000 |   1
      340000000 |   2

BUT we also have another device that uses pd1 and has it's own clk3 with different frequency constraints:

       clk3 Hz   |  pd1 Corner
    -------------+-----------
      250000000  |   0
      360000000  |   1
      730000000  |   2

So when clk3 is at 730000000, we don't care what frequency clk1 is running at, pd1 needs to be at least at corner 2. If it's at corner 3 because clk1 is at 74000000 then that's fine.

I imagine DT would look like our "fmax tables" that are currently out of tree. Something like:

	clk1_fmax_table {
		fmax0 {
			reg = /bits/ 64 <960000>;
			qcom,corner = <0>;
		};
		fmax1 {
			reg = /bits/ 64 <25000000>;
			qcom,corner = <1>;
		};
		fmax2 {
			reg = /bits/ 64 <50000000>;
			qcom,corner = <2>;
		};
		fmax3 {
			reg = /bits/ 64 <740000000>;
			qcom,corner = <3>;
		};
	};

Which is similar to OPP table, but we only list the maximum frequency that requires a particular corner. We're back to the same problem we have with OPPs of figuring out how to relate a table to a certain clk and power domain though. At least for qcom, we could do that with some sort of complicated list property:

Quoted 6 lines
    emmc {
        performance-states = <&fmax_table &cc 1 &pd 1>
    };

or something like that which would parse a table, a clock, and a number of power domains.

Here is how this can be represented with the current proposal.

        pd: power-domain-controller {
            #power-domain-cells = <1>;
            operating-points-v2 = <&pd1_opp_table>, <&pd2_opp_table>, <&pd3_opp_table>;
        };
   
        /*
         * The below OPP nodes can contain other properties like
         * microvolt and microamps, etc.
         *
         * Also if the below 3 tables are exactly same, then the same
         * table can be used for all the three power domains provided
         * by the above controller.
         */
        pd1_opp_table: pd1_opp_table {
                compatible = "operating-points-v2";

                pd1_opp_1: opp00 {
                        opp-hz = /bits/ 64 <1>; /* These are corners AKA perf states */
                };
                pd1_opp_2: opp01 {
                        opp-hz = /bits/ 64 <2>;
                };
                pd1_opp_3: opp02 {
                        opp-hz = /bits/ 64 <3>;
                };
        };

        pd2_opp_table: pd2_opp_table {
                compatible = "operating-points-v2";

                pd2_opp_1: opp00 {
                        opp-hz = /bits/ 64 <1>; /* These are corners AKA perf states */
                };
                pd2_opp_2: opp01 {
                        opp-hz = /bits/ 64 <2>;
                };
                pd2_opp_3: opp02 {
                        opp-hz = /bits/ 64 <3>;
                };
        };

        pd3_opp_table: pd3_opp_table {
                compatible = "operating-points-v2";

                pd3_opp_1: opp00 {
                        opp-hz = /bits/ 64 <1>; /* These are corners AKA perf states */
                };
                pd3_opp_2: opp01 {
                        opp-hz = /bits/ 64 <2>;
                };
                pd3_opp_3: opp02 {
                        opp-hz = /bits/ 64 <3>;
                };
        };

        cc: clock-controller {
            #clock-cells = <1>;
        };
    
        emmc {
            power-domains = <&pd 1> <&pd 2>, <&pd 3>;
            clocks = <&cc 1> <&cc 2>;
            /*
             * We don't allow multiple OPP tables for devices
             * currently, but I think we need to use it for multiple
             * clk case, like emmc in your example.
             */
            operating-points-v2 = <&cc1_opp_table>, <&cc2_opp_table>;
        }

        cc1_opp_table: cc1_opp_table {
                compatible = "operating-points-v2";
                opp-shared;

                opp00 {
                        opp-hz = /bits/ 64 <40000>;
                        power-domain-opp = <&pd1_opp_1>;
                };
                opp01 {
                        opp-hz = /bits/ 64 <960000>;
                        power-domain-opp = <&pd1_opp_1>;
                };
                opp02 {
                        opp-hz = /bits/ 64 <19200000>;
                        power-domain-opp = <&pd1_opp_2>;
                };
                opp03 {
                        opp-hz = /bits/ 64 <25000000>;
                        power-domain-opp = <&pd1_opp_2>;
                };
                opp04 {
                        opp-hz = /bits/ 64 <50000000>;
                        power-domain-opp = <&pd1_opp_3>;
                };
                opp05 {
                        opp-hz = /bits/ 64 <74000000>;
                        power-domain-opp = <&pd1_opp_3>;
                };
        };

        cc2_opp_table: cc2_opp_table {
                compatible = "operating-points-v2";
                opp-shared;

                opp00 {
                        opp-hz = /bits/ 64 <19200000>;
                        power-domain-opp = <&pd2_opp_1>;
                };
                opp01 {
                        opp-hz = /bits/ 64 <150000000>;
                        power-domain-opp = <&pd2_opp_2>;
                };
                opp02 {
                        opp-hz = /bits/ 64 <340000000>;
                        power-domain-opp = <&pd2_opp_3>;
                };
        };

Other devices can too have their OPP tables containing phandles to the pd1/2/3 OPPs.

Wouldn't this work well ?

Quoted 5 lines

Reminds me, we can have one clk frequency map to multiple power domains too. We have this case for our CPUs and PLLs where we have individual power control on two domains for one frequency. So when the PLL frequency changes, we need to turn on and set the voltage or corner of two regulators.

Sure, in that case the above "power-domain-opp" can contain a list. This is the multiple-power-domain case we have discussed multiple times earlier.

Quoted 1 line

So I don't really know how this is all going to work.

I am still hopeful :)

Quoted 3 lines

I'd really
appreciate to see the full picture though. Reviewing this a bit at a time makes me lose sight of the bigger picture.

I was about to publish code based on these bindings today, but then I received last minute comments from you and Rob and that work is going to wait a bit more :)

Signature · 7 lines
viresh

[1] https://marc.info/?l=linux-kernel&m=147995301320486&w=2
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#16 lore raw

Re: [RFC V7 2/2] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

Quoted 8 lines · Viresh Kumar
Quoted 3 lines · Stephen Boyd

Sorry it still makes zero sense to me. It seems that we're trying to make the OPP table parsing generic just for the sake of code brevity.

Not just the code but bindings as well to make sure we don't add a new property (similar to earlier ones) for every platform that wants to use performance states.

@Stephen: Do you have any feedback on my previous email? If no, then I would like to refresh this version with the feedback received from Rob.

Signature · 1 line
viresh
#17 lore raw

Re: [RFC V7 2/2] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

In reply to Viresh Kumar
Quoted 75 lines · Viresh Kumar
Quoted 3 lines · Stephen Boyd

Sorry it still makes zero sense to me. It seems that we're trying to make the OPP table parsing generic just for the sake of code brevity.

Not just the code but bindings as well to make sure we don't add a new property (similar to earlier ones) for every platform that wants to use performance states.

Quoted 3 lines

Is this the goal? From a DT writer perspective it seems confusing to say that opp-microvolt is sometimes a microvolt and sometimes not a microvolt.

Well it would still represent the voltage but not in microvolt units as the platform guys decided to hide those values from kernel and handle them directly in firmware.

Quoted 3 lines

Why can't the SoC specific genpd
driver parse something like "qcom,corner" instead out of the node?

Sure we can, but that means that a new property will be required for the next platform.

I did it this way as Kevin (and Rob) suggested NOT to add another property but use the earlier ones as we aren't passing anything new here, just that the units of the property are different. For another SoC, we may want to hide both freq and voltage values from kernel and pass firmware dependent values. Should we add two new properties for that SoC then ?

Quoted 2 lines

BTW, I don't believe I have a use-case where I want to express power domain OPP tables.

I do remember that you once said [1] that you may want to pass the real voltage values as well via DT. And so I thought that you can pass performance-state (corner) in opp-hz and real voltage values in opp-microvolt.

Quoted 4 lines

I have many devices that all have
different frequencies that are all tied into the same power domain. This binding makes it look like we can only have one frequency per domain which won't work.

No, that isn't the case. Looks like we have some confusion here. Let me try with a simple example:

        foo: foo-power-domain@09000000 {
                compatible = "foo,genpd";
                #power-domain-cells = <0>;
                operating-points-v2 = <&domain_opp_table>;
        };

        cpu0: cpu@0 {
                compatible = "arm,cortex-a53", "arm,armv8";
                ...
                operating-points-v2 = <&cpu_opp_table>;
                power-domains = <&foo>;
        };


        domain_opp_table: domain_opp_table {
                compatible = "operating-points-v2";

                domain_opp_1: opp00 {
                        opp-hz = /bits/ 64 <1>; /* These are corners AKA perf states */
                };
                domain_opp_2: opp01 {
                        opp-hz = /bits/ 64 <2>;
                };
                domain_opp_3: opp02 {
                        opp-hz = /bits/ 64 <3>;
                };
        };
Quoted 8 lines
        cpu_opp_table: cpu_opp_table {
                compatible = "operating-points-v2";
                opp-shared;

                opp00 {
                        opp-hz = /bits/ 64 <208000000>;
                        clock-latency-ns = <500000>;
                        power-domain-opp = <&domain_opp_1>;

What is this? opp00 here is not a device. One OPP should not point to another. "power-domain-opp" is only supposed to appear in devices alongside power-domains properties.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#18 lore raw

Re: [RFC V7 2/2] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

Quoted 4 lines · Rob Herring
Quoted 4 lines
        cpu_opp_table: cpu_opp_table {
                compatible = "operating-points-v2";
                opp-shared;
Quoted 8 lines
Quoted 4 lines
                opp00 {
                        opp-hz = /bits/ 64 <208000000>;
                        clock-latency-ns = <500000>;
                        power-domain-opp = <&domain_opp_1>;

What is this? opp00 here is not a device. One OPP should not point to another. "power-domain-opp" is only supposed to appear in devices alongside power-domains properties.

There are two type of devices:

A.) With fixed performance state requirements and they will have the new "required-opp" property in the device node itself as you said.

B.) Devices which can do DVFS (CPU, MMC, LCD, etc) and those may need a different performance state of the domain for their individual OPPs and so we can't have this property in the device all the time.

Does this make sense ?

Signature · 5 lines
viresh
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#19 lore raw

Re: [RFC V7 2/2] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

Quoted 16 lines · Viresh Kumar
Quoted 4 lines · Rob Herring
Quoted 4 lines
        cpu_opp_table: cpu_opp_table {
                compatible = "operating-points-v2";
                opp-shared;
Quoted 8 lines
Quoted 4 lines
                opp00 {
                        opp-hz = /bits/ 64 <208000000>;
                        clock-latency-ns = <500000>;
                        power-domain-opp = <&domain_opp_1>;

What is this? opp00 here is not a device. One OPP should not point to another. "power-domain-opp" is only supposed to appear in devices alongside power-domains properties.

There are two type of devices:

Quoted 8 lines

A.) With fixed performance state requirements and they will have the new "required-opp" property in the device node itself as you said.

B.) Devices which can do DVFS (CPU, MMC, LCD, etc) and those may need a different performance state of the domain for their individual OPPs and so we can't have this property in the device all the time.

Does this make sense ?

No. From the definition for power-domain-opp

"+- power-domain-opp: This contains phandle to one of the OPP nodes of the master
+ power domain. This specifies the minimum required OPP of the master domain for

+  the functioning of the device in this OPP (where this property is present).
+  This property can only be set for a device if the device node contains the
+  "power-domains" property. Also, either all or none of the OPP nodes in an OPP
+  table should have it set."

In the above example, you are violating the next to last sentence.

Though, I'm now confused by what the last sentence means.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#20 lore raw

Re: [RFC V7 2/2] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

Quoted 26 lines · Rob Herring
Quoted 16 lines · Viresh Kumar
Quoted 4 lines · Rob Herring
Quoted 4 lines
        cpu_opp_table: cpu_opp_table {
                compatible = "operating-points-v2";
                opp-shared;
Quoted 8 lines
Quoted 4 lines
                opp00 {
                        opp-hz = /bits/ 64 <208000000>;
                        clock-latency-ns = <500000>;
                        power-domain-opp = <&domain_opp_1>;

What is this? opp00 here is not a device. One OPP should not point to another. "power-domain-opp" is only supposed to appear in devices alongside power-domains properties.

There are two type of devices:

Quoted 8 lines

A.) With fixed performance state requirements and they will have the new "required-opp" property in the device node itself as you said.

B.) Devices which can do DVFS (CPU, MMC, LCD, etc) and those may need a different performance state of the domain for their individual OPPs and so we can't have this property in the device all the time.

Does this make sense ?

Quoted 7 lines

No. From the definition for power-domain-opp

"+- power-domain-opp: This contains phandle to one of the OPP nodes of the master
+ power domain. This specifies the minimum required OPP of the master domain for
+ the functioning of the device in this OPP (where this property is present).

The per-opp thing was mentioned here.

Review

Quoted 2 lines
(quoted diff) +2 -0
+  This property can only be set for a device if the device node contains the
+  "power-domains" property.

This was trying to say something else, though it wasn't clear and so your concerns.

I wanted to say that the device node or its OPP nodes can have the "power-domain-opp" property only if the device node has a "power-domains" property. i.e. you need to have power domain first and then only the power-domain-opp property.

Quoted 6 lines

Also, either all or none of the OPP nodes in an OPP
+ table should have it set."

In the above example, you are violating the next to last sentence.

Though, I'm now confused by what the last sentence means.

Yeah, lets leave it as is as the V8 has changed this significantly and you already Acked it :)

Signature · 5 lines
viresh
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html