From patchwork Wed Nov 11 02:40:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 56364 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1116428lbb; Tue, 10 Nov 2015 18:41:16 -0800 (PST) X-Received: by 10.68.226.41 with SMTP id rp9mr10866127pbc.55.1447209676287; Tue, 10 Nov 2015 18:41:16 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4si9172849par.49.2015.11.10.18.41.16; Tue, 10 Nov 2015 18:41:16 -0800 (PST) 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 S1752133AbbKKClO (ORCPT + 6 others); Tue, 10 Nov 2015 21:41:14 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:34857 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752137AbbKKClM (ORCPT ); Tue, 10 Nov 2015 21:41:12 -0500 Received: by pasz6 with SMTP id z6so16923297pas.2 for ; Tue, 10 Nov 2015 18:41:11 -0800 (PST) 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=kEkB7WXkpFJxILzCWO7N4Q9tWA1ttbjbV5cXOW1ATzA=; b=pCfUTA3SjSl+g3mg1I9pbMQhs464/tnLKACldn1AFASgsdW7JpOsLvI4izBRlSEc0T 1/eyPSakP5hwIVsELtTkIQBuEolyUIPmrTch20bhI4g4R2FlQP6Z4M6jY4QiIP4nHDFO hLGtr7fOYalSsxRhOahCwpgY7lNM7SbRws+XbGpUjzlgUdcmPIle7cZGsf0qg7CPsOkw l7o01qOolzlR0HG1XQMla5fZH9hOePBmkQHb5lbgDCluRXXzfFIRfQAu6YbHYgumGrqv a2lkdT6r9hVTlHjx0RbojTXJkP3t0sKI5QnCn0ih1f8mBuc7uUFTgbXGwPrp++FCogGE i1vQ== 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=kEkB7WXkpFJxILzCWO7N4Q9tWA1ttbjbV5cXOW1ATzA=; b=OgorvV41cR03yr+yyQdVoBCL9k6kJBqPdIAjL0VU8LtGy5792RIamfCQq+/F7zXnIU 0wA5q5Ow1rVvf9lsIReL4Ixvr6Dq9rCBnjUG3ILkhL25aEWlkUNSVuS75F533qHsncSE +WH30SCOi3uhSX62z1B3EIYnZZVumurVeFA+KhfMiIqHzwSdyW2dnVqGbMEcxp0tl45j f+5AVdSc/sKz4+IWYLYKtpagqCHDwJPy1FIRs00LEZVOoj2/5MMAhIrYt4RjVSOk7UIH cno/63sVYH/WdAB57s/WYEnlROgJzAKVKH/yVzp3ghZ2ilwgbaHRl/lDFeUyFfrfsSZa 6pKg== X-Gm-Message-State: ALoCoQkxtkhQIaN8oWbcGg3CHp90J/b3BgMAA+Cx3vXHKJ7ITkGup6rQonTcmXUfWjinPBOJM0VW X-Received: by 10.66.219.163 with SMTP id pp3mr10613101pac.55.1447209671819; Tue, 10 Nov 2015 18:41:11 -0800 (PST) Received: from localhost ([122.167.29.19]) by smtp.gmail.com with ESMTPSA id di2sm6649756pbc.64.2015.11.10.18.41.10 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 10 Nov 2015 18:41:11 -0800 (PST) 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, b.zolnierkie@samsung.com, m.szyprowski@samsung.com, Viresh Kumar , Rob Herring , linux-kernel@vger.kernel.org (open list), "Rafael J. Wysocki" Subject: [PATCH V3 1/5] PM / OPP: Add "opp-supported-hw" binding Date: Wed, 11 Nov 2015 08:10:54 +0530 Message-Id: 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. Reviewed-by: Stephen Boyd Acked-by: Rob Herring Signed-off-by: Viresh Kumar --- Documentation/devicetree/bindings/opp/opp.txt | 65 +++++++++++++++++++++++++++ 1 file changed, 65 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..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>; + ... + }; + }; +};