aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/pm24xx.c
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2012-12-30 12:15:48 -0500
committerPaul Walmsley <paul@pwsan.com>2013-02-06 15:48:14 -0500
commit088e8806c411f76216002a8b37c7eb8563614822 (patch)
treebb6a6096a73515e6223a5dba9be7aa17d13b91bc /arch/arm/mach-omap2/pm24xx.c
parent88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7 (diff)
ARM: OMAP2xxx: PM: enter WFI via inline asm if CORE stays active
There shouldn't be any need to jump to SRAM code if the OMAP CORE clockdomain (and consequently the SDRAM controller and CORE PLL) stays active during MPU WFI. The SRAM code should only be needed when the RAM enters self-refresh. So in the case where CORE stays active, just call WFI directly from the mach-omap2/pm24xx.c code. This removes some unnecessary SRAM code. This second version replaces the inline WFI with the corresponding coprocessor register call, using tlbflush.h as an example. This is because the assembler doesn't recognize WFI as a valid ARMv6 instruction. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Richard Woodruff <r-woodruff2@ti.com> Cc: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2/pm24xx.c')
-rw-r--r--arch/arm/mach-omap2/pm24xx.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index c333fa6dffa8..8914b9e32ee7 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -54,7 +54,6 @@
54#include "powerdomain.h" 54#include "powerdomain.h"
55#include "clockdomain.h" 55#include "clockdomain.h"
56 56
57static void (*omap2_sram_idle)(void);
58static void (*omap2_sram_suspend)(u32 dllctrl, void __iomem *sdrc_dlla_ctrl, 57static void (*omap2_sram_suspend)(u32 dllctrl, void __iomem *sdrc_dlla_ctrl,
59 void __iomem *sdrc_power); 58 void __iomem *sdrc_power);
60 59
@@ -172,6 +171,8 @@ static int omap2_allow_mpu_retention(void)
172 171
173static void omap2_enter_mpu_retention(void) 172static void omap2_enter_mpu_retention(void)
174{ 173{
174 const int zero = 0;
175
175 /* Putting MPU into the WFI state while a transfer is active 176 /* Putting MPU into the WFI state while a transfer is active
176 * seems to cause the I2C block to timeout. Why? Good question. */ 177 * seems to cause the I2C block to timeout. Why? Good question. */
177 if (omap2_i2c_active()) 178 if (omap2_i2c_active())
@@ -196,7 +197,8 @@ static void omap2_enter_mpu_retention(void)
196 OMAP2_PM_PWSTCTRL); 197 OMAP2_PM_PWSTCTRL);
197 } 198 }
198 199
199 omap2_sram_idle(); 200 /* WFI */
201 asm("mcr p15, 0, %0, c7, c0, 4" : : "r" (zero) : "memory", "cc");
200} 202}
201 203
202static int omap2_can_sleep(void) 204static int omap2_can_sleep(void)
@@ -356,11 +358,9 @@ int __init omap2_pm_init(void)
356 /* 358 /*
357 * We copy the assembler sleep/wakeup routines to SRAM. 359 * We copy the assembler sleep/wakeup routines to SRAM.
358 * These routines need to be in SRAM as that's the only 360 * These routines need to be in SRAM as that's the only
359 * memory the MPU can see when it wakes up. 361 * memory the MPU can see when it wakes up after the entire
362 * chip enters idle.
360 */ 363 */
361 omap2_sram_idle = omap_sram_push(omap24xx_idle_loop_suspend,
362 omap24xx_idle_loop_suspend_sz);
363
364 omap2_sram_suspend = omap_sram_push(omap24xx_cpu_suspend, 364 omap2_sram_suspend = omap_sram_push(omap24xx_cpu_suspend,
365 omap24xx_cpu_suspend_sz); 365 omap24xx_cpu_suspend_sz);
366 366