From patchwork Wed May 20 03:41:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 48780 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6C6D42121F for ; Wed, 20 May 2015 03:42:43 +0000 (UTC) Received: by wivs14 with SMTP id s14sf14786362wiv.1 for ; Tue, 19 May 2015 20:42:42 -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=3i4cqlg+dyTWqCZkTZ6wROFEd2h/RwfL9cXDVcTb8Gg=; b=HAlPvMzF2xpkJF2XZwY9HPeGR2BLcvBbM007VoCRQtu/5TgsnFtSlbiXm+3m8zrFgn F23vwzj3a0x4smzv2DtEC0heJIdjFUGhmsifMN4jk/dF+Sb5UDgk+ChAxbl9lB8IWFgZ qZY6EL47MJoNqFspXvFrihu19vNCLQ5tgSPs+QI1h5x/xAwX5OnUm7D2LopHT5yUsFSw ix0znpZDZRi67FSr4dyuo69K6Yes/r/VX2wW6bsFUysW6JN/3oxxLorM+nHfLD0AMmy9 o3o2ydaM5pAEnvU9eTOdIc5Z+KgqgM/ykkRWfzKIMmFIlHy+BFhY+rLsZYTnzTza9YJ/ bTTQ== X-Gm-Message-State: ALoCoQkZ8s8stTJgAYVXwYgVWNXxiWrex2xzw5V9bw0ILARb8NDwFH1fiAx0pO/NrxJQ3135c09k X-Received: by 10.112.118.162 with SMTP id kn2mr24604939lbb.22.1432093362727; Tue, 19 May 2015 20:42:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.43 with SMTP id ll11ls144037lac.12.gmail; Tue, 19 May 2015 20:42:42 -0700 (PDT) X-Received: by 10.152.183.200 with SMTP id eo8mr24461095lac.57.1432093362566; Tue, 19 May 2015 20:42:42 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id li2si10338411lab.51.2015.05.19.20.42.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 May 2015 20:42:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by lagv1 with SMTP id v1so54731819lag.3 for ; Tue, 19 May 2015 20:42:42 -0700 (PDT) X-Received: by 10.152.9.66 with SMTP id x2mr24218569laa.36.1432093362223; Tue, 19 May 2015 20:42:42 -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 hn6csp1237219lbb; Tue, 19 May 2015 20:42:41 -0700 (PDT) X-Received: by 10.70.128.200 with SMTP id nq8mr60067384pdb.167.1432093357729; Tue, 19 May 2015 20:42:37 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay3si24334283pbc.54.2015.05.19.20.42.36; Tue, 19 May 2015 20:42:37 -0700 (PDT) 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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752459AbbETDmQ (ORCPT + 7 others); Tue, 19 May 2015 23:42:16 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:36456 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751997AbbETDmP (ORCPT ); Tue, 19 May 2015 23:42:15 -0400 Received: by pabts4 with SMTP id ts4so50678122pab.3 for ; Tue, 19 May 2015 20:42:15 -0700 (PDT) X-Received: by 10.69.18.10 with SMTP id gi10mr14239965pbd.16.1432093335240; Tue, 19 May 2015 20:42:15 -0700 (PDT) Received: from localhost ([122.167.226.34]) by mx.google.com with ESMTPSA id m8sm14486359pdn.5.2015.05.19.20.42.13 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 19 May 2015 20:42:14 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , rob.herring@linaro.org, arnd.bergmann@linaro.org, nm@ti.com, broonie@kernel.org, mike.turquette@linaro.org, sboyd@codeaurora.org Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.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 V5 2/3] OPP: Allow multiple OPP tables to be passed via DT Date: Wed, 20 May 2015 09:11:39 +0530 Message-Id: <4690ad854263d6553debab67d65d230105c206ec.1432091956.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@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.215.52 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 d132e2927b21..7f30d9b07db7 100644 --- a/Documentation/devicetree/bindings/power/opp.txt +++ b/Documentation/devicetree/bindings/power/opp.txt @@ -46,6 +46,9 @@ Devices supporting OPPs must set their "operating-points-v2" property with phandle to a OPP descriptor 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. + * OPP Descriptor Node @@ -61,6 +64,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 descriptor'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, @@ -394,3 +400,49 @@ Example 4: Handling multiple regulators }; }; }; + +Example 5: Multiple OPP tables + +/ { + cpus { + cpu@0 { + compatible = "arm,cortex-a7"; + ... + + opp-supply = <&cpu_supply> + operating-points-v2 = <&cpu0_opp0>, <&cpu0_opp1>; + }; + }; + + cpu0_opp0: opp0 { + compatible = "operating-points-v2"; + opp-name = "opp-slow"; + opp-shared; + + entry00 { + opp-hz = <600000000>; + ... + }; + + entry01 { + opp-hz = <800000000>; + ... + }; + }; + + cpu0_opp1: opp1 { + compatible = "operating-points-v2"; + opp-name = "opp-fast"; + opp-shared; + + entry10 { + opp-hz = <1000000000>; + ... + }; + + entry11 { + opp-hz = <1100000000>; + ... + }; + }; +};