Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217327
b: refs/heads/master
c: 8aeeda8
h: refs/heads/master
i:
  217325: 0422195
  217323: 3f34748
  217319: 30c67a6
  217311: f43d919
v: v3
  • Loading branch information
Nicolas Ferre committed Oct 26, 2010
1 parent 4023c2c commit cfb637a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bb413db591d53c29292868577068fa822b84da82
refs/heads/master: 8aeeda822fbfe7da2d4ea391a9757e9532796598
6 changes: 4 additions & 2 deletions trunk/arch/arm/mach-at91/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,16 +258,18 @@ static int at91_pm_enter(suspend_state_t state)
* NOTE: the Wait-for-Interrupt instruction needs to be
* in icache so no SDRAM accesses are needed until the
* wakeup IRQ occurs and self-refresh is terminated.
* For ARM 926 based chips, this requirement is weaker
* as at91sam9 can access a RAM in self-refresh mode.
*/
asm("b 1f; .align 5; 1:");
asm("mcr p15, 0, r0, c7, c10, 4"); /* drain write buffer */
saved_lpr = sdram_selfrefresh_enable();
asm("mcr p15, 0, r0, c7, c0, 4"); /* wait for interrupt */
wait_for_interrupt_enable();
sdram_selfrefresh_disable(saved_lpr);
break;

case PM_SUSPEND_ON:
asm("mcr p15, 0, r0, c7, c0, 4"); /* wait for interrupt */
cpu_do_idle();
break;

default:
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/arm/mach-at91/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ static inline u32 sdram_selfrefresh_enable(void)
}

#define sdram_selfrefresh_disable(saved_lpr) at91_sys_write(AT91_SDRAMC_LPR, saved_lpr)
#define wait_for_interrupt_enable() asm("mcr p15, 0, r0, c7, c0, 4")

#elif defined(CONFIG_ARCH_AT91CAP9)
#include <mach/at91cap9_ddrsdr.h>
Expand All @@ -38,6 +39,7 @@ static inline u32 sdram_selfrefresh_enable(void)
}

#define sdram_selfrefresh_disable(saved_lpr) at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr)
#define wait_for_interrupt_enable() cpu_do_idle()

#elif defined(CONFIG_ARCH_AT91SAM9G45)
#include <mach/at91sam9_ddrsdr.h>
Expand Down Expand Up @@ -74,6 +76,7 @@ static inline u32 sdram_selfrefresh_enable(void)
at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr0); \
at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1); \
} while (0)
#define wait_for_interrupt_enable() cpu_do_idle()

#else
#include <mach/at91sam9_sdramc.h>
Expand All @@ -98,5 +101,6 @@ static inline u32 sdram_selfrefresh_enable(void)
}

#define sdram_selfrefresh_disable(saved_lpr) at91_ramc_write(0, AT91_SDRAMC_LPR, saved_lpr)
#define wait_for_interrupt_enable() cpu_do_idle()

#endif

0 comments on commit cfb637a

Please sign in to comment.