sh: Add save/restore sleep code for MMU/cache
Subsystems (2)
PATCH 3/7 sh: Add save/restore sleep code for MMU/cache
From: Magnus Damm <[email protected]>
Add experimental restore/save code for MMU and Cache registers. In the future it is most likely better to handle this somewhere else than from the on-chip memory.
Not-Signed-off-by Magnus Damm <[email protected]>
---
arch/sh/include/asm/suspend.h | 1 arch/sh/kernel/cpu/shmobile/pm.c | 5 + arch/sh/kernel/cpu/shmobile/sleep.S | 147 ++++++++++++++++++++++++++++++++++- 3 files changed, 152 insertions(+), 1 deletion(-)
arch/sh/include/asm/suspend.h +1 -0
@@ -27,5 +27,6 @@ static inline void sh_mobile_setup_cpuid#define SUSP_SH_RSTANDBY (1 << 2)/* SH-Mobile R-standby mode */ #define SUSP_SH_USTANDBY (1 << 3)/* SH-Mobile U-standby mode */ #define SUSP_SH_SF (1 << 4)/* Enable self-refresh */ +#define SUSP_SH_MMU (1 << 5)/* Save/Restore MMU */ #endif /* _ASM_SH_SUSPEND_H */
arch/sh/kernel/cpu/shmobile/pm.c +5 -0
@@ -14,6 +14,7 @@#include <linux/io.h> #include <linux/suspend.h> #include <asm/suspend.h> +#include <asm/cacheflush.h> #include <asm/uaccess.h> /*
@@ -48,6 +49,10 @@ void sh_mobile_call_standby(unsigned lonvoid *onchip_mem = (void *)RAM_BASE ;void (*standby_onchip_mem)(unsigned long ,unsigned long ) = onchip_mem; +/* 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,RAM_BASE ); }
arch/sh/kernel/cpu/shmobile/sleep.S +146 -1
170 lines not on this page · raw message