aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-06-27 15:46:40 -0400
committerMike Frysinger <vapier@gentoo.org>2011-07-23 01:18:31 -0400
commit9e770f77801fce713f5736c66f8441467eb36db5 (patch)
tree38b0a8bd9da5ce486f102bcefe95261cb81877fe /arch
parentda31d6fb46b7671622dbfd44c7f27b0c97dc2faa (diff)
Blackfin: dpmc: optimize SDRAM programming slightly
No need to reload these registers constantly since they're always available (we're not making any function calls in between). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/blackfin/mach-common/dpmc_modes.S19
1 files changed, 10 insertions, 9 deletions
diff --git a/arch/blackfin/mach-common/dpmc_modes.S b/arch/blackfin/mach-common/dpmc_modes.S
index 2d1c3ce19fb1..1c534d298de4 100644
--- a/arch/blackfin/mach-common/dpmc_modes.S
+++ b/arch/blackfin/mach-common/dpmc_modes.S
@@ -196,21 +196,20 @@ ENTRY(_set_dram_srfs)
196#else /* SDRAM */ 196#else /* SDRAM */
197 P0.L = lo(EBIU_SDGCTL); 197 P0.L = lo(EBIU_SDGCTL);
198 P0.H = hi(EBIU_SDGCTL); 198 P0.H = hi(EBIU_SDGCTL);
199 P1.L = lo(EBIU_SDSTAT);
200 P1.H = hi(EBIU_SDSTAT);
201
199 R2 = [P0]; 202 R2 = [P0];
200 BITSET(R2, 24); /* SRFS enter self-refresh mode */ 203 BITSET(R2, 24); /* SRFS enter self-refresh mode */
201 [P0] = R2; 204 [P0] = R2;
202 SSYNC; 205 SSYNC;
203 206
204 P0.L = lo(EBIU_SDSTAT);
205 P0.H = hi(EBIU_SDSTAT);
2061: 2071:
207 R2 = w[P0]; 208 R2 = w[P1];
208 SSYNC; 209 SSYNC;
209 cc = BITTST(R2, 1); /* SDSRA poll self-refresh status */ 210 cc = BITTST(R2, 1); /* SDSRA poll self-refresh status */
210 if !cc jump 1b; 211 if !cc jump 1b;
211 212
212 P0.L = lo(EBIU_SDGCTL);
213 P0.H = hi(EBIU_SDGCTL);
214 R2 = [P0]; 213 R2 = [P0];
215 BITCLR(R2, 0); /* SCTLE disable CLKOUT */ 214 BITCLR(R2, 0); /* SCTLE disable CLKOUT */
216 [P0] = R2; 215 [P0] = R2;
@@ -220,6 +219,7 @@ ENDPROC(_set_dram_srfs)
220 219
221ENTRY(_unset_dram_srfs) 220ENTRY(_unset_dram_srfs)
222 /* set the dram out of self refresh mode */ 221 /* set the dram out of self refresh mode */
222
223#if defined(EBIU_RSTCTL) /* DDR */ 223#if defined(EBIU_RSTCTL) /* DDR */
224 P0.H = hi(EBIU_RSTCTL); 224 P0.H = hi(EBIU_RSTCTL);
225 P0.L = lo(EBIU_RSTCTL); 225 P0.L = lo(EBIU_RSTCTL);
@@ -227,20 +227,21 @@ ENTRY(_unset_dram_srfs)
227 BITCLR(R2, 3); /* clear SRREQ bit */ 227 BITCLR(R2, 3); /* clear SRREQ bit */
228 [P0] = R2; 228 [P0] = R2;
229#elif defined(EBIU_SDGCTL) /* SDRAM */ 229#elif defined(EBIU_SDGCTL) /* SDRAM */
230 230 /* release CLKOUT from self-refresh */
231 P0.L = lo(EBIU_SDGCTL); /* release CLKOUT from self-refresh */ 231 P0.L = lo(EBIU_SDGCTL);
232 P0.H = hi(EBIU_SDGCTL); 232 P0.H = hi(EBIU_SDGCTL);
233
233 R2 = [P0]; 234 R2 = [P0];
234 BITSET(R2, 0); /* SCTLE enable CLKOUT */ 235 BITSET(R2, 0); /* SCTLE enable CLKOUT */
235 [P0] = R2 236 [P0] = R2
236 SSYNC; 237 SSYNC;
237 238
238 P0.L = lo(EBIU_SDGCTL); /* release SDRAM from self-refresh */ 239 /* release SDRAM from self-refresh */
239 P0.H = hi(EBIU_SDGCTL);
240 R2 = [P0]; 240 R2 = [P0];
241 BITCLR(R2, 24); /* clear SRFS bit */ 241 BITCLR(R2, 24); /* clear SRFS bit */
242 [P0] = R2 242 [P0] = R2
243#endif 243#endif
244
244 SSYNC; 245 SSYNC;
245 RTS; 246 RTS;
246ENDPROC(_unset_dram_srfs) 247ENDPROC(_unset_dram_srfs)