Skip to content

Commit

Permalink
Merge branch 'encore-omap3-3' into encore-omap3-3.0.y
Browse files Browse the repository at this point in the history
  • Loading branch information
steven676 committed Sep 15, 2013
2 parents 9b34caf + 78e81af commit f63dd8b
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
12 changes: 12 additions & 0 deletions arch/arm/mach-omap2/board-encore.c
Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down
13 changes: 13 additions & 0 deletions arch/arm/mach-omap2/omap2plus-cpufreq.c
Expand Up @@ -43,6 +43,8 @@

#include "dvfs.h"

#include "omap2plus-cpufreq.h"

#ifdef CONFIG_SMP
struct lpj_info {
unsigned long ref;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
26 changes: 26 additions & 0 deletions arch/arm/mach-omap2/omap2plus-cpufreq.h
@@ -0,0 +1,26 @@
/*
* OMAP2PLUS cpufreq driver
*
* Copyright (C) 2005 Nokia Corporation
* Written by Tony Lindgren <tony@atomide.com>
*
* Based on cpu-sa1110.c, Copyright (C) 2001 Russell King
*
* Copyright (C) 2007-2011 Texas Instruments, Inc.
* Updated to support OMAP3
* Rajendra Nayak <rnayak@ti.com>
*
* 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

0 comments on commit f63dd8b

Please sign in to comment.