summaryrefslogtreecommitdiff
path: root/arch/arm/plat-mxc/clock.c
diff options
context:
space:
mode:
authorRanjani Vaidyanathan <ra5478@freescale.com>2010-12-03 16:15:17 -0600
committerRanjani Vaidyanathan <ra5478@freescale.com>2010-12-04 23:49:57 -0600
commit5ffde825c4e18a5347bb7f5d5b266af0ccc9540a (patch)
tree9b64de96c0031e4d49aa29c115a0bac0309a7c05 /arch/arm/plat-mxc/clock.c
parent35f5c2725c403bebfb41a39dd02d85a42cec9f7f (diff)
ENGR00135048-1: Fixed bugs in common sw bus frequency scaling code.
Some GPC bits were getting set twice, fixed the issue. Protected the section where CPU frequency is changed. For MX50, increase the cpu frequency along with increasing the bus frequency. Fixed the test conditions under which bus frequency should be set to low, medium or high setpoint. Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
Diffstat (limited to 'arch/arm/plat-mxc/clock.c')
-rw-r--r--arch/arm/plat-mxc/clock.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c
index af47bed967bb..32cf7870dbc5 100644
--- a/arch/arm/plat-mxc/clock.c
+++ b/arch/arm/plat-mxc/clock.c
@@ -49,6 +49,7 @@ extern int lp_high_freq;
extern int lp_med_freq;
extern int low_bus_freq_mode;
extern int high_bus_freq_mode;
+extern int med_bus_freq_mode;
extern int set_high_bus_freq(int high_freq);
extern int set_low_bus_freq(void);
extern int low_freq_bus_used(void);
@@ -188,16 +189,16 @@ int clk_enable(struct clk *clk)
(AHB_HIGH_SET_POINT | AHB_MED_SET_POINT)))
set_low_bus_freq();
} else {
- if (!high_bus_freq_mode)
- /* Currently at ow or medium set point,
- * need to set to high setpoint
- */
+ if ((clk->flags & AHB_MED_SET_POINT)
+ && !med_bus_freq_mode)
+ /* Set to Medium setpoint */
set_high_bus_freq(0);
- else if (high_bus_freq_mode || low_bus_freq_mode)
- /* Currently at low or high set point,
- * need to set to medium setpoint
+ else if ((clk->flags & AHB_HIGH_SET_POINT)
+ && !high_bus_freq_mode)
+ /* Currently at low or medium set point,
+ * need to set to high setpoint
*/
- set_high_bus_freq(0);
+ set_high_bus_freq(1);
}
#endif
}
@@ -241,8 +242,17 @@ void clk_disable(struct clk *clk)
#if (defined(CONFIG_ARCH_MX5) || defined(CONFIG_ARCH_MX37))
if (low_freq_bus_used() && !low_bus_freq_mode)
set_low_bus_freq();
- else if (!high_bus_freq_mode)
+ else if ((clk->flags & AHB_MED_SET_POINT)
+ && !med_bus_freq_mode)
+ /* Currently at low need to set to medium setpoint
+ */
set_high_bus_freq(0);
+ else if ((clk->flags & AHB_HIGH_SET_POINT)
+ && !high_bus_freq_mode)
+ /* Currently at low or medium set point,
+ * need to set to high setpoint
+ */
+ set_high_bus_freq(1);
#endif
}
}