From patchwork Wed Nov 26 08:46:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 41527 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 444E625E18 for ; Wed, 26 Nov 2014 08:46:30 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id r20sf1630111wiv.5 for ; Wed, 26 Nov 2014 00:46:29 -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=6fvRZcjH71TsTSbixMFXR3zg+PozdHG+E6ppfsUjD/Y=; b=gtZiy4e/YC4xWRje1V3bjEJTlk48MOKPCyBG658J7s+WSZcEGb/3cRIedS54fcTEBU iAym0ZU7obqPCSlo5tF79DF/CuD3JbK1mdiIbjqXFD+rmCEwz+KbWX2l3ZBPVw1cjzlp Tn4PGKfdCKDT0EOUkOMKjNShX+AcwcXs27QoIqIaPOkJhGa75mAtsp86g/RTw/i+maDr q/9WIDLRB+18y3pJkp+5I5SLGI768u6TVitWexqqWaEvDieQqQWy8t4oFjbtqLUiiVmU Jp65YfxLVybWvPpayGN37ozehQTML7P6kmni4lGUkeV8ugy9S6pQdprUHtPDU6PuoPCd 7F/Q== X-Gm-Message-State: ALoCoQlt8jmQJ8X2cyVPUOuHgHzRFlVFNmeDgd1gMUOa8sWyEf+BAss6rVkyzJMsmYvip14cBUwU X-Received: by 10.112.125.6 with SMTP id mm6mr8799100lbb.8.1416991589526; Wed, 26 Nov 2014 00:46:29 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.11.163 with SMTP id ej3ls654322lad.94.gmail; Wed, 26 Nov 2014 00:46:29 -0800 (PST) X-Received: by 10.152.3.229 with SMTP id f5mr31661026laf.94.1416991589120; Wed, 26 Nov 2014 00:46:29 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id wl2si3658955lbb.95.2014.11.26.00.46.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Nov 2014 00:46:28 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id gq15so2071397lab.18 for ; Wed, 26 Nov 2014 00:46:28 -0800 (PST) X-Received: by 10.112.138.137 with SMTP id qq9mr32568910lbb.80.1416991588683; Wed, 26 Nov 2014 00:46:28 -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 ew9csp586810lbc; Wed, 26 Nov 2014 00:46:27 -0800 (PST) X-Received: by 10.70.38.134 with SMTP id g6mr51407032pdk.124.1416991586916; Wed, 26 Nov 2014 00:46:26 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id iw7si5758705pac.105.2014.11.26.00.46.26 for ; Wed, 26 Nov 2014 00:46:26 -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 S1751005AbaKZIqZ (ORCPT + 4 others); Wed, 26 Nov 2014 03:46:25 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:46570 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750869AbaKZIqY (ORCPT ); Wed, 26 Nov 2014 03:46:24 -0500 Received: by mail-pa0-f43.google.com with SMTP id kx10so2447953pab.16 for ; Wed, 26 Nov 2014 00:46:24 -0800 (PST) X-Received: by 10.66.66.102 with SMTP id e6mr52350391pat.6.1416991584207; Wed, 26 Nov 2014 00:46:24 -0800 (PST) Received: from localhost ([122.167.111.40]) by mx.google.com with ESMTPSA id q3sm3637474pdn.23.2014.11.26.00.46.22 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 26 Nov 2014 00:46:23 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Nishanth Menon , Sudeep Holla , Stephen Boyd , "devicetree@vger.kernel.org" , Santosh Shilimkar , Lorenzo Pieralisi , Arnd Bergmann , Mike Turquette , Rob Herring , Grant Likely , kesavan.abhilash@gmail.com, catalin.marinas@arm.com, k.chander@samsung.com, olof@lixom.net, ta.omasab@gmail.com, Viresh Kumar Subject: [RFC] cpufreq: Add "dvfs-method" binding to probe cpufreq drivers Date: Wed, 26 Nov 2014 14:16:12 +0530 Message-Id: <596a6d49f2b3e2837aa9a54a3e1249161d3c9265.1416991009.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.45 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: , DT based cpufreq drivers doesn't require much support from platform code now a days as most of the stuff is moved behind generic APIs. Like clk APIs for changing clock rates, regulator APIs for changing voltages, etc. One of the bottleneck still left was how to select which cpufreq driver to probe for a given platform as there might be multiple drivers available. Traditionally, we used to create platform devices from machine specific code which binds with a cpufreq driver. And while we moved towards DT based device creation, these devices stayed as is. The problem is getting worse now as we have architectures now with Zero platform specific code. Forcefully these platforms have to create a new file in drivers/cpufreq/ to just add these platform devices in order to use the generic drivers like cpufreq-dt.c. This has been discussed again and again, but with no solution yet. Last it was discussed here: http://lists.infradead.org/pipermail/linux-arm-kernel/2014-May/256154.html This patch is an attempt towards getting the bindings. We only need to have one entry in cpus@cpu0 node which will match with drivers name. We can then add another file drivers/cpufreq/device_dt.c, which will add a platform device with the name it finds from cpus@cpu0 node and existing drivers will work without any change. Or something else if somebody have a better proposal. But lets fix the bindings first. Signed-off-by: Viresh Kumar --- .../devicetree/bindings/cpufreq/drivers.txt | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Documentation/devicetree/bindings/cpufreq/drivers.txt diff --git a/Documentation/devicetree/bindings/cpufreq/drivers.txt b/Documentation/devicetree/bindings/cpufreq/drivers.txt new file mode 100644 index 0000000..bd14917 --- /dev/null +++ b/Documentation/devicetree/bindings/cpufreq/drivers.txt @@ -0,0 +1,53 @@ +Binding to select which cpufreq driver to register + +It is a generic DT binding for selecting which cpufreq-driver to register for +any platform. + +The property listed below must be defined under node /cpus/cpu@0 node. We don't +support multiple CPUFreq driver currently for different cluster and so this +information isn't required to be present in CPUs of all clusters. + +Required properties: +- None + +Optional properties: +- dvfs-method: CPUFreq driver to probe. For example: "arm-bL-cpufreq-dt", + "cpufreq-dt", etc + +Examples: + +cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + compatible = "arm,cortex-a9"; + reg = <0>; + next-level-cache = <&L2>; + operating-points = < + /* kHz uV */ + 792000 1100000 + 396000 950000 + 198000 850000 + >; + dvfs-method = "cpufreq-dt"; + }; + + cpu@1 { + compatible = "arm,cortex-a9"; + reg = <1>; + next-level-cache = <&L2>; + }; + + cpu@2 { + compatible = "arm,cortex-a9"; + reg = <2>; + next-level-cache = <&L2>; + }; + + cpu@3 { + compatible = "arm,cortex-a9"; + reg = <3>; + next-level-cache = <&L2>; + }; +};