From patchwork Mon Sep 9 16:03:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2862411 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1BD42BF43F for ; Mon, 9 Sep 2013 16:06:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F3F562035A for ; Mon, 9 Sep 2013 16:06:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C6BBE2035D for ; Mon, 9 Sep 2013 16:05:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754237Ab3IIQFD (ORCPT ); Mon, 9 Sep 2013 12:05:03 -0400 Received: from moutng.kundenserver.de ([212.227.126.171]:65120 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755228Ab3IIQEA (ORCPT ); Mon, 9 Sep 2013 12:04:00 -0400 Received: from axis700.grange (dslb-178-006-084-108.pools.arcor-ip.net [178.6.84.108]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0M51cU-1WBIix0qfW-00zUwP; Mon, 09 Sep 2013 18:03:57 +0200 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id CD9CC40BB7; Mon, 9 Sep 2013 18:03:56 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1VJ3wS-0002vW-La; Mon, 09 Sep 2013 18:03:56 +0200 From: Guennadi Liakhovetski To: linux-kernel@vger.kernel.org Cc: Magnus Damm , linux-sh@vger.kernel.org, Linus Walleij , Guennadi Liakhovetski Subject: [PATCH/RFC 4/4] ARM: shmobile: lager: add CPUFreq support Date: Mon, 9 Sep 2013 18:03:56 +0200 Message-Id: <1378742636-11215-5-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1378742636-11215-1-git-send-email-g.liakhovetski@gmx.de> References: <1378742636-11215-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:cmfGUwTpAvR6x3LgZiAk6urQRpbGv3ihbAkbkOEKTj8 Xuscer9qNXky8RtP1Hew49cXYNtbUdL4Mj6iXZicXfAKPkNpdl spVbnFhBlZyBFqJcieJ/erTIhn2X5jGeuyER2RtbB9djwkhtif cbuioLM3IKjx2eVqgYfY4AwoyAvy6ZlSsXOqGJ0HoIolh9qBJQ nejr9EFYOsW8aht0QnRALEjOngZz7pXBdTqpZY16cJJNBTw/aB JBEaZcUnnPWOSRrHDrNkDRcoyZpxlaEi9X7Bi8wIPGDqqzXrWm ibfm5jf1QujizzAw4qwNOFWlyzW7BwDUfRXnbsGBDKzcICsiSw HJQnWNl2MCyEzX1bgpaYYOIdLZJlyqKGQOe+x/y5fXD1Y1znSY ZIbirTwFIAV8A== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The Lager board uses a DA9210 voltage regulator to supply DVFS power to the CA15 cores on the r8a7790 SoC. This patch adds CPUFreq support for that board using the cpufreq-cpu0 driver. Signed-off-by: Guennadi Liakhovetski --- This patch is marked as RFC, because so far I don't have data about r8a7790 valid OPPs. The Lager system boots with 1.3GHz, supplying 1.0V to SoC's DVFS. Apart from that I don't have information what voltage is required for other clock frequencies. Here I'm using a "safe guess" of 0.95V for 700MHz, but we might either wait with this patch until exact data is available, or actually commit these values - this can be decided. arch/arm/boot/dts/r8a7790-lager-reference.dts | 32 ++++++++++++++++++++++++ arch/arm/mach-shmobile/board-lager-reference.c | 4 ++- 2 files changed, 35 insertions(+), 1 deletions(-) diff --git a/arch/arm/boot/dts/r8a7790-lager-reference.dts b/arch/arm/boot/dts/r8a7790-lager-reference.dts index c462ef1..7a41419 100644 --- a/arch/arm/boot/dts/r8a7790-lager-reference.dts +++ b/arch/arm/boot/dts/r8a7790-lager-reference.dts @@ -43,3 +43,35 @@ }; }; }; + +&i2c3 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c3_pins>; + + vdd_dvfs: da9210@68 { + compatible = "diasemi,da9210"; + reg = <0x68>; + + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <1000000>; + regulator-boot-on; + regulator-always-on; + }; +}; + +&cpu0 { + cpu0-supply = <&vdd_dvfs>; + operating-points = < + /* kHz uV - OPs unknown yet */ + 1300000 1000000 + 700000 950000 + >; + voltage-tolerance = <1>; /* 1% */ +}; + +&pfc { + i2c3_pins: i2c3 { + renesas,groups = "i2c3"; + renesas,function = "i2c3"; + }; +}; diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c index 9c316a1..442d854 100644 --- a/arch/arm/mach-shmobile/board-lager-reference.c +++ b/arch/arm/mach-shmobile/board-lager-reference.c @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -29,7 +30,8 @@ static void __init lager_add_standard_devices(void) r8a7790_clock_init(); r8a7790_add_dt_devices(); - of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); + platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0); } static const char *lager_boards_compat_dt[] __initdata = {