From patchwork Fri Jan 23 10:44:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 43609 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f197.google.com (mail-we0-f197.google.com [74.125.82.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5539E218DB for ; Fri, 23 Jan 2015 10:45:10 +0000 (UTC) Received: by mail-we0-f197.google.com with SMTP id l61sf3771159wev.0 for ; Fri, 23 Jan 2015 02:45:09 -0800 (PST) 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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=Jqpg5kO8EJv7wI+cqNWtoVyHhhyXtPd1N0sQsd/OjQk=; b=m0d/BlREcJ9MGGQ3nq4q7z4nnfheFdGAcuPSJI7a7Ng/cm1xGgdfF9lBO5rUZPkG8M xWMAxG4g/8DdPZweAkoHsbddTo2F2HIcthevLTLrIn2spp5Im6Ij2A2JU/sbtayXm1IS 7ovfv3G06GWlviGTmwsEVXcjEtho2Kbw32IAdp13uHAvWHgA25SeZg8Cw+V6xZrz87YM GdgkAN9m0209nvuo8wpkDpgGRhSGt0+SfJsTWnCjQyKfa4CdgyNfxg30ooDcxASbO5pb QhyRihAYPhfy9REdCc5M1iux4FofTNWfE9ib8yy20h7VdR1nr56DufOWERh/ngLLOj2E ZMhw== X-Gm-Message-State: ALoCoQnyFy9g9sY5D6gRPzZiTRSTTa/ZCuB08GiQC+QTLcXsRrtdaGMDZuvd7OSJHN4mxgmJYKNi X-Received: by 10.180.212.76 with SMTP id ni12mr192254wic.0.1422009908785; Fri, 23 Jan 2015 02:45:08 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.225 with SMTP id i1ls284039lae.19.gmail; Fri, 23 Jan 2015 02:45:08 -0800 (PST) X-Received: by 10.152.234.35 with SMTP id ub3mr6626001lac.70.1422009908540; Fri, 23 Jan 2015 02:45:08 -0800 (PST) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id g8si1013169laf.55.2015.01.23.02.45.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jan 2015 02:45:08 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by mail-la0-f46.google.com with SMTP id s18so6583606lam.5 for ; Fri, 23 Jan 2015 02:45:08 -0800 (PST) X-Received: by 10.112.14.6 with SMTP id l6mr6548247lbc.91.1422009908354; Fri, 23 Jan 2015 02:45:08 -0800 (PST) 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.9.200 with SMTP id c8csp204221lbb; Fri, 23 Jan 2015 02:45:07 -0800 (PST) X-Received: by 10.68.236.163 with SMTP id uv3mr10004217pbc.5.1422009906083; Fri, 23 Jan 2015 02:45:06 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bn9si1532120pdb.54.2015.01.23.02.45.05; Fri, 23 Jan 2015 02:45:06 -0800 (PST) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753318AbbAWKpE (ORCPT + 5 others); Fri, 23 Jan 2015 05:45:04 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:42711 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753314AbbAWKpC (ORCPT ); Fri, 23 Jan 2015 05:45:02 -0500 Received: by mail-pa0-f41.google.com with SMTP id kq14so5296172pab.0 for ; Fri, 23 Jan 2015 02:45:01 -0800 (PST) X-Received: by 10.68.94.69 with SMTP id da5mr9820754pbb.99.1422009900890; Fri, 23 Jan 2015 02:45:00 -0800 (PST) Received: from localhost ([122.178.198.250]) by mx.google.com with ESMTPSA id pi1sm1479726pdb.91.2015.01.23.02.44.59 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 23 Jan 2015 02:45:00 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , arnd.bergmann@linaro.org, rob.herring@linaro.org, grant.likely@linaro.org, olof@lixom.ne Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, nm@ti.com, Sudeep.Holla@arm.com, sboyd@codeaurora.org, devicetree@vger.kernel.org, santosh.shilimkar@oracle.com, mike.turquette@linaro.org, kesavan.abhilash@gmail.com, catalin.marinas@arm.com, ta.omasab@gmail.com, linux-arm-kernel@lists.infradead.org, thomas.petazzoni@free-electrons.com, l.stach@pengutronix.de, broonie@kernel.org, Viresh Kumar Subject: [RFC V2] OPP: Redefine bindings to overcome shortcomings Date: Fri, 23 Jan 2015 16:14:50 +0530 Message-Id: X-Mailer: git-send-email 2.3.0.rc0.44.ga94655d 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.46 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: , Rob et al, This is another attempt to redefine OPP bindings which we concluded to after first round of reviews. Current OPP (Operating performance point) DT bindings are proven to be insufficient at multiple instances. There had been multiple band-aid approaches to get them fixed (The latest one being: http://www.mail-archive.com/devicetree@vger.kernel.org/msg53398.html). For obvious reasons Rob rejected them and shown the right path forward. The shortcomings we are trying to solve here: - How to select which driver to probe for a platform, when multiple drivers are available. For example: how to choose between cpufreq-dt and arm_big_little drivers. - Getting clock sharing information between CPUs. Single shared clock vs independent clock per core vs shared clock per cluster. - Support for turbo modes - Support for intermediate frequencies - Other per OPP settings: transition latencies, disabled status, etc.? Please see the below bindings for further details. I haven't incorporated the comments given by Mark Brown as I had some doubts. @broonie: Is this what you wanted to mention earlier ? : http://pastebin.com/1RZTccmm Signed-off-by: Viresh Kumar --- Documentation/devicetree/bindings/power/opp.txt | 309 +++++++++++++++++++++++- 1 file changed, 308 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/power/opp.txt b/Documentation/devicetree/bindings/power/opp.txt index 74499e5033fc..9cdc0c9b09af 100644 --- a/Documentation/devicetree/bindings/power/opp.txt +++ b/Documentation/devicetree/bindings/power/opp.txt @@ -1,9 +1,316 @@ -* Generic OPP Interface +Generic OPP (Operating Performance Points) Interface +---------------------------------------------------- SoCs have a standard set of tuples consisting of frequency and voltage pairs that the device will support per voltage domain. These are called Operating Performance Points or OPPs. +This documents defines OPP bindings with its required/optional properties. OPPs +can be defined for any device, this file uses CPU as an example to illustrate +how to define OPPs. + +opp nodes and opp-lists + +- opp-listN: + List of nodes defining performance points. Following belong to the nodes + within the opp-lists. + + Required properties: + - opp-khz: Frequency in kHz + - opp-microvolt: voltage in micro Volts + + Optional properties: + - turbo-mode: Marks the volt-freq pair as turbo pair. + - status: Marks the node enabled/disabled. + - voltage-tolerance: Specify the CPU voltage tolerance in percentage. + - clock-latency-ns: Specify the possible maximum transition latency (in + nanoseconds) for switching to this opp from any other opp. + +- oppN: + Operating performance point node per device. Devices using it should have its + phandle in their "operating-points-v2" property. + + Required properties: + - compatible: allow OPPs to express their compatibility. + - opp-list: phandle to opp-list defined above. + + Optional properties: + - opp-intermediate: Stable opp we *must* switch to, before switching to the + target opp. Contains phandle of one of the opp-node present in opp-list. + +Example 1: Simple case of dual-core cortex A9-single cluster, sharing clock line. + +/ { + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + compatible = "arm,cortex-a9"; + reg = <0>; + next-level-cache = <&L2>; + clocks = <&clk_controller 0>; + clock-names = "cpu"; + opp-supply = <&cpu_supply0>; + operating-points-v2 = <&cpu0_opp>; + }; + + cpu@1 { + compatible = "arm,cortex-a9"; + reg = <1>; + next-level-cache = <&L2>; + clocks = <&clk_controller 0>; + clock-names = "cpu"; + opp-supply = <&cpu_supply0>; + operating-points-v2 = <&cpu0_opp>; + }; + }; + + cpu0_opp: opp0 { + compatible = "linux,cpu-dvfs"; + opp-list = <&cpu0_opplist>; + opp-intermediate = <&cpu0_intermediate>; + + cpu0_opplist: opp-list0 { + entry00 { + opp-khz = <1000000>; + opp-microvolt = <975000>; + voltage-tolerance = <2>; + clock-latency-ns = <300000>; + status = "okay"; + }; + cpu0_intermediate: entry01 { + opp-khz = <1100000>; + opp-microvolt = <1000000>; + voltage-tolerance = <3>; + clock-latency-ns = <310000>; + status = "okay"; + }; + entry02 { + opp-khz = <1200000>; + opp-microvolt = <1025000>; + voltage-tolerance = <1>; + clock-latency-ns = <290000>; + status = "okay"; + turbo-mode; + }; + }; + }; +}; + +Example 2: Quad-core krait (All CPUs have independent clock lines but have same set of OPPs) + +/ { + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + compatible = "qcom,krait"; + reg = <0>; + next-level-cache = <&L2>; + clocks = <&clk_controller 0>; + clock-names = "cpu"; + opp-supply = <&cpu_supply0>; + operating-points-v2 = <&cpu0_opp>; + }; + + cpu@1 { + compatible = "qcom,krait"; + reg = <1>; + next-level-cache = <&L2>; + clocks = <&clk_controller 1>; + clock-names = "cpu"; + opp-supply = <&cpu_supply1>; + operating-points-v2 = <&cpu1_opp>; + }; + + cpu@2 { + compatible = "qcom,krait"; + reg = <2>; + next-level-cache = <&L2>; + clocks = <&clk_controller 2>; + clock-names = "cpu"; + opp-supply = <&cpu_supply2>; + operating-points-v2 = <&cpu2_opp>; + }; + + cpu@3 { + compatible = "qcom,krait"; + reg = <3>; + next-level-cache = <&L2>; + clocks = <&clk_controller 3>; + clock-names = "cpu"; + opp-supply = <&cpu_supply3>; + operating-points-v2 = <&cpu3_opp>; + }; + }; + + cpu0_opp: opp0 { + compatible = "linux,cpu-dvfs"; + opp-list = <&cpu0_opplist>; + opp-intermediate = <&cpu0_intermediate>; + + cpu0_opplist: opp-list0 { + entry00 { + opp-khz = <1000000>; + opp-microvolt = <975000>; + voltage-tolerance = <2>; + clock-latency-ns = <300000>; + status = "okay"; + }; + cpu0_intermediate: entry01 { + opp-khz = <1100000>; + opp-microvolt = <1000000>; + voltage-tolerance = <2>; + clock-latency-ns = <300000>; + status = "okay"; + }; + entry02 { + opp-khz = <1200000>; + opp-microvolt = <1025000>; + voltage-tolerance = <2>; + clock-latency-ns = <300000>; + status = "okay"; + turbo-mode; + }; + }; + }; + + cpu1_opp: opp1 { + compatible = "linux,cpu-dvfs"; + opp-list = <&cpu0_opplist>; + opp-intermediate = <&cpu0_intermediate>; + }; + + cpu2_opp: opp2 { + compatible = "linux,cpu-dvfs"; + opp-list = <&cpu0_opplist>; + }; + + cpu3_opp: opp3 { + compatible = "linux,cpu-dvfs"; + opp-list = <&cpu0_opplist>; + opp-intermediate = <&cpu0_intermediate>; + }; +}; + +Example 3: Multi-cluster system with separate clock line per cluster. + +/ { + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + compatible = "arm,cortex-a7"; + reg = <0>; + next-level-cache = <&L2>; + clocks = <&clk_controller 0>; + clock-names = "cpu"; + opp-supply = <&cpu_supply0>; + operating-points-v2 = <&cpu0_opp>; + }; + + cpu@1 { + compatible = "arm,cortex-a7"; + reg = <1>; + next-level-cache = <&L2>; + clocks = <&clk_controller 0>; + clock-names = "cpu"; + opp-supply = <&cpu_supply0>; + operating-points-v2 = <&cpu0_opp>; + }; + + cpu@100 { + compatible = "arm,cortex-a15"; + reg = <100>; + next-level-cache = <&L2>; + clocks = <&clk_controller 1>; + clock-names = "cpu"; + opp-supply = <&cpu_supply1>; + operating-points-v2 = <&cpu100_opp>; + }; + + cpu@101 { + compatible = "arm,cortex-a15"; + reg = <101>; + next-level-cache = <&L2>; + clocks = <&clk_controller 1>; + clock-names = "cpu"; + opp-supply = <&cpu_supply1>; + operating-points-v2 = <&cpu100_opp>; + }; + }; + + cpu0_opp: opp0 { + compatible = "linux,cpu-dvfs"; + opp-list = <&cpu0_opplist>; + opp-intermediate = <&cpu0_intermediate>; + + cpu0_opplist: opp-list0 { + entry00 { + opp-khz = <1000000>; + opp-microvolt = <975000>; + voltage-tolerance = <2>; + clock-latency-ns = <300000>; + status = "okay"; + }; + cpu0_intermediate: entry01 { + opp-khz = <1100000>; + opp-microvolt = <1000000>; + voltage-tolerance = <2>; + clock-latency-ns = <300000>; + status = "okay"; + }; + entry02 { + opp-khz = <1200000>; + opp-microvolt = <1025000>; + voltage-tolerance = <2>; + clock-latency-ns = <300000>; + status = "okay"; + turbo-mode; + }; + }; + }; + + cpu100_opp: opp1 { + compatible = "linux,cpu-dvfs"; + opp-list = <&cpu100_opplist>; + opp-intermediate = <&cpu100_intermediate>; + + cpu100_opplist: opp-list1 { + entry10 { + opp-khz = <1300000>; + opp-microvolt = <1050000>; + voltage-tolerance = <2>; + clock-latency-ns = <400000>; + status = "okay"; + }; + cpu100_intermediate: entry11 { + opp-khz = <1400000>; + opp-microvolt = <1075000>; + voltage-tolerance = <2>; + clock-latency-ns = <400000>; + status = "okay"; + }; + entry12 { + opp-khz = <1500000>; + opp-microvolt = <1100000>; + voltage-tolerance = <2>; + clock-latency-ns = <400000>; + status = "okay"; + turbo-mode; + }; + }; + }; +}; + + + +Deprecated Bindings +------------------- + Properties: - operating-points: An array of 2-tuples items, and each item consists of frequency and voltage like .