From patchwork Fri Oct 30 01:25:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 55808 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp883257lbr; Thu, 29 Oct 2015 18:25:32 -0700 (PDT) X-Received: by 10.66.97.71 with SMTP id dy7mr5354569pab.23.1446168332701; Thu, 29 Oct 2015 18:25:32 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kn6si6658303pab.74.2015.10.29.18.25.32; Thu, 29 Oct 2015 18:25:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758082AbbJ3BZb (ORCPT + 6 others); Thu, 29 Oct 2015 21:25:31 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:34565 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758039AbbJ3BZa (ORCPT ); Thu, 29 Oct 2015 21:25:30 -0400 Received: by padhk11 with SMTP id hk11so56906373pad.1 for ; Thu, 29 Oct 2015 18:25:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=Ue79bhXZgHrhx8C7SKQPcL9NqVXiMHKpzGDtP+KOxB8=; b=VrNICFmILJEjORfXc1f9Hdu8lH+k2Pn+LTpfvqvruDr+mmFAd0kp6lDc0twON9e3zc 89B4tH4U0477xR1qm/ZxAqZ3a7Y1pR/oHJTgzmUI4SEhOWzrYEC5k68YoT16ESczm/Rf BccrEjop5XxKz+pppxlSg7fLXQj8pKaciZXAQIuTzB3cuZd/oCezzayu/HmytUXHa1iB 6oO2EpZuYHGlLxytxTj97+0861gPEt/sc52A8dfAB0I4t12VzAXx7SknF7PTC9hmXnao rzQ21r1naM9NVrm64l+PRHPRH78xjmwUs0E/NeAfl/9L+1s84JL1HVQT5X7Jr+CovZ2h ndDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=Ue79bhXZgHrhx8C7SKQPcL9NqVXiMHKpzGDtP+KOxB8=; b=mRkrNxkK06B4zJmQP70xA6i3UxJcggbIOWgUI+OaY40yC2DgcQnUEUg/VklMjphFog w2eQxofLiPEZDsGF2qtdr9m4sh6DY+hWOLRQ7t2d2mHB2pgRk1GWqwgjtQpmVIJKHKpa m6VGs0uoUC8kuIBhocWhxtsYLRqBbyr3NmZU3ZNF9IpUdkyMn/VUoIrG21j9hPCooFFE 2S+D9j83ONbyERk1R4tTRYvWY/DdxJNLb5EtKFFvB9/16TvSUJIls+8Po84n3b1glXzg Tr3a4s+vrzrKA471eDHtbMwDokxbSKHGlJXbpjDnkfnEzRAoIAdHYW8uFRRoB5Mmfczy h8Sw== X-Gm-Message-State: ALoCoQnmfHPfftDjhAD8FMjXTNoBafQucYmQjvqh3hQUbitGn9vGR5nyxo/79/p3wt9TaXsHaFoA X-Received: by 10.66.224.201 with SMTP id re9mr5388643pac.98.1446168329814; Thu, 29 Oct 2015 18:25:29 -0700 (PDT) Received: from localhost ([122.172.111.169]) by smtp.gmail.com with ESMTPSA id c4sm4583313pat.46.2015.10.29.18.25.28 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 29 Oct 2015 18:25:29 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , robh+dt@kernel.org, sboyd@codeaurora.org, lee.jones@linaro.org Cc: 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, Viresh Kumar , linux-kernel@vger.kernel.org (open list), "Rafael J. Wysocki" Subject: [PATCH 1/3] PM / OPP: Add "opp-supported-hw" binding Date: Fri, 30 Oct 2015 06:55:05 +0530 Message-Id: <2d52388bd7d3cc546ac3ab5afeb47bfcb3012213.1446167359.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.6.2.198.g614a2ac In-Reply-To: References: In-Reply-To: References: Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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. Signed-off-by: Viresh Kumar --- Documentation/devicetree/bindings/opp/opp.txt | 57 +++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) -- 2.6.2.198.g614a2ac -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/devicetree/bindings/opp/opp.txt b/Documentation/devicetree/bindings/opp/opp.txt index 0cb44dc21f97..96892057586a 100644 --- a/Documentation/devicetree/bindings/opp/opp.txt +++ b/Documentation/devicetree/bindings/opp/opp.txt @@ -123,6 +123,18 @@ properties. - opp-suspend: Marks the OPP to be used during device suspend. Only one OPP in the table should have this. +- opp-supported-hw: 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. + - status: Marks the node enabled/disabled. Example 1: Single cluster Dual-core ARM cortex A9, switch DVFS states together. @@ -463,3 +475,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>; + ... + }; + }; +};