From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031787AbbKEC5h (ORCPT ); Wed, 4 Nov 2015 21:57:37 -0500 Received: from mail.kernel.org ([198.145.29.136]:34784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030549AbbKEC5f (ORCPT ); Wed, 4 Nov 2015 21:57:35 -0500 Date: Wed, 4 Nov 2015 20:57:29 -0600 From: Rob Herring To: Viresh Kumar Cc: Rafael Wysocki , robh+dt@kernel.org, sboyd@codeaurora.org, lee.jones@linaro.org, linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, mark.rutland@arm.com, pawel.moll@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, nm@ti.com, devicetree@vger.kernel.org, b.zolnierkie@samsung.com, m.szyprowski@samsung.com, open list , "Rafael J. Wysocki" Subject: Re: [PATCH V2 1/5] PM / OPP: Add "opp-supported-hw" binding Message-ID: <20151105025729.GA13149@rob-hp-laptop> References: <4e574912e52fb87fc17f4d19d965ae05c888bd29.1446687367.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4e574912e52fb87fc17f4d19d965ae05c888bd29.1446687367.git.viresh.kumar@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Viresh Kumar Acked-by: Rob Herring > --- > 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 , 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. 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 >