From patchwork Tue Oct 31 12:47:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 117605 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp3912951edm; Tue, 31 Oct 2017 05:47:28 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Q6lNciUj7YpePqv9FsDpPg3eB4eJbXhYopjOZXfmLdrsEzq1F7HWRLyu8vfxHBKQJGZ/rV X-Received: by 10.84.168.69 with SMTP id e63mr1743688plb.193.1509454048230; Tue, 31 Oct 2017 05:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509454048; cv=none; d=google.com; s=arc-20160816; b=E6061c4/f2zhFTpt9uPLYwNPqsT6uBJlzSXp4XQRSMZ/zqr4kkg5pJbrUpWvfZSjZH iNYUz7BxaQ8r8riuKLImgHaoC/f2vJ9sMV+s5pSKD403EfOHhGn28ryO77tffDDHQX+1 1flg55pFMhNHGUr21fxmFHwed2SnfILhwPtr+2oHBfZDDtBxBOjdoYO1I8OOAfFZI8Vs 9Tn1CudkJO0U1LJ5cQGK/uChpH5hAhNspAgo/3QeMUtYZUsoRryDzewO9PyPOZP8q7s1 6J9lL1ZECo3qJGvu6YOfxI6Gogv/4XOlwyamiffZ/9pHTo1+Ut0D9ErqwkhxP2A3jr6L 30/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=xjtctFYQWhE++P1+S8J4SgIG+k47CKelGH+5M47rfME=; b=iAXvtn+huCZ5uiqj29u3HBLN3CIRX6ak0YANglWEti5es3gmSvANODYclXqjP4mdMO 3iaMDIBsKMpxL1kx6mAs/R/kXYko0aYMl3AWpU0f+ZvPBbm0xnVTO2PAMXpgczUMyz2t JO+BHTk+vW1BOC/zq6vgHoxstnPh0s6U7NnmowliMQuyDfeY4cbkGuSc5mmhCuLIcnqF qgovPPVTT0P7i4Yisjbdvd89Ta7h1ICoFIiznbaRDx+guQXVEvE07O7znyY7LUBL8R08 vHjqwAcgB/1wlbhYN+3DzYyIk5uTtQlkvbkpFtwOfOjqNsmCBcYx/klYRPKtrG5eHVHw xF7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dZPs2T0H; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1si1392377plk.182.2017.10.31.05.47.27; Tue, 31 Oct 2017 05:47:28 -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; dkim=pass header.i=@linaro.org header.s=google header.b=dZPs2T0H; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753334AbdJaMr0 (ORCPT + 27 others); Tue, 31 Oct 2017 08:47:26 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:52478 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753215AbdJaMrW (ORCPT ); Tue, 31 Oct 2017 08:47:22 -0400 Received: by mail-pf0-f193.google.com with SMTP id e64so13678778pfk.9 for ; Tue, 31 Oct 2017 05:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=xjtctFYQWhE++P1+S8J4SgIG+k47CKelGH+5M47rfME=; b=dZPs2T0H8KB6Ismk/Okqgcv+3/vSf1/a+WntGOP1CzDMo4++utXLLy1NDP7icbKqCe HXDXXqEDS1XMc7IwolcPvznZ11oxfcIH/ys64sZqs1zUKLDU/CQxOIHxmgQYhsf+fzKe xv7q2CWitwOVuPPjPwY/pCB2gTvyxM3Pn0NPE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=xjtctFYQWhE++P1+S8J4SgIG+k47CKelGH+5M47rfME=; b=RNi6j2f6gtnmJrtkAP9baKDsKeDu+k9Hw++H4xlJo/CLN3YlUCfM6alEiIe2Ngk6WN +D0S9oG7JiL7thztu3A0VBHNMeDXHJmYM9bUtlQWkcjrfSzAFpgAjCmTGaXKpZt0JwEX +FP74XCLoWllrByRo0JZxdefBuwyLtEOsKB5MLUWlr/9voF6+f5HcG1VRWLiqBr3T9ez U6dchgGDeWv+e/OUaYw+4ykGocdG9etzxyTSavvJAr4qcccNOSXhkMPg6pHlnR1BHIuj jty6jsVVsXpo979SkllMuyKxPt8ax/U7gSMcLcw7GKTV3YxV/PAz9wFm0CfWOna+URPp 0t2w== X-Gm-Message-State: AMCzsaWsgA8zAmUMpnRHPDoHnv/JhGWooNi+Nic/pbkUi4oHDRf15pey env2L6uH+Cn6c1w3cjj/MGu1ag== X-Received: by 10.159.197.11 with SMTP id bj11mr1792501plb.354.1509454041608; Tue, 31 Oct 2017 05:47:21 -0700 (PDT) Received: from localhost ([122.167.161.211]) by smtp.gmail.com with ESMTPSA id t24sm3169851pfj.46.2017.10.31.05.47.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Oct 2017 05:47:21 -0700 (PDT) From: Viresh Kumar To: ulf.hansson@linaro.org, Kevin Hilman , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , robh+dt@kernel.org, rnayak@codeaurora.org, sudeep.holla@arm.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC V7 1/2] OPP: Allow OPP table to be used for power-domains Date: Tue, 31 Oct 2017 18:17:02 +0530 Message-Id: <2b244ea0a09deaf50237fb8b7578273a8284499e.1509453284.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.15.0.rc1.236.g92ea95045093 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 Power-domains can also have their active states and this patch enhances the OPP binding to define those. The power domains can use the OPP bindings mostly as is. Though there are some changes required to support special cases: - Allow "operating-points-v2" to contain multiple phandles for power domain providers providing multiple domains. - A new property "power-domain-opp" is added for devices to specify the minimum required OPP of the master domain for the functioning of the device. We can add this property directly to device's node if the device has a fixed minimum OPP requirement from the master power domain. Or we can add this property to each OPP node of the device, if different OPP nodes have different minimum OPP requirement from the master power domain. Signed-off-by: Viresh Kumar --- Documentation/devicetree/bindings/opp/opp.txt | 12 +++++ .../devicetree/bindings/power/power_domain.txt | 62 ++++++++++++++++++++++ 2 files changed, 74 insertions(+) -- 2.15.0.rc1.236.g92ea95045093 Reviewed-by: Ulf Hansson diff --git a/Documentation/devicetree/bindings/opp/opp.txt b/Documentation/devicetree/bindings/opp/opp.txt index 9d733af26be7..203e09fe7698 100644 --- a/Documentation/devicetree/bindings/opp/opp.txt +++ b/Documentation/devicetree/bindings/opp/opp.txt @@ -45,6 +45,11 @@ Devices supporting OPPs must set their "operating-points-v2" property with phandle to a OPP table in their DT node. The OPP core will use this phandle to find the operating points for the device. +This can contain more than one phandle for power domain providers that provide +multiple power domains. That is, one phandle for each power domain. If only one +phandle is available, then the same OPP table will be used for all power domains +provided by the power domain provider. + If required, this can be extended for SoC vendor specific bindings. Such bindings should be documented as Documentation/devicetree/bindings/power/-opp.txt and should have a compatible description like: "operating-points-v2-". @@ -154,6 +159,13 @@ properties. - status: Marks the node enabled/disabled. +- power-domain-opp: This contains phandle to one of the OPP nodes of the master + power domain. This specifies the minimum required OPP of the master domain for + the functioning of the device in this OPP (where this property is present). + This property can only be set for a device if the device node contains the + "power-domains" property. Also, either all or none of the OPP nodes in an OPP + table should have it set. + Example 1: Single cluster Dual-core ARM cortex A9, switch DVFS states together. / { diff --git a/Documentation/devicetree/bindings/power/power_domain.txt b/Documentation/devicetree/bindings/power/power_domain.txt index 14bd9e945ff6..0d8608f2d133 100644 --- a/Documentation/devicetree/bindings/power/power_domain.txt +++ b/Documentation/devicetree/bindings/power/power_domain.txt @@ -40,6 +40,12 @@ phandle arguments (so called PM domain specifiers) of length specified by the domain's idle states. In the absence of this property, the domain would be considered as capable of being powered-on or powered-off. +- operating-points-v2 : Phandles to the OPP tables of power domains provided by + a power domain provider. If the provider provides a single power domain only + or all the power domains provided by the provider have identical OPP tables, + then this shall contain a single phandle. Refer to ../opp/opp.txt for more + information. + Example: power: power-controller@12340000 { @@ -120,4 +126,60 @@ The node above defines a typical PM domain consumer device, which is located inside a PM domain with index 0 of a power controller represented by a node with the label "power". +Optional properties: +- power-domain-opp: This contains phandle to one of the OPP nodes of the master + power domain. This specifies the minimum required OPP of the master domain for + the functioning of the device. This property can only be set for a device, if + the device node contains the "power-domains" property. + +Example: +- OPP table for domain provider that provides two domains. + + domain0_opp_table: opp_table0 { + compatible = "operating-points-v2"; + + domain0_opp_0: opp-1000000000 { + opp-hz = /bits/ 64 <1000000000>; + opp-microvolt = <975000 970000 985000>; + }; + domain0_opp_1: opp-1100000000 { + opp-hz = /bits/ 64 <1100000000>; + opp-microvolt = <1000000 980000 1010000>; + }; + }; + + domain1_opp_table: opp_table1 { + compatible = "operating-points-v2"; + + domain1_opp_0: opp-1200000000 { + opp-hz = /bits/ 64 <1200000000>; + opp-microvolt = <975000 970000 985000>; + }; + domain1_opp_1: opp-1300000000 { + opp-hz = /bits/ 64 <1300000000>; + opp-microvolt = <1000000 980000 1010000>; + }; + }; + + parent: power-controller@12340000 { + compatible = "foo,power-controller"; + reg = <0x12340000 0x1000>; + #power-domain-cells = <1>; + operating-points-v2 = <&domain0_opp_table>, <&domain1_opp_table>; + }; + + leaky-device0@12350000 { + compatible = "foo,i-leak-current"; + reg = <0x12350000 0x1000>; + power-domains = <&parent 0>; + power-domain-opp = <&domain0_opp_0>; + }; + + leaky-device1@12350000 { + compatible = "foo,i-leak-current"; + reg = <0x12350000 0x1000>; + power-domains = <&parent 1>; + power-domain-opp = <&domain1_opp_1>; + }; + [1]. Documentation/devicetree/bindings/power/domain-idle-state.txt