summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2011-05-19 11:43:44 -0700
committerNiket Sirsi <nsirsi@nvidia.com>2011-05-23 17:34:46 -0700
commit556ae71f5320b1e71fae9561dcc7d9aee5f3c9e1 (patch)
tree7813dd93402e98c4e99519bf71e16d35c1778795
parentfa93921f466410bd605cc59d5ac930b26f00c877 (diff)
ARM: tegra: clock: Prevent Tegra3 early boot CPU over-clocking
Prevent Tegra3 early boot CPU over-clocking, if cpufreq driver attempts to scale CPU clock up before regulator initialization completes. Change-Id: I9f0adb371de8f6f684109b2acb9ac1d761a0ab5c Reviewed-on: http://git-master/r/32236 Reviewed-by: Niket Sirsi <nsirsi@nvidia.com> Tested-by: Niket Sirsi <nsirsi@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/tegra3_clocks.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/tegra3_clocks.c b/arch/arm/mach-tegra/tegra3_clocks.c
index 773294383beb..1129783c976c 100644
--- a/arch/arm/mach-tegra/tegra3_clocks.c
+++ b/arch/arm/mach-tegra/tegra3_clocks.c
@@ -38,6 +38,7 @@
#include "clock.h"
#include "fuse.h"
#include "power.h"
+#include "dvfs.h"
#define RST_DEVICES_L 0x004
#define RST_DEVICES_H 0x008
@@ -684,7 +685,14 @@ static void tegra3_cpu_clk_disable(struct clk *c)
static int tegra3_cpu_clk_set_rate(struct clk *c, unsigned long rate)
{
int ret;
- unsigned int backup_rate;
+ unsigned long backup_rate;
+
+ if((!c->dvfs->dvfs_rail->reg) && (clk_get_rate_locked(c) < rate)) {
+ WARN(1, "Increasing CPU rate while regulator is not"
+ " ready may overclock CPU\n");
+ return -ENOSYS;
+ }
+
/*
* Take an extra reference to the main pll so it doesn't turn
* off when we move the cpu off of it