diff options
author | Teresa Gámez <t.gamez@phytec.de> | 2011-06-10 14:58:02 +0200 |
---|---|---|
committer | Steve Schefter <steve.schefter@timesys.com> | 2013-09-09 15:17:06 -0400 |
commit | 7f30bd70f3c1d0ca13e25f04a3080eac6d12b455 (patch) | |
tree | 754388198bedac6db5b478e73e52d8e92c48903d /arch | |
parent | 4b7a6d2528bfb625cc359d89ac16439b0ec744ea (diff) |
cpufreq: Add cpufreq support for i.MX27 boards.
Adding cpu scaling support for the i.MX27 boards.
Supporting now 399MHz and 133MHz.
Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-imx/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/clock-imx27.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/cpu_op-mx27.c | 28 | ||||
-rw-r--r-- | arch/arm/mach-imx/cpu_op-mx27.h | 12 | ||||
-rw-r--r-- | arch/arm/plat-mxc/cpufreq.c | 2 |
6 files changed, 45 insertions, 2 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 56684b517070..9b02a3e15e48 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig @@ -66,6 +66,7 @@ config MACH_MX21 config MACH_MX27 bool "i.MX27 support" + select ARCH_HAS_CPUFREQ help This enables support for Freescale's MX2 based i.MX27 processor. diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index 77100bf26153..abb53776856a 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile @@ -13,6 +13,7 @@ obj-$(CONFIG_ARCH_MX25) += clock-imx25.o mm-imx25.o obj-$(CONFIG_MACH_MX27) += cpu-imx27.o pm-imx27.o obj-$(CONFIG_MACH_MX27) += clock-imx27.o mm-imx27.o +obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx27.o # Support for CMOS sensor interface obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o diff --git a/arch/arm/mach-imx/clock-imx27.c b/arch/arm/mach-imx/clock-imx27.c index 583f2515c1d5..d487e9ffdf20 100644 --- a/arch/arm/mach-imx/clock-imx27.c +++ b/arch/arm/mach-imx/clock-imx27.c @@ -177,7 +177,7 @@ static int set_rate_cpu(struct clk *clk, unsigned long rate) if (mx27_revision() >= IMX_CHIP_REVISION_2_0) { reg &= ~(3 << 12); reg |= div << 12; - reg &= ~(CCM_CSCR_FPM | CCM_CSCR_SPEN); + reg &= ~CCM_CSCR_SPEN; __raw_writel(reg | CCM_CSCR_UPDATE_DIS, CCM_CSCR); } else { printk(KERN_ERR "Can't set CPU frequency!\n"); @@ -676,6 +676,7 @@ static struct clk_lookup lookups[] = { _REGISTER_CLOCK("mxc_w1.0", NULL, owire_clk) _REGISTER_CLOCK(NULL, "rtc", rtc_clk) _REGISTER_CLOCK(NULL, "scc", scc_clk) + _REGISTER_CLOCK(NULL, "cpu_clk", cpu_clk) }; /* Adjust the clock path for TO2 and later */ 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 000000000000..2c957b03d4b7 --- /dev/null +++ b/arch/arm/mach-imx/cpu_op-mx27.c @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2011 Teresa Gámez <t.gamez@phytec.de> + * + * The code contained herein is licensed under the GNU General Public + * License. You may obtain a copy of the GNU General Public License + * Version 2 or later at the following locations: + * + * http://www.opensource.org/licenses/gpl-license.html + * http://www.gnu.org/copyleft/gpl.html + */ + +#include <linux/types.h> +#include <mach/hardware.h> +#include <linux/kernel.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 000000000000..0b817e3c99c2 --- /dev/null +++ b/arch/arm/mach-imx/cpu_op-mx27.h @@ -0,0 +1,12 @@ +/* + * Copyright (C) 2011 Teresa Gámez <t.gamez@phytec.de> + * + * The code contained herein is licensed under the GNU General Public + * License. You may obtain a copy of the GNU General Public License + * Version 2 or later at the following locations: + * + * http://www.opensource.org/licenses/gpl-license.html + * http://www.gnu.org/copyleft/gpl.html + */ + +extern struct cpu_op *mx27_get_cpu_op(int *op); diff --git a/arch/arm/plat-mxc/cpufreq.c b/arch/arm/plat-mxc/cpufreq.c index ce81481becf1..a477f6bb025a 100644 --- a/arch/arm/plat-mxc/cpufreq.c +++ b/arch/arm/plat-mxc/cpufreq.c @@ -97,7 +97,7 @@ static int mxc_set_target(struct cpufreq_policy *policy, return ret; } -static int __init mxc_cpufreq_init(struct cpufreq_policy *policy) +static int mxc_cpufreq_init(struct cpufreq_policy *policy) { int ret; int i; |