From patchwork Mon Feb 25 16:30:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Pargmann X-Patchwork-Id: 222961 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 34C212C02A2 for ; Tue, 26 Feb 2013 03:34:20 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1UA0xI-0006Dd-G0; Mon, 25 Feb 2013 16:31:08 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1UA0x1-00069C-Jb for linux-arm-kernel@lists.infradead.org; Mon, 25 Feb 2013 16:30:52 +0000 Received: from dude.hi.pengutronix.de ([2001:6f8:1178:2:21e:67ff:fe11:9c5c]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1UA0wy-0000Ow-0U; Mon, 25 Feb 2013 17:30:48 +0100 Received: from mpa by dude.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1UA0wx-0006UO-VK; Mon, 25 Feb 2013 17:30:47 +0100 From: Markus Pargmann To: s.hauer@pengutronix.de Subject: [PATCH 1/4] ARM: imx: Add cpufreq support for i.MX27 Date: Mon, 25 Feb 2013 17:30:16 +0100 Message-Id: <1361809819-24383-2-git-send-email-mpa@pengutronix.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1361809819-24383-1-git-send-email-mpa@pengutronix.de> References: <1361809819-24383-1-git-send-email-mpa@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:6f8:1178:2:21e:67ff:fe11:9c5c X-SA-Exim-Mail-From: mpa@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130225_113051_858028_A1468092 X-CRM114-Status: GOOD ( 20.27 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: kernel@pengutronix.de, Markus Pargmann , t.gamez@phytec.de, linux-arm-kernel@lists.infradead.org, c.hemp@phytec.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org From: Christian Hemp Adding cpu scaling support for the i.MX27. It supports 399MHz and 133MHz now. [mpa: rebase to 3.8-rc, adaption for clock framework, cleanup] Signed-off-by: Teresa Gámez Signed-off-by: Christian Hemp Signed-off-by: Markus Pargmann --- arch/arm/mach-imx/Kconfig | 1 + arch/arm/mach-imx/Makefile | 3 +++ arch/arm/mach-imx/clk-imx27.c | 5 +++++ arch/arm/mach-imx/cpu_op-mx27.c | 37 +++++++++++++++++++++++++++++++++++++ arch/arm/mach-imx/cpu_op-mx27.h | 19 +++++++++++++++++++ 5 files changed, 65 insertions(+) create mode 100644 arch/arm/mach-imx/cpu_op-mx27.c create mode 100644 arch/arm/mach-imx/cpu_op-mx27.h diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 0a2349d..5184f12 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig @@ -131,6 +131,7 @@ config SOC_IMX25 config SOC_IMX27 bool + select ARCH_HAS_CPUFREQ select COMMON_CLK select CPU_ARM926T select IMX_HAVE_IOMUX_V1 diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index 0634b31..3118ed4 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile @@ -7,6 +7,9 @@ obj-$(CONFIG_SOC_IMX25) += clk-imx25.o mm-imx25.o ehci-imx25.o cpu-imx25.o obj-$(CONFIG_SOC_IMX27) += cpu-imx27.o pm-imx27.o obj-$(CONFIG_SOC_IMX27) += clk-imx27.o mm-imx27.o ehci-imx27.o +ifdef CONFIG_SOC_IMX27 +obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx27.o +endif obj-$(CONFIG_SOC_IMX31) += mm-imx3.o cpu-imx31.o clk-imx31.o iomux-imx31.o ehci-imx31.o pm-imx3.o obj-$(CONFIG_SOC_IMX35) += mm-imx3.o cpu-imx35.o clk-imx35.o ehci-imx35.o pm-imx3.o diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c index 1ffe3b534..d98bfb0 100644 --- a/arch/arm/mach-imx/clk-imx27.c +++ b/arch/arm/mach-imx/clk-imx27.c @@ -9,6 +9,7 @@ #include "clk.h" #include "common.h" #include "hardware.h" +#include "cpu_op-mx27.h" #define IO_ADDR_CCM(off) (MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR + (off))) @@ -91,6 +92,10 @@ int __init mx27_clocks_init(unsigned long fref) { int i; +#if defined(CONFIG_CPU_FREQ_IMX) + get_cpu_op = mx27_get_cpu_op; +#endif + clk[dummy] = imx_clk_fixed("dummy", 0); clk[ckih] = imx_clk_fixed("ckih", fref); clk[ckil] = imx_clk_fixed("ckil", 32768); diff --git a/arch/arm/mach-imx/cpu_op-mx27.c b/arch/arm/mach-imx/cpu_op-mx27.c new file mode 100644 index 0000000..fa2d743 --- /dev/null +++ b/arch/arm/mach-imx/cpu_op-mx27.c @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2011 Teresa Gámez + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +#include +#include +#include + +#include "hardware.h" + +static struct cpu_op mx27_cpu_op[] = { + { + .cpu_rate = 133000000, + }, { + .cpu_rate = 399000000, + }, +}; + +struct cpu_op *mx27_get_cpu_op(int *op) +{ + *op = ARRAY_SIZE(mx27_cpu_op); + return mx27_cpu_op; +} diff --git a/arch/arm/mach-imx/cpu_op-mx27.h b/arch/arm/mach-imx/cpu_op-mx27.h new file mode 100644 index 0000000..4e9162a --- /dev/null +++ b/arch/arm/mach-imx/cpu_op-mx27.h @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2011 Teresa Gámez + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +extern struct cpu_op *mx27_get_cpu_op(int *op);