2 * arch/sh/kernel/cpu/sh4a/sleep-sh_mobile.S
4 * Sleep mode and Standby modes support for SuperH Mobile
6 * Copyright (C) 2009 Magnus Damm
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
13 #include <linux/sys.h>
14 #include <linux/errno.h>
15 #include <linux/linkage.h>
16 #include <asm/asm-offsets.h>
17 #include <asm/suspend.h>
19 /* manage self-refresh and enter standby mode.
20 * this code will be copied to on-chip memory and executed from there.
24 ENTRY(sh_mobile_standby)
29 #ifdef CONFIG_CPU_SUBTYPE_SH7724
30 /* DBSC: put memory in self-refresh mode */
36 mov.l dbrfpdn0_reg, r4
37 mov.l dbrfpdn0_data0, r1
40 mov.l dbcmdcnt_reg, r4
41 mov.l dbcmdcnt_data0, r1
44 mov.l dbcmdcnt_reg, r4
45 mov.l dbcmdcnt_data1, r1
48 mov.l dbrfpdn0_reg, r4
49 mov.l dbrfpdn0_data1, r1
52 /* SBSC: disable power down and put in self-refresh mode */
63 tst #SUSP_SH_SLEEP, r0
66 /* set mode to "sleep mode" */
71 tst #SUSP_SH_STANDBY, r0
74 /* set mode to "software standby mode" */
79 tst #SUSP_SH_RSTANDBY, r0
82 /* set mode to "r-standby mode" */
87 tst #SUSP_SH_USTANDBY, r0
90 /* set mode to "u-standby mode" */
96 /* setup and enter selected standby mode */
102 /* reset standby mode to sleep mode */
110 #ifdef CONFIG_CPU_SUBTYPE_SH7724
111 /* DBSC: put memory in auto-refresh mode */
113 mov.l dbrfpdn0_reg, r4
114 mov.l dbrfpdn0_data0, r1
123 mov.l dbcmdcnt_reg, r4
124 mov.l dbcmdcnt_data0, r1
127 mov.l dbcmdcnt_reg, r4
128 mov.l dbcmdcnt_data1, r1
135 mov.l dbrfpdn0_reg, r4
136 mov.l dbrfpdn0_data2, r1
139 /* SBSC: set auto-refresh mode */
159 #ifdef CONFIG_CPU_SUBTYPE_SH7724
160 dben_reg: .long 0xfd000010 /* DBEN */
163 dbrfpdn0_reg: .long 0xfd000040 /* DBRFPDN0 */
164 dbrfpdn0_data0: .long 0
165 dbrfpdn0_data1: .long 1
166 dbrfpdn0_data2: .long 0x00010000
167 dbcmdcnt_reg: .long 0xfd000014 /* DBCMDCNT */
168 dbcmdcnt_data0: .long 2
169 dbcmdcnt_data1: .long 4
171 1: .long 0xfe400008 /* SDCR0 */
176 5: .long 0xa4150020 /* STBCR */
177 6: .long 0xfe40001c /* RTCOR */
178 7: .long 0xfe400018 /* RTCNT */
181 /* interrupt vector @ 0x600 */
182 .balign 0x400,0,0x400
184 .balign 0x200,0,0x200
185 /* sh7722 will end up here in sleep mode */
188 sh_mobile_standby_end:
190 ENTRY(sh_mobile_standby_size)
191 .long sh_mobile_standby_end - sh_mobile_standby