cip-dev.lists.cip-project.org archive mirror
 help / color / mirror / Atom feed
* Re: [cip-dev] [PATCH 4.4.y-cip 1/3] PM / OPP: Add "opp-supported-hw" binding
       [not found] <HK2PR01MB32812E5997579D3A664F3F45FAAA0@HK2PR01MB3281.apcprd01.prod.exchangelabs.com>
@ 2020-05-01  9:20 ` Pavel Machek
  2020-05-05 11:08   ` johnsonch.chen@moxa.com
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Machek @ 2020-05-01  9:20 UTC (permalink / raw)
  To: Johnson CH Chen (陳昭勳)
  Cc: cip-dev, nobuhiro1.iwamatsu, pavel


[-- Attachment #1.1: Type: text/plain, Size: 2792 bytes --]

Hi!

> From: Viresh Kumar <viresh.kumar@linaro.org>
> 
> commit 1c4d12de2719dfdf27c6dab31e7a5641ee293c94 upstream
> 
> 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.

Few typos mentioned below, but this should not block merge.

> 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 @@ Optional 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

"Version->version".

> +  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

"supported versions".

> +  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.

Above it claims that there can be only 32 versions, then it explains
how to do more than 32 versions. Overall, I find this text rather
confusing (concept is quite simple, but I'd not understand it without
the example).

Best regards,
								Pavel
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 419 bytes --]

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#4611): https://lists.cip-project.org/g/cip-dev/message/4611
Mute This Topic: https://lists.cip-project.org/mt/73369239/4520388
Group Owner: cip-dev+owner@lists.cip-project.org
Unsubscribe: https://lists.cip-project.org/g/cip-dev/leave/8129055/727948398/xyzzy  [cip-dev@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [cip-dev] [PATCH 4.4.y-cip 1/3] PM / OPP: Add "opp-supported-hw" binding
  2020-05-01  9:20 ` [cip-dev] [PATCH 4.4.y-cip 1/3] PM / OPP: Add "opp-supported-hw" binding Pavel Machek
@ 2020-05-05 11:08   ` johnsonch.chen@moxa.com
  0 siblings, 0 replies; 3+ messages in thread
From: johnsonch.chen@moxa.com @ 2020-05-05 11:08 UTC (permalink / raw)
  To: Pavel Machek; +Cc: cip-dev, nobuhiro1.iwamatsu

[-- Attachment #1: Type: text/plain, Size: 3303 bytes --]

Hi,

> Hi!
>
> > From: Viresh Kumar <viresh.kumar@linaro.org>
> >
> > commit 1c4d12de2719dfdf27c6dab31e7a5641ee293c94 upstream
> >
> > 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.
>
> Few typos mentioned below, but this should not block merge.
>
> > 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 @@ Optional 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
>
> "Version->version".
>
> > +  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
>
> "supported versions".
>

"Version->version" and "supported versions" will be added in patch series v2.


> > +  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.
>
> Above it claims that there can be only 32 versions, then it explains 
> how to do more than 32 versions. Overall, I find this text rather 
> confusing (concept is quite simple, but I'd not understand it without 
> the example).
>

Me, too. It doesn't have example of multiple 32 bit values.
It seems to be used for hierarchy of three levels and 32bit of each level generally.

> Best regards,
>                                                                 Pavel
> --
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>

Best regards,
Johnson

[-- Attachment #2: Type: text/plain, Size: 419 bytes --]

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#4615): https://lists.cip-project.org/g/cip-dev/message/4615
Mute This Topic: https://lists.cip-project.org/mt/73369239/4520388
Group Owner: cip-dev+owner@lists.cip-project.org
Unsubscribe: https://lists.cip-project.org/g/cip-dev/leave/8129055/727948398/xyzzy  [cip-dev@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [cip-dev] [PATCH 4.4.y-cip 1/3] PM / OPP: Add "opp-supported-hw" binding
@ 2020-04-30  3:33 Johnson CH Chen (陳昭勳)
  0 siblings, 0 replies; 3+ messages in thread
From: Johnson CH Chen (陳昭勳) @ 2020-04-30  3:33 UTC (permalink / raw)
  To: cip-dev, nobuhiro1.iwamatsu, pavel

From: Viresh Kumar <viresh.kumar@linaro.org>

commit 1c4d12de2719dfdf27c6dab31e7a5641ee293c94 upstream

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>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Johnson Chen <johnsonch.chen@moxa.com>
Signed-off-by: Victor Yu <victor.yu@moxa.com>
---
 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 @@ Optional 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.11.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-05 11:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <HK2PR01MB32812E5997579D3A664F3F45FAAA0@HK2PR01MB3281.apcprd01.prod.exchangelabs.com>
2020-05-01  9:20 ` [cip-dev] [PATCH 4.4.y-cip 1/3] PM / OPP: Add "opp-supported-hw" binding Pavel Machek
2020-05-05 11:08   ` johnsonch.chen@moxa.com
2020-04-30  3:33 Johnson CH Chen (陳昭勳)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).