cip-dev.lists.cip-project.org archive mirror
 help / color / mirror / Atom feed
From: "Chen-Yu Tsai (Moxa)" <wens@csie.org>
To: nobuhiro1.iwamatsu@toshiba.co.jp, pavel@denx.de
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
	cip-dev@lists.cip-project.org, JohnsonCH.Chen@moxa.com,
	Stephen Boyd <sboyd@codeaurora.org>,
	Rob Herring <robh@kernel.org>,
	"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
	Chen-Yu Tsai <wens@csie.org>
Subject: [cip-dev] [4.4.y-cip 02/15] PM / OPP: Add "opp-supported-hw" binding
Date: Thu,  4 Jun 2020 11:18:16 +0800	[thread overview]
Message-ID: <20200604031829.3254-3-wens@csie.org> (raw)
In-Reply-To: <20200604031829.3254-1-wens@csie.org>

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

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: Chen-Yu Tsai (Moxa) <wens@csie.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 0cb44dc21f97c..d072fa0ffbd44 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.27.0.rc0


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

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

View/Reply Online (#4710): https://lists.cip-project.org/g/cip-dev/message/4710
Mute This Topic: https://lists.cip-project.org/mt/74669307/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]
-=-=-=-=-=-=-=-=-=-=-=-

  parent reply	other threads:[~2020-06-04 11:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04  3:18 [cip-dev] [4.4.y-cip 00/15] PM / OPP v2 & cpufreq backports part 1 Chen-Yu Tsai (Moxa)
2020-06-04  3:18 ` [cip-dev] [4.4.y-cip 01/15] PM / OPP: Add debugfs support Chen-Yu Tsai (Moxa)
2020-06-04  4:47   ` Viresh Kumar
2020-06-04  3:18 ` Chen-Yu Tsai (Moxa) [this message]
2020-06-04  3:18 ` [cip-dev] [4.4.y-cip 03/15] PM / OPP: Add {opp-microvolt|opp-microamp}-<name> binding Chen-Yu Tsai (Moxa)
2020-06-04  3:18 ` [cip-dev] [4.4.y-cip 04/15] PM / OPP: Remove 'operating-points-names' binding Chen-Yu Tsai (Moxa)
2020-06-04  3:18 ` [cip-dev] [4.4.y-cip 05/15] PM / OPP: Rename OPP nodes as opp@<opp-hz> Chen-Yu Tsai (Moxa)
2020-06-04  3:18 ` [cip-dev] [4.4.y-cip 06/15] PM / OPP: Add missing doc comments Chen-Yu Tsai (Moxa)
2020-06-04  3:18 ` [cip-dev] [4.4.y-cip 07/15] PM / OPP: Parse 'opp-supported-hw' binding Chen-Yu Tsai (Moxa)
2020-06-04  3:18 ` [cip-dev] [4.4.y-cip 08/15] PM / OPP: Parse 'opp-<prop>-<name>' bindings Chen-Yu Tsai (Moxa)
2020-06-04  3:18 ` [cip-dev] [4.4.y-cip 09/15] PM / OPP: Fix parsing of opp-microvolt and opp-microamp properties Chen-Yu Tsai (Moxa)
2020-06-04  3:18 ` [cip-dev] [4.4.y-cip 10/15] PM / OPP: Set cpu_dev->id in cpumask first Chen-Yu Tsai (Moxa)
2020-06-04  3:18 ` [cip-dev] [4.4.y-cip 11/15] PM / OPP: Use snprintf() instead of sprintf() Chen-Yu Tsai (Moxa)
2020-06-04  3:18 ` [cip-dev] [4.4.y-cip 12/15] devicetree: bindings: Add optional dynamic-power-coefficient property Chen-Yu Tsai (Moxa)
2020-06-04  3:18 ` [cip-dev] [4.4.y-cip 13/15] cpufreq-dt: Supply power coefficient when registering cooling devices Chen-Yu Tsai (Moxa)
2020-06-04  3:18 ` [cip-dev] [4.4.y-cip 14/15] cpufreq-dt: fix handling regulator_get_voltage() result Chen-Yu Tsai (Moxa)
2020-06-04  3:18 ` [cip-dev] [4.4.y-cip 15/15] cpufreq: cpufreq-dt: avoid uninitialized variable warnings: Chen-Yu Tsai (Moxa)
2020-06-04  3:45 ` [cip-dev] [4.4.y-cip 00/15] PM / OPP v2 & cpufreq backports part 1 Chen-Yu Tsai (Moxa)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200604031829.3254-3-wens@csie.org \
    --to=wens@csie.org \
    --cc=JohnsonCH.Chen@moxa.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=pavel@denx.de \
    --cc=rafael.j.wysocki@intel.com \
    --cc=robh@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).