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: 10034461 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 060C460291 for ; Tue, 31 Oct 2017 12:48:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6856286D2 for ; Tue, 31 Oct 2017 12:48:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4C44288A2; Tue, 31 Oct 2017 12:48:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CF41286D2 for ; Tue, 31 Oct 2017 12:48:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753083AbdJaMrZ (ORCPT ); Tue, 31 Oct 2017 08:47:25 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:45070 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752434AbdJaMrW (ORCPT ); Tue, 31 Oct 2017 08:47:22 -0400 Received: by mail-pf0-f193.google.com with SMTP id d28so13691391pfe.2 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=dn7bVEoiqir5IjEOCB/jq90/uOdEVQPBO1QnutZNp2KwWFm7kgitu82jxsa9qrgMCj mtXGFBUSeX9glepWX8GvSNtVTtphk/cW9fWUZLJZgLVQQKZg6HKDrQdvwPwOyclU62wT Q6PQWQ8bfXsAUW4lUFKdUw+pJi3LqgzcO+oW/es+3IRMKkczGLqxmE+aRAXnptl2+e5B buNcHKrWA1OfGwyxS4je044BFtqC1fyY05GgeCAlYdDjgZ/1pBwa8KEiPNp2byVjlz6r OFL6Pq93yL+VR85NN+lcQDMrdcsLCVKeNLpFVg2NCO8NHS3MJxIHCIrFJF5LcooAG4tU EtYw== X-Gm-Message-State: AMCzsaX60PEzsBoxgDk+72lTH+ImmFBteDQo/hPO3Ru7jyUqpgFYwwmQ DckIV2ahDcI4fN9ShN99ijQcIg== X-Google-Smtp-Source: ABhQp+SI88kcjitr814DoI73jzDSY2BmQ+0BpTZZwMZcMtLkGPJj0bdYnr8zVsH12cL9AX6khzvjvw== 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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Ulf Hansson --- Documentation/devicetree/bindings/opp/opp.txt | 12 +++++ .../devicetree/bindings/power/power_domain.txt | 62 ++++++++++++++++++++++ 2 files changed, 74 insertions(+) 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