From patchwork Fri Feb 5 16:58:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mason X-Patchwork-Id: 8237541 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 289A89F3CD for ; Fri, 5 Feb 2016 17:00:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5612F20383 for ; Fri, 5 Feb 2016 17:00:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7686B20375 for ; Fri, 5 Feb 2016 17:00:36 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aRjis-0003oK-Pw; Fri, 05 Feb 2016 16:59:06 +0000 Received: from smtp2-g21.free.fr ([2a01:e0c:1:1599::11]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aRjiq-0003ko-Al for linux-arm-kernel@lists.infradead.org; Fri, 05 Feb 2016 16:59:04 +0000 Received: from [172.27.0.114] (unknown [83.142.147.193]) (Authenticated sender: slash.tmp) by smtp2-g21.free.fr (Postfix) with ESMTPSA id 4EE274B015C; Fri, 5 Feb 2016 17:56:16 +0100 (CET) To: linux-pm , Linux ARM From: Mason Subject: [PATCH RFC] Add cpufreq support Message-ID: <56B4D4BE.2040008@free.fr> Date: Fri, 5 Feb 2016 17:58:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160205_085904_540672_BE0232CA X-CRM114-Status: GOOD ( 10.98 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Viresh Kumar , Arnd Bergmann Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED, 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 I'm throwing this out there to ask: Is this the right way to enable cpufreq on my platform? --- arch/arm/boot/dts/tango4-common.dtsi | 4 ++++ arch/arm/boot/dts/tango4-smp8758.dtsi | 2 ++ arch/arm/mach-tango/setup.c | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/arch/arm/boot/dts/tango4-common.dtsi b/arch/arm/boot/dts/tango4-common.dtsi index 41dff0a93419..557cb67d183f 100644 --- a/arch/arm/boot/dts/tango4-common.dtsi +++ b/arch/arm/boot/dts/tango4-common.dtsi @@ -193,3 +193,7 @@ }; }; }; + +&cpu0 { + clocks = <&clkgen CPU_CLK>; +}; diff --git a/arch/arm/boot/dts/tango4-smp8758.dtsi b/arch/arm/boot/dts/tango4-smp8758.dtsi index 7ed88ee629fb..0db290a8334d 100644 --- a/arch/arm/boot/dts/tango4-smp8758.dtsi +++ b/arch/arm/boot/dts/tango4-smp8758.dtsi @@ -11,6 +11,8 @@ next-level-cache = <&l2cc>; device_type = "cpu"; reg = <0>; + clock-latency = <300000>; + operating-points = <1215000 0 607500 0 405000 0 243000 0 135000 0>; }; cpu1: cpu@1 { diff --git a/arch/arm/mach-tango/setup.c b/arch/arm/mach-tango/setup.c index a796841c039b..0e8f90f70e85 100644 --- a/arch/arm/mach-tango/setup.c +++ b/arch/arm/mach-tango/setup.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "smc.h" static struct map_desc tango_map_desc[] __initdata = { @@ -23,6 +24,11 @@ static void tango_l2c_write(unsigned long val, unsigned int reg) tango_set_l2_control(val); } +static void __init tango_init_late(void) +{ + platform_device_register_simple("cpufreq-dt", -1, NULL, 0); +} + static const char *const tango_dt_compat[] = { "sigma,tango4", NULL }; DT_MACHINE_START(TANGO_DT, "Sigma Tango DT") @@ -30,4 +36,5 @@ DT_MACHINE_START(TANGO_DT, "Sigma Tango DT") .l2c_aux_mask = ~0, .l2c_write_sec = tango_l2c_write, .map_io = tango_map_io, + .init_late = tango_init_late, MACHINE_END