13 #include <linux/kernel.h>
16 #include <asm/suspend.h>
17 #include <asm/uaccess.h>
18 #include <asm/cacheflush.h>
34 #define SUSP_MODE_SLEEP (SUSP_SH_SLEEP)
35 #define SUSP_MODE_SLEEP_SF (SUSP_SH_SLEEP | SUSP_SH_SF)
36 #define SUSP_MODE_STANDBY_SF (SUSP_SH_STANDBY | SUSP_SH_SF)
37 #define SUSP_MODE_RSTANDBY_SF \
38 (SUSP_SH_RSTANDBY | SUSP_SH_MMU | SUSP_SH_REGS | SUSP_SH_SF)
43 #ifdef CONFIG_CPU_SUBTYPE_SH7724
44 #define RAM_BASE 0xfd800000
46 #define RAM_BASE 0xe5200000
53 void (*standby_onchip_mem)(
unsigned long,
unsigned long);
56 standby_onchip_mem = (
void *)(sdp + 1);
81 void *pre_start,
void *pre_end,
82 void *post_start,
void *post_end)
91 sdp->
addr.stbcr = 0xa4150020;
92 sdp->
addr.bar = 0xa4150040;
93 sdp->
addr.pteh = 0xff000000;
94 sdp->
addr.ptel = 0xff000004;
95 sdp->
addr.ttb = 0xff000008;
96 sdp->
addr.tea = 0xff00000c;
97 sdp->
addr.mmucr = 0xff000010;
98 sdp->
addr.ptea = 0xff000034;
99 sdp->
addr.pascr = 0xff000070;
100 sdp->
addr.irmcr = 0xff000078;
101 sdp->
addr.ccr = 0xff00001c;
102 sdp->
addr.ramcr = 0xff000074;
107 memcpy(vp, &sh_mobile_sleep_enter_start, n);
111 n = pre_end - pre_start;
117 n = post_end - post_start;
118 memcpy(vp, post_start, n);
123 WARN_ON(vp > (onchip_mem + 0x600));
124 vp = onchip_mem + 0x600;
126 memcpy(vp, &sh_mobile_sleep_resume_start, n);
146 .enter = sh_pm_enter,
150 static int __init sh_pm_init(
void)