From patchwork Thu Jun 4 16:20:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 49532 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 807322154F for ; Thu, 4 Jun 2015 16:20:58 +0000 (UTC) Received: by wgez8 with SMTP id z8sf11365286wge.2 for ; Thu, 04 Jun 2015 09:20:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=8qCiWPbKnI7MfhcVtfQFQwsnovcMQduZttSzxP7gLGo=; b=GoqC3cguSM+If/vicuSk2LjcQkeT8Aret7qKNPcoEsLz/eTSeU9hnXxnVTjj4ThojG rEB9SDxshOiptkbv6h0v1sxc5wqM5ar7GWT/tFBaT+DK3ZZak6MrqX+2aJpT5E/StbC/ xG6wtlK65985kS+njmd5Yi41PJo1nmRv4/1DetEiqk5MyKijmv4z157pnITQZ+CAK4T/ ++9bZfyvsWbdm4So5cKo5J3DLksXgX4I5MtJ0mFbnURIPLbnActJr/+X9/wvDnk7XfXz h3/tfH0kZKcr+yeWrbMO2HjrL8vnY9OSFp4WszhIJn3vrNhflNYhTBsQnBquMIfwo5RI +myA== X-Gm-Message-State: ALoCoQntwkty/J3gERRu0VxY+OM+uN2L2eICd9ux8dn1rxt3j3TM6tylh/USu4ORRU4mNBTZZrXh X-Received: by 10.194.47.179 with SMTP id e19mr36223596wjn.4.1433434857859; Thu, 04 Jun 2015 09:20:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.207.65 with SMTP id lu1ls219782lac.104.gmail; Thu, 04 Jun 2015 09:20:57 -0700 (PDT) X-Received: by 10.152.44.132 with SMTP id e4mr39169129lam.34.1433434857695; Thu, 04 Jun 2015 09:20:57 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id or9si2242718lbb.121.2015.06.04.09.20.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jun 2015 09:20:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbcue7 with SMTP id ue7so30552239lbc.0 for ; Thu, 04 Jun 2015 09:20:57 -0700 (PDT) X-Received: by 10.112.150.167 with SMTP id uj7mr30675318lbb.112.1433434857552; Thu, 04 Jun 2015 09:20:57 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp729045lbb; Thu, 4 Jun 2015 09:20:56 -0700 (PDT) X-Received: by 10.70.93.69 with SMTP id cs5mr69602911pdb.165.1433434855484; Thu, 04 Jun 2015 09:20:55 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vk3si6539248pbc.139.2015.06.04.09.20.54; Thu, 04 Jun 2015 09:20:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932212AbbFDQUx (ORCPT + 11 others); Thu, 4 Jun 2015 12:20:53 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:32808 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932166AbbFDQUx (ORCPT ); Thu, 4 Jun 2015 12:20:53 -0400 Received: by padj3 with SMTP id j3so32601887pad.0 for ; Thu, 04 Jun 2015 09:20:52 -0700 (PDT) X-Received: by 10.66.66.166 with SMTP id g6mr70953445pat.157.1433434852612; Thu, 04 Jun 2015 09:20:52 -0700 (PDT) Received: from localhost ([122.167.219.251]) by mx.google.com with ESMTPSA id af5sm4177858pbc.90.2015.06.04.09.20.51 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 04 Jun 2015 09:20:51 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , rob.herring@linaro.org Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, arnd.bergmann@linaro.org, nm@ti.com, broonie@kernel.org, mike.turquette@linaro.org, sboyd@codeaurora.org, grant.likely@linaro.org, olof@lixom.net, Sudeep.Holla@arm.com, devicetree@vger.kernel.org, viswanath.puttagunta@linaro.org, l.stach@pengutronix.de, thomas.petazzoni@free-electrons.com, linux-arm-kernel@lists.infradead.org, ta.omasab@gmail.com, kesavan.abhilash@gmail.com, khilman@linaro.org, santosh.shilimkar@oracle.com, Viresh Kumar Subject: [PATCH V7 2/3] OPP: Allow multiple OPP tables to be passed via DT Date: Thu, 4 Jun 2015 21:50:32 +0530 Message-Id: <263c128844f5a3c9280c8be71f6c9eb1869a5188.1433434659.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On some platforms (Like Qualcomm's SoCs), it is not decided until runtime on what OPPs to use. The OPP tables can be fixed at compile time, but which table to use is found out only after reading some efuses (sort of an prom) and knowing characteristics of the SoC. To support such platform we need to pass multiple OPP tables per device and hardware should be able to choose one and only one table out of those. Update OPP-v2 bindings to support that. Acked-by: Nishanth Menon Reviewed-by: Stephen Boyd Signed-off-by: Viresh Kumar --- Documentation/devicetree/bindings/power/opp.txt | 52 +++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/Documentation/devicetree/bindings/power/opp.txt b/Documentation/devicetree/bindings/power/opp.txt index 259bf00edf7d..2938c52dbf84 100644 --- a/Documentation/devicetree/bindings/power/opp.txt +++ b/Documentation/devicetree/bindings/power/opp.txt @@ -45,6 +45,9 @@ 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. +Devices may want to choose OPP tables at runtime and so can provide a list of +phandles here. But only *one* of them should be chosen at runtime. + If required, this can be extended for SoC vendor specfic bindings. Such bindings should be documented as Documentation/devicetree/bindings/power/-opp.txt and should have a compatible description like: "operating-points-v2-". @@ -63,6 +66,9 @@ This describes the OPPs belonging to a device. This node can have following reference an OPP. Optional properties: +- opp-name: Name of the OPP table, to uniquely identify it if more than one OPP + table is supplied in "operating-points-v2" property of device. + - opp-shared: Indicates that device nodes using this OPP Table Node's phandle switch their DVFS state together, i.e. they share clock/voltage/current lines. Missing property means devices have independent clock/voltage/current lines, @@ -396,3 +402,49 @@ Example 4: Handling multiple regulators }; }; }; + +Example 5: Multiple OPP tables + +/ { + cpus { + cpu@0 { + compatible = "arm,cortex-a7"; + ... + + cpu-supply = <&cpu_supply> + operating-points-v2 = <&cpu0_opp_table_slow>, <&cpu0_opp_table_fast>; + }; + }; + + cpu0_opp_table_slow: opp_table_slow { + compatible = "operating-points-v2"; + opp-name = "slow"; + opp-shared; + + opp00 { + opp-hz = <600000000>; + ... + }; + + opp01 { + opp-hz = <800000000>; + ... + }; + }; + + cpu0_opp_table_fast: opp_table_fast { + compatible = "operating-points-v2"; + opp-name = "fast"; + opp-shared; + + opp10 { + opp-hz = <1000000000>; + ... + }; + + opp11 { + opp-hz = <1100000000>; + ... + }; + }; +};