From patchwork Fri Oct 30 01:25:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 55809 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp883338lbr; Thu, 29 Oct 2015 18:25:48 -0700 (PDT) X-Received: by 10.66.199.40 with SMTP id jh8mr5424028pac.123.1446168348373; Thu, 29 Oct 2015 18:25:48 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xn8si6569494pab.234.2015.10.29.18.25.48; Thu, 29 Oct 2015 18:25:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1758215AbbJ3BZl (ORCPT + 28 others); Thu, 29 Oct 2015 21:25:41 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:32833 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758053AbbJ3BZf (ORCPT ); Thu, 29 Oct 2015 21:25:35 -0400 Received: by padhy1 with SMTP id hy1so50884076pad.0 for ; Thu, 29 Oct 2015 18:25:35 -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=24Q6kiqfc5uwEDixECHWUiIKmzJgl8vt7a/VbGseb3s=; b=NNU7Fv5+zf20Fif7064pjqH4w8sAgU3+FrdVBFRm0nrTBrUP5bKkmlRDAP6IYQQt32 43clVt9rDty2upH+UP5GERznPFWbkQCSpgGBIKO0++hcF987Yz0KmziSgNb9t3g1PqR6 2OgGnMWV8DSgQFiStN3oA7plLgu031LgGW62vlxzJXWdfV8Am0N5+Supk2WuMfaw0F5i cnpgmIs3RdYyl//e/3WMv+pnnk6mjm9W1pFsUZzUfHgRpooo0QPc0FVncpxPIbe4xg63 p3OAdTN1qkN5rge71bdFjoIhhP9dc/s9goeEpq/maQnuNEbKlMNrJYRLn7LMF7ELc4qy YFGA== 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=24Q6kiqfc5uwEDixECHWUiIKmzJgl8vt7a/VbGseb3s=; b=mclnNM6MqeKuF82W1jTR1zBfti+nu+hR8jNqEAWpD15BGEYMwPQg2PW6DozuErxuEw 2QEiXZ8fN9MIkMByRp0clzZ/wxyQ2AhfbcElkMibfWlCc6Qxo8PvcHAPgUNi5XkVHwLH moluIm0uxbK6L5ZBSPOt6Pa4/B3JTlXfcz75/T0e90NPXXSyXH4g99BKOPvjVnrEho3n K8OJY4e39eh1ZZIIEybqaVcbd9Oeqq4JR0u8srTOlV1Rj9wBqmGbi/wHc8rZJoJF/8SG 8X5XP4Jf/trZCXJXJMipjXfIJ+42qHl+AR7CwKUialK3JyjGtoKzNGMLFRjO0GS4lyf5 4mnw== X-Gm-Message-State: ALoCoQkxsmi+oMRxUESRF3WsqLFbJY1S4zT6N4JMj9D12lM9bmfcSEeZIKxXrotDmrcQTN9bltKT X-Received: by 10.68.165.35 with SMTP id yv3mr5447335pbb.53.1446168334927; Thu, 29 Oct 2015 18:25:34 -0700 (PDT) Received: from localhost ([122.172.111.169]) by smtp.gmail.com with ESMTPSA id l16sm4647680pbq.22.2015.10.29.18.25.33 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 29 Oct 2015 18:25:34 -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 2/3] PM / OPP: Add {opp-microvolt|opp-microamp|turbo-mode|opp-suspend}- binding Date: Fri, 30 Oct 2015 06:55:06 +0530 Message-Id: <980cdb9820db31e869c91b3dce8e71b89c216706.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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Depending on the version of hardware or its properties, which are only known at runtime, various properties of the OPP can change. For example, an OPP with frequency 1.2 GHz, may have different voltage/current requirements based on the version of the hardware it is running on. Similarly, it may or may not be a turbo or suspend OPP on those circumstances. In order to not replicate the same OPP tables for varying values of all such fields, this commit introduces the concept of opp-property-. The can be chosen by the platform at runtime, and OPPs will be initialized depending on that name string. Currently support is extended for the following properties: - opp-microvolt- - opp-microamp- - turbo-mode- - opp-suspend- If the name string isn't provided by the platform, or if it is provided but doesn't match the properties present in the OPP node, we will fall back to the original properties without the - string, if they are available. Signed-off-by: Viresh Kumar --- Documentation/devicetree/bindings/opp/opp.txt | 58 +++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) -- 2.6.2.198.g614a2ac -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/Documentation/devicetree/bindings/opp/opp.txt b/Documentation/devicetree/bindings/opp/opp.txt index 96892057586a..6e0dd8db3b86 100644 --- a/Documentation/devicetree/bindings/opp/opp.txt +++ b/Documentation/devicetree/bindings/opp/opp.txt @@ -100,6 +100,14 @@ properties. Entries for multiple regulators must be present in the same order as regulators are specified in device's DT node. +- opp-microvolt-: Named opp-microvolt property. This is exactly similar to + the above opp-microvolt property, but allows multiple voltage ranges to be + provided for the same OPP. At runtime, the platform can pick a and + matching opp-microvolt- property will be enabled for all OPPs. If the + platform doesn't pick a specific or the doesn't match with any + opp-microvolt- properties, then opp-microvolt property shall be used, if + present. + - opp-microamp: The maximum current drawn by the device in microamperes considering system specific parameters (such as transients, process, aging, maximum operating temperature range etc.) as necessary. This may be used to @@ -112,6 +120,9 @@ properties. for few regulators, then this should be marked as zero for them. If it isn't required for any regulator, then this property need not be present. +- opp-microamp-: Named opp-microamp property. Similar to + opp-microvolt- property, but for microamp instead. + - clock-latency-ns: Specifies the maximum possible transition latency (in nanoseconds) for switching to this OPP from any other OPP. @@ -120,9 +131,15 @@ properties. frequency for a short duration of time limited by the device's power, current and thermal limits. +- turbo-mode-: Named turbo-mode property. Similar to opp-microvolt- + property, but for turbo mode instead. + - opp-suspend: Marks the OPP to be used during device suspend. Only one OPP in the table should have this. +- opp-suspend-: Named opp-suspend property. Similar to + opp-microvolt- property, but for suspend opp instead. + - 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 , @@ -520,3 +537,44 @@ Example 6: opp-supported-hw }; }; }; + +Example 7: opp-microvolt-, opp-microamp-, turbo-mode-, +opp-suspend-: +(example: device with two possible microvolt ranges: slow and fast) + +/ { + cpus { + cpu@0 { + compatible = "arm,cortex-a7"; + ... + + operating-points-v2 = <&cpu0_opp_table>; + }; + }; + + cpu0_opp_table: opp_table0 { + compatible = "operating-points-v2"; + opp-shared; + + opp00 { + opp-hz = /bits/ 64 <1000000000>; + opp-microvolt-slow = <900000 915000 925000>; + opp-microvolt-fast = <970000 975000 985000>; + opp-microamp-slow = <70000>; + opp-microamp-fast = <71000>; + turbo-mode-slow; /* Will be used as turbo only if 'slow' is chosen */ + opp-suspend-slow; /* Will be used as suspend-opp only if 'slow' is chosen */ + }; + + opp01 { + opp-hz = /bits/ 64 <1200000000>; + opp-microvolt-slow = <900000 915000 925000>, /* Supply vcc0 */ + <910000 925000 935000>; /* Supply vcc1 */ + opp-microvolt-fast = <970000 975000 985000>, /* Supply vcc0 */ + <960000 965000 975000>; /* Supply vcc1 */ + opp-microamp = <70000>; /* Will be used for both slow/fast */ + turbo-mode; /* Always used as turbo */ + opp-suspend-fast; /* Will be used as suspend opp only if 'fast' is chosen */ + }; + }; +};