aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@atmel.com>2010-10-22 12:55:39 -0400
committerNicolas Ferre <nicolas.ferre@atmel.com>2010-10-26 05:32:48 -0400
commita2a571b74a3881963d8d09deb272d13afe5b49e3 (patch)
tree491cf5ff56293287906f9cfec785345f24cd2180 /arch/arm/mach-at91
parent8aeeda822fbfe7da2d4ea391a9757e9532796598 (diff)
AT91: pm: make sure that r0 is 0 when dealing with cache operations
When using CP15 cache operations (c7), we make sure that Rd (r0) is actually 0 as ARM 926 TRM is saying. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r--arch/arm/mach-at91/pm.c9
-rw-r--r--arch/arm/mach-at91/pm.h3
-rw-r--r--arch/arm/mach-at91/pm_slowclock.S1
3 files changed, 10 insertions, 3 deletions
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 87a31baf1cb3..dafbacc25eb1 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -261,8 +261,13 @@ static int at91_pm_enter(suspend_state_t state)
261 * For ARM 926 based chips, this requirement is weaker 261 * For ARM 926 based chips, this requirement is weaker
262 * as at91sam9 can access a RAM in self-refresh mode. 262 * as at91sam9 can access a RAM in self-refresh mode.
263 */ 263 */
264 asm("b 1f; .align 5; 1:"); 264 asm volatile ( "mov r0, #0\n\t"
265 asm("mcr p15, 0, r0, c7, c10, 4"); /* drain write buffer */ 265 "b 1f\n\t"
266 ".align 5\n\t"
267 "1: mcr p15, 0, r0, c7, c10, 4\n\t"
268 : /* no output */
269 : /* no input */
270 : "r0");
266 saved_lpr = sdram_selfrefresh_enable(); 271 saved_lpr = sdram_selfrefresh_enable();
267 wait_for_interrupt_enable(); 272 wait_for_interrupt_enable();
268 sdram_selfrefresh_disable(saved_lpr); 273 sdram_selfrefresh_disable(saved_lpr);
diff --git a/arch/arm/mach-at91/pm.h b/arch/arm/mach-at91/pm.h
index 2c4424bfa6c4..ce9a20699111 100644
--- a/arch/arm/mach-at91/pm.h
+++ b/arch/arm/mach-at91/pm.h
@@ -21,7 +21,8 @@ static inline u32 sdram_selfrefresh_enable(void)
21} 21}
22 22
23#define sdram_selfrefresh_disable(saved_lpr) at91_sys_write(AT91_SDRAMC_LPR, saved_lpr) 23#define sdram_selfrefresh_disable(saved_lpr) at91_sys_write(AT91_SDRAMC_LPR, saved_lpr)
24#define wait_for_interrupt_enable() asm("mcr p15, 0, r0, c7, c0, 4") 24#define wait_for_interrupt_enable() asm volatile ("mcr p15, 0, %0, c7, c0, 4" \
25 : : "r" (0))
25 26
26#elif defined(CONFIG_ARCH_AT91CAP9) 27#elif defined(CONFIG_ARCH_AT91CAP9)
27#include <mach/at91cap9_ddrsdr.h> 28#include <mach/at91cap9_ddrsdr.h>
diff --git a/arch/arm/mach-at91/pm_slowclock.S b/arch/arm/mach-at91/pm_slowclock.S
index b6b00a1f6125..f7922a436172 100644
--- a/arch/arm/mach-at91/pm_slowclock.S
+++ b/arch/arm/mach-at91/pm_slowclock.S
@@ -124,6 +124,7 @@ ENTRY(at91_slow_clock)
124 ldr r5, .at91_va_base_ramc1 124 ldr r5, .at91_va_base_ramc1
125 125
126 /* Drain write buffer */ 126 /* Drain write buffer */
127 mov r0, #0
127 mcr p15, 0, r0, c7, c10, 4 128 mcr p15, 0, r0, c7, c10, 4
128 129
129#ifdef CONFIG_ARCH_AT91RM9200 130#ifdef CONFIG_ARCH_AT91RM9200