summaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/shmobile/pm.c
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2009-10-30 04:24:23 +0000
committerPaul Mundt <lethal@linux-sh.org>2009-10-30 14:37:56 +0900
commit99675a7a45ed3cec54d6e1d11f13bcaacaf0909b (patch)
tree7a23202a0071dc26015741d296270449e76922a6 /arch/sh/kernel/cpu/shmobile/pm.c
parent02bf89347c7d6a6aeae64f02536dac038c402fce (diff)
downloadop-kernel-dev-99675a7a45ed3cec54d6e1d11f13bcaacaf0909b.zip
op-kernel-dev-99675a7a45ed3cec54d6e1d11f13bcaacaf0909b.tar.gz
sh: Add MMU and Cache handling sleep mode code
Add MMU and cache handling functionality to the SuperH Mobile sleep code. The MMU and cache registers are saved and restored. The MMU is disabled and the cache is flushed and disabled before entering sleep modes if the SUSP_SH_MMU flag is set. This flag should be set in the case of R-standby and most likely for future U-standby support as well. Signed-off-by: Magnus Damm <damm@opensource.se> 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.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/shmobile/pm.c b/arch/sh/kernel/cpu/shmobile/pm.c
index a94dc48..ca642f3 100644
--- a/arch/sh/kernel/cpu/shmobile/pm.c
+++ b/arch/sh/kernel/cpu/shmobile/pm.c
@@ -15,6 +15,7 @@
#include <linux/suspend.h>
#include <asm/suspend.h>
#include <asm/uaccess.h>
+#include <asm/cacheflush.h>
/*
* Notifier lists for pre/post sleep notification
@@ -54,6 +55,10 @@ void sh_mobile_call_standby(unsigned long mode)
atomic_notifier_call_chain(&sh_mobile_pre_sleep_notifier_list,
mode, NULL);
+ /* flush the caches if MMU flag is set */
+ if (mode & SUSP_SH_MMU)
+ flush_cache_all();
+
/* Let assembly snippet in on-chip memory handle the rest */
standby_onchip_mem(mode, ILRAM_BASE);
@@ -81,6 +86,16 @@ void sh_mobile_register_self_refresh(unsigned long flags,
/* part 0: data area */
sdp = onchip_mem;
sdp->addr.stbcr = 0xa4150020; /* STBCR */
+ sdp->addr.pteh = 0xff000000; /* PTEH */
+ sdp->addr.ptel = 0xff000004; /* PTEL */
+ sdp->addr.ttb = 0xff000008; /* TTB */
+ sdp->addr.tea = 0xff00000c; /* TEA */
+ sdp->addr.mmucr = 0xff000010; /* MMUCR */
+ sdp->addr.ptea = 0xff000034; /* PTEA */
+ sdp->addr.pascr = 0xff000070; /* PASCR */
+ sdp->addr.irmcr = 0xff000078; /* IRMCR */
+ sdp->addr.ccr = 0xff00001c; /* CCR */
+ sdp->addr.ramcr = 0xff000074; /* RAMCR */
vp = sdp + 1;
/* part 1: common code to enter sleep mode */
OpenPOWER on IntegriCloud