diff --git a/arch/arm/mach-omap2/board-encore.c b/arch/arm/mach-omap2/board-encore.c index b51f413983b..c4fd138392f 100644 --- a/arch/arm/mach-omap2/board-encore.c +++ b/arch/arm/mach-omap2/board-encore.c @@ -38,6 +38,7 @@ #include "sdram-hynix-h8mbx00u0mer-0em.h" #include "omap_ion.h" #include "omap_ram_console.h" +#include "omap2plus-cpufreq.h" #include "timer-gp.h" #define ZOOM3_EHCI_RESET_GPIO 64 @@ -201,10 +202,21 @@ static int __init encore_wifi_init(void) } device_initcall(encore_wifi_init); +static struct omap_cpufreq_platform_data cpufreq_pdata = { +#ifdef CONFIG_ENCORE_MPU_STOCK + .max_nominal_freq = 800000, +#else + .max_nominal_freq = 1000000, +#endif +}; + static void __init omap_encore_init(void) { omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); + /* Clamp CPU to max nominal clock frequency */ + omap_cpufreq_set_platform_data(&cpufreq_pdata); + encore_peripherals_init(); encore_display_init(); omap_register_ion(); diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c index 35f3e8e9726..617acf39ce7 100644 --- a/arch/arm/mach-omap2/omap2plus-cpufreq.c +++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c @@ -43,6 +43,8 @@ #include "dvfs.h" +#include "omap2plus-cpufreq.h" + #ifdef CONFIG_SMP struct lpj_info { unsigned long ref; @@ -67,6 +69,13 @@ static unsigned int current_cooling_level; static bool omap_cpufreq_ready; static bool omap_cpufreq_suspended; +static struct omap_cpufreq_platform_data *cpufreq_pdata = NULL; + +void omap_cpufreq_set_platform_data(struct omap_cpufreq_platform_data *pdata) +{ + cpufreq_pdata = pdata; +} + static unsigned int omap_getspeed(unsigned int cpu) { unsigned long rate; @@ -405,6 +414,10 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy) policy->max = policy->cpuinfo.max_freq; policy->cur = omap_getspeed(policy->cpu); + /* Clamp clock to the maximum nominal frequency provided by board */ + if (cpufreq_pdata) + policy->max = cpufreq_pdata->max_nominal_freq; + for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) max_freq = max(freq_table[i].frequency, max_freq); max_thermal = max_freq; diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.h b/arch/arm/mach-omap2/omap2plus-cpufreq.h new file mode 100644 index 00000000000..8f53077b44c --- /dev/null +++ b/arch/arm/mach-omap2/omap2plus-cpufreq.h @@ -0,0 +1,26 @@ +/* + * OMAP2PLUS cpufreq driver + * + * Copyright (C) 2005 Nokia Corporation + * Written by Tony Lindgren + * + * Based on cpu-sa1110.c, Copyright (C) 2001 Russell King + * + * Copyright (C) 2007-2011 Texas Instruments, Inc. + * Updated to support OMAP3 + * Rajendra Nayak + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef _ARCH_ARM_MACH_OMAP2_OMAP2PLUS_CPUFREQ_H +#define _ARCH_ARM_MACH_OMAP2_OMAP2PLUS_CPUFREQ_H + +struct omap_cpufreq_platform_data { + int max_nominal_freq; +}; + +void omap_cpufreq_set_platform_data(struct omap_cpufreq_platform_data *pdata); + +#endif