diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-08-17 09:27:29 +0000 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-08-18 10:17:29 +0900 |
commit | 309214af53f030e0664aea011a9f628c5eb9cc2d (patch) | |
tree | 9a84da7f3d9f017850afbf4b51d4d247edf26534 /arch/sh/kernel/cpu/shmobile/pm.c | |
parent | cd7246f0e2747bd2b43d25d0f63f05db182a62c0 (diff) | |
download | talos-obmc-linux-309214af53f030e0664aea011a9f628c5eb9cc2d.tar.gz talos-obmc-linux-309214af53f030e0664aea011a9f628c5eb9cc2d.zip |
sh: rework SuperH Mobile sleep code exception handling
This patch updates the exception handling in the sleep code
for SuperH Mobile. With the patch applied the sleep code
always rewrites the VBR and resumes from the exception vector,
re-initializes hardware and jumps straight to the original
interrupt vector.
Tested on sh7722 and sh7724 with "Sleep Mode", "Sleep Mode + SF"
and "Software Standby Mode + SF" with CONFIG_SUSPEND.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/shmobile/pm.c')
-rw-r--r-- | arch/sh/kernel/cpu/shmobile/pm.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/arch/sh/kernel/cpu/shmobile/pm.c b/arch/sh/kernel/cpu/shmobile/pm.c index de078d24ce56..ee3c2aaf66fb 100644 --- a/arch/sh/kernel/cpu/shmobile/pm.c +++ b/arch/sh/kernel/cpu/shmobile/pm.c @@ -41,23 +41,11 @@ extern const unsigned int sh_mobile_standby_size; void sh_mobile_call_standby(unsigned long mode) { - extern void *vbr_base; void *onchip_mem = (void *)ILRAM_BASE; - void (*standby_onchip_mem)(unsigned long) = onchip_mem; - - /* Note: Wake up from sleep may generate exceptions! - * Setup VBR to point to on-chip ram if self-refresh is - * going to be used. - */ - if (mode & SUSP_SH_SF) - asm volatile("ldc %0, vbr" : : "r" (onchip_mem) : "memory"); + void (*standby_onchip_mem)(unsigned long, unsigned long) = onchip_mem; /* Let assembly snippet in on-chip memory handle the rest */ - standby_onchip_mem(mode); - - /* Put VBR back in System RAM again */ - if (mode & SUSP_SH_SF) - asm volatile("ldc %0, vbr" : : "r" (&vbr_base) : "memory"); + standby_onchip_mem(mode, ILRAM_BASE); } static int sh_pm_enter(suspend_state_t state) |