From patchwork Thu Dec 4 11:14:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 41929 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AC2FA25E8C for ; Thu, 4 Dec 2014 11:14:21 +0000 (UTC) Received: by mail-wg0-f71.google.com with SMTP id l18sf10679897wgh.6 for ; Thu, 04 Dec 2014 03:14:20 -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=0isqhdPhpF3h7iVE/2jPshpE3W5K6UpyG00ezHnAu40=; b=B2AbJC1OjUztGQjmS9wVky0SPlCXn1EzDRqG+ApM5he+JfqkWjLyzzYCO5lZF8lXFE B9HhuVQVdNl0ZCJLAeqtSIgr1qjP9rC0sk7AJjvxi7+/udPQlaZdArATxl99T/svC2da wXImTdbJ3Uf/QJNjdjBKZBq1ylkf5YjEKQQ10doT4A5/qR7uZDCNd86dNgOLTq2rzpB8 lFH2+9d4f7b7n6SkFfgVEmLAS7a5/5LmoPes/Yv466jyzgzimUN8fpOtHiUjAHOxAE4/ AL6FNMFMyP1MtS0L5p5RfWu4aE1uX/Ll+okzwfZizLYiRrOxB1k73idkyqrpM4c4VKJd 5oZw== X-Gm-Message-State: ALoCoQnP/hQ6w6IXY6UqYdrf8HD+OloiKn30urZa500CHp7omUKBe5VD5KVZuPlAzoJq3BumyIni X-Received: by 10.112.142.36 with SMTP id rt4mr2131107lbb.3.1417691659610; Thu, 04 Dec 2014 03:14:19 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.9 with SMTP id f9ls240564laa.66.gmail; Thu, 04 Dec 2014 03:14:19 -0800 (PST) X-Received: by 10.152.120.42 with SMTP id kz10mr6267900lab.92.1417691659368; Thu, 04 Dec 2014 03:14:19 -0800 (PST) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id f7si1487476lah.127.2014.12.04.03.14.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Dec 2014 03:14:19 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by mail-la0-f54.google.com with SMTP id pv20so9466539lab.27 for ; Thu, 04 Dec 2014 03:14:19 -0800 (PST) X-Received: by 10.112.52.37 with SMTP id q5mr8754172lbo.32.1417691659150; Thu, 04 Dec 2014 03:14:19 -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.184.201 with SMTP id ew9csp15885lbc; Thu, 4 Dec 2014 03:14:18 -0800 (PST) X-Received: by 10.68.129.6 with SMTP id ns6mr18406198pbb.137.1417691657455; Thu, 04 Dec 2014 03:14:17 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sw8si42545443pbc.77.2014.12.04.03.14.16 for ; Thu, 04 Dec 2014 03:14:17 -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 S1753517AbaLDLOQ (ORCPT + 4 others); Thu, 4 Dec 2014 06:14:16 -0500 Received: from mail-pd0-f177.google.com ([209.85.192.177]:45794 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753306AbaLDLOO (ORCPT ); Thu, 4 Dec 2014 06:14:14 -0500 Received: by mail-pd0-f177.google.com with SMTP id ft15so17202521pdb.8 for ; Thu, 04 Dec 2014 03:14:14 -0800 (PST) X-Received: by 10.68.225.193 with SMTP id rm1mr24744646pbc.77.1417691654226; Thu, 04 Dec 2014 03:14:14 -0800 (PST) Received: from localhost ([122.166.92.172]) by mx.google.com with ESMTPSA id yp5sm24788213pbb.16.2014.12.04.03.14.12 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 04 Dec 2014 03:14:13 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , arnd.bergmann@linaro.org, rob.herring@linaro.org, grant.likely@linaro.org, olof@lixom.net 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, Viresh Kumar Subject: [RFC] OPP: Redefine bindings to overcome shortcomings Date: Thu, 4 Dec 2014 16:44:03 +0530 Message-Id: <52c403454c3b8fc201abe7ac74cf657638479311.1417691389.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.0.3.693.g996b0fd 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.54 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: , Hi Rob, et al.. 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. And this is the first try to get those with a pen and paper. The shortcomings we are trying to solve here: - Some kind of compatibility string to probe the right cpufreq driver for platforms, 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 - Other per OPP settings: transition latencies, disabled status, etc.? The below document should be enough to describe how I am trying to fix these. Please let me know what all I need to fix, surely there would be lots of obstacles. I am prepared to get beaten up :) I accept in advance that naming is extremely bad here, I need some suggestions for sure. Signed-off-by: Viresh Kumar --- Documentation/devicetree/bindings/power/opp.txt | 147 ++++++++++++++++++++++++ 1 file changed, 147 insertions(+) diff --git a/Documentation/devicetree/bindings/power/opp.txt b/Documentation/devicetree/bindings/power/opp.txt index 74499e5..5efd8d4 100644 --- a/Documentation/devicetree/bindings/power/opp.txt +++ b/Documentation/devicetree/bindings/power/opp.txt @@ -4,6 +4,153 @@ 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 device as an example to +illustrate how to define OPPs. + +linux,operating-points, opp-lists and opps: + +- linux,operating-points: + Container of all OPP nodes. + + Required properties: + - opp nodes (explained below) + + Optional properties: + - compatible: allow OPPs to express their compatibility with devices + + +- opp-list@*: + List of nodes defining performance points. Following belong to the nodes + within the opp-lists. + + Required properties: + - frequency-kHz: Frequency in kHz + - voltage-uV: voltage in micro Volts + + Optional properties: + - turbo-mode: Marks the volt-freq pair as turbo pair. + - status: Marks the node enabled/disabled. + + +- opp@*: + Operating performance point node per device. Multiple devices sharing it can + use its phandle in their 'opp' property. + + Required properties: + - opp-list: phandle to opp-list defined above. + + Optional properties: + - clocks: Tuple of clock providers + - clock-names: Clock names + - opp-supply: phandle to the parent supply/regulator node + - voltage-tolerance: Specify the CPU voltage tolerance in percentage. + - clock-latency: Specify the possible maximum transition latency for clock, + in unit of nanoseconds. + +Example: Multi-cluster system with separate clock lines for clusters. All CPUs + in the clusters share same clock lines. + +/ { + cpus { + #address-cells = <1>; + #size-cells = <0>; + + linux,operating-points { + compatible = "linux,cpufreq-dt"; + + opp-list0: opp-list@0 { + { + frequency-kHz = <1000000>; + voltage-uV = <975000>; + status = "okay"; + }; + { + frequency-kHz = <1100000>; + voltage-uV = <1000000>; + status = "okay"; + }; + { + frequency-kHz = <1200000>; + voltage-uV = <1025000>; + status = "okay"; + turbo-mode; + }; + }; + + opp-list1: opp-list@1 { + { + frequency-kHz = <1300000>; + voltage-uV = <1050000>; + status = "okay"; + }; + { + frequency-kHz = <1400000>; + voltage-uV = <1075000>; + status = "disabled"; + }; + { + frequency-kHz = <1500000>; + voltage-uV = <1100000>; + status = "okay"; + turbo-mode; + }; + }; + + opp0: opp@0 { + clocks = <&clk-controller 0>; + clock-names = "cpu"; + opp-supply = <&cpu-supply0>; + voltage-tolerance = <2>; /* percentage */ + clock-latency = <300000>; + opp-list = <&opp-list0>; + }; + + opp1: opp@1 { + clocks = <&clk-controller 1>; + clock-names = "cpu"; + opp-supply = <&cpu-supply1>; + voltage-tolerance = <2>; /* percentage */ + clock-latency = <400000>; + opp-list = <&opp-list1>; + }; + }; + + cpu@0 { + compatible = "arm,cortex-a7"; + reg = <0>; + next-level-cache = <&L2>; + opps = ; + }; + + cpu@1 { + compatible = "arm,cortex-a7"; + reg = <1>; + next-level-cache = <&L2>; + opps = ; + }; + + cpu@100 { + compatible = "arm,cortex-a15"; + reg = <100>; + next-level-cache = <&L2>; + opps = ; + }; + + cpu@101 { + compatible = "arm,cortex-a15"; + reg = <101>; + next-level-cache = <&L2>; + opps = ; + }; + }; +}; + + + +Deprecated Bindings +------------------- + Properties: - operating-points: An array of 2-tuples items, and each item consists of frequency and voltage like .