diff options
Diffstat (limited to 'arch/mips/alchemy/common/sleeper.S')
-rw-r--r-- | arch/mips/alchemy/common/sleeper.S | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/arch/mips/alchemy/common/sleeper.S b/arch/mips/alchemy/common/sleeper.S index 77f3c743b716..c7bcc7e5c822 100644 --- a/arch/mips/alchemy/common/sleeper.S +++ b/arch/mips/alchemy/common/sleeper.S | |||
@@ -153,6 +153,79 @@ LEAF(alchemy_sleep_au1550) | |||
153 | 153 | ||
154 | END(alchemy_sleep_au1550) | 154 | END(alchemy_sleep_au1550) |
155 | 155 | ||
156 | /* sleepcode for Au1300 memory controller type */ | ||
157 | LEAF(alchemy_sleep_au1300) | ||
158 | |||
159 | SETUP_SLEEP | ||
160 | |||
161 | /* cache following instructions, as memory gets put to sleep */ | ||
162 | la t0, 2f | ||
163 | la t1, 4f | ||
164 | subu t2, t1, t0 | ||
165 | |||
166 | .set mips3 | ||
167 | |||
168 | 1: cache 0x14, 0(t0) | ||
169 | subu t2, t2, 32 | ||
170 | bgez t2, 1b | ||
171 | addu t0, t0, 32 | ||
172 | |||
173 | .set mips0 | ||
174 | |||
175 | 2: lui a0, 0xb400 /* mem_xxx */ | ||
176 | |||
177 | /* disable all ports in mem_sdportcfga */ | ||
178 | sw zero, 0x868(a0) /* mem_sdportcfga */ | ||
179 | sync | ||
180 | |||
181 | /* disable ODT */ | ||
182 | li t0, 0x03010000 | ||
183 | sw t0, 0x08d8(a0) /* mem_sdcmd0 */ | ||
184 | sw t0, 0x08dc(a0) /* mem_sdcmd1 */ | ||
185 | sync | ||
186 | |||
187 | /* precharge */ | ||
188 | li t0, 0x23000400 | ||
189 | sw t0, 0x08dc(a0) /* mem_sdcmd1 */ | ||
190 | sw t0, 0x08d8(a0) /* mem_sdcmd0 */ | ||
191 | sync | ||
192 | |||
193 | /* auto refresh */ | ||
194 | sw zero, 0x08c8(a0) /* mem_sdautoref */ | ||
195 | sync | ||
196 | |||
197 | /* block access to the DDR */ | ||
198 | lw t0, 0x0848(a0) /* mem_sdconfigb */ | ||
199 | li t1, (1 << 7 | 0x3F) | ||
200 | or t0, t0, t1 | ||
201 | sw t0, 0x0848(a0) /* mem_sdconfigb */ | ||
202 | sync | ||
203 | |||
204 | /* issue the Self Refresh command */ | ||
205 | li t0, 0x10000000 | ||
206 | sw t0, 0x08dc(a0) /* mem_sdcmd1 */ | ||
207 | sw t0, 0x08d8(a0) /* mem_sdcmd0 */ | ||
208 | sync | ||
209 | |||
210 | /* wait for sdram to enter self-refresh mode */ | ||
211 | lui t0, 0x0300 | ||
212 | 3: lw t1, 0x0850(a0) /* mem_sdstat */ | ||
213 | and t2, t1, t0 | ||
214 | bne t2, t0, 3b | ||
215 | nop | ||
216 | |||
217 | /* disable SDRAM clocks */ | ||
218 | li t0, ~(3<<28) | ||
219 | lw t1, 0x0840(a0) /* mem_sdconfiga */ | ||
220 | and t1, t1, t0 /* clear CE[1:0] */ | ||
221 | sw t1, 0x0840(a0) /* mem_sdconfiga */ | ||
222 | sync | ||
223 | |||
224 | DO_SLEEP | ||
225 | 4: | ||
226 | |||
227 | END(alchemy_sleep_au1300) | ||
228 | |||
156 | 229 | ||
157 | /* This is where we return upon wakeup. | 230 | /* This is where we return upon wakeup. |
158 | * Reload all of the registers and return. | 231 | * Reload all of the registers and return. |