aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/pm.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2012-01-24 18:56:08 -0500
committerNicolas Ferre <nicolas.ferre@atmel.com>2012-02-03 07:42:19 -0500
commit00482a4078f4ff0dd0638e7f2fd83e34cc402ff7 (patch)
tree71bf0730b78d686385c7a44696dcb21a5f08c8bf /arch/arm/mach-at91/pm.c
parentb59160f6c017bfe33d3483ed9a6120701644af8a (diff)
ARM: at91: implement the standby function for pm/cpuidle
This patch groups the self-refresh on/cpu_do_idle/self-refresh off into a single 'standby' function. The standby routine for rm9200 has been turned into an asm routine to have a better control of the self refresh and to prevent a memory access when running this code. Draining the write buffer is done automatically when switching for the self refresh on sam9, so the instruction is added to the rm9200 only. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'arch/arm/mach-at91/pm.c')
-rw-r--r--arch/arm/mach-at91/pm.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index d7e8d4cbc5ef..d554e6771b4e 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -198,7 +198,6 @@ extern u32 at91_slow_clock_sz;
198 198
199static int at91_pm_enter(suspend_state_t state) 199static int at91_pm_enter(suspend_state_t state)
200{ 200{
201 u32 saved_lpr;
202 at91_gpio_suspend(); 201 at91_gpio_suspend();
203 at91_irq_suspend(); 202 at91_irq_suspend();
204 203
@@ -254,16 +253,7 @@ static int at91_pm_enter(suspend_state_t state)
254 * For ARM 926 based chips, this requirement is weaker 253 * For ARM 926 based chips, this requirement is weaker
255 * as at91sam9 can access a RAM in self-refresh mode. 254 * as at91sam9 can access a RAM in self-refresh mode.
256 */ 255 */
257 asm volatile ( "mov r0, #0\n\t" 256 at91_standby();
258 "b 1f\n\t"
259 ".align 5\n\t"
260 "1: mcr p15, 0, r0, c7, c10, 4\n\t"
261 : /* no output */
262 : /* no input */
263 : "r0");
264 saved_lpr = sdram_selfrefresh_enable();
265 cpu_do_idle();
266 sdram_selfrefresh_disable(saved_lpr);
267 break; 257 break;
268 258
269 case PM_SUSPEND_ON: 259 case PM_SUSPEND_ON: