summaryrefslogtreecommitdiff
path: root/arch/arm/plat-mxc/clock.c
diff options
context:
space:
mode:
authorRanjani Vaidyanathan <ra5478@freescale.com>2010-09-27 16:09:43 -0500
committerRanjani Vaidyanathan <ra5478@freescale.com>2010-10-06 14:23:25 -0500
commitb5f4ddb56e868041ed64b66e077f80c16b87d2f0 (patch)
tree8d9dcb32f8a54e2175695c2b704be780f3c4ad4d /arch/arm/plat-mxc/clock.c
parente5f01f0f81914920485e586c6dd573b0ade37a5c (diff)
ENGR00132139 MX50: Set DDR to 24MHz in LPAPM mode
Added support for DDR at 24MHz in LPAPM mode to achieve low power in idle mode. In LPAPM mode, all peripheral domain clocks and DDR are sourced from 24MHz XTAL. When ARM is in WFI, its sourced from 24MHz XTAL too. Thus all PLLs are turned off. 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.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c
index 3dd6b9fb3209..be6f25898c11 100644
--- a/arch/arm/plat-mxc/clock.c
+++ b/arch/arm/plat-mxc/clock.c
@@ -177,20 +177,21 @@ int clk_enable(struct clk *clk)
if ((clk->flags & CPU_FREQ_TRIG_UPDATE)
&& (clk_get_usecount(clk) == 0)) {
#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) {
+ if (low_freq_bus_used() && !low_bus_freq_mode) {
+ if (!(clk->flags &
+ (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
*/
set_high_bus_freq(0);
- } else if (high_bus_freq_mode || low_bus_freq_mode) {
- /* Currently at ow or high set point,
+ else if (high_bus_freq_mode || low_bus_freq_mode)
+ /* Currently at low or high set point,
* need to set to medium setpoint
*/
set_high_bus_freq(0);
- }
}
#endif
}
@@ -228,19 +229,8 @@ 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) {
- /* Currently at low or medium set point,
- * need to set to high 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
- */
- set_high_bus_freq(0);
- }
- }
+ else if (!high_bus_freq_mode)
+ set_high_bus_freq(0);
#endif
}
}