aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2008-01-22 05:38:02 -0500
committerBryan Wu <bryan.wu@analog.com>2008-01-22 05:38:02 -0500
commit444ad82bc3eaa554be40d22dc248e58aeefd54d9 (patch)
tree3244f4f4585847419dc28c706aec658cba6e05be /arch
parenta628a8bcd8a6daea6096fe781fc36cae4ac1ed48 (diff)
[Blackfin] arch: Add proper SW System Reset delay sequence
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/blackfin/kernel/reboot.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/arch/blackfin/kernel/reboot.c b/arch/blackfin/kernel/reboot.c
index 06501a594dda..483f93dfc1b5 100644
--- a/arch/blackfin/kernel/reboot.c
+++ b/arch/blackfin/kernel/reboot.c
@@ -19,6 +19,11 @@
19#define SYSCR_VAL 0x10 19#define SYSCR_VAL 0x10
20#endif 20#endif
21 21
22/*
23 * Delay min 5 SCLK cycles using worst case CCLK/SCLK ratio (15)
24 */
25#define SWRST_DELAY (5 * 15)
26
22/* A system soft reset makes external memory unusable 27/* A system soft reset makes external memory unusable
23 * so force this function into L1. 28 * so force this function into L1.
24 */ 29 */
@@ -34,11 +39,15 @@ void bfin_reset(void)
34 while (1) { 39 while (1) {
35 /* initiate system soft reset with magic 0x7 */ 40 /* initiate system soft reset with magic 0x7 */
36 bfin_write_SWRST(0x7); 41 bfin_write_SWRST(0x7);
37 bfin_read_SWRST(); 42
38 asm("ssync;"); 43 /* Wait for System reset to actually reset, needs to be 5 SCLKs, */
44 /* Assume CCLK / SCLK ratio is worst case (15), and use 5*15 */
45
46 asm("LSETUP(.Lfoo,.Lfoo) LC0 = %0\n .Lfoo: NOP;\n"
47 : : "a" (SWRST_DELAY) : "LC0", "LT0", "LB0");
48
39 /* clear system soft reset */ 49 /* clear system soft reset */
40 bfin_write_SWRST(0); 50 bfin_write_SWRST(0);
41 bfin_read_SWRST();
42 asm("ssync;"); 51 asm("ssync;");
43 /* issue core reset */ 52 /* issue core reset */
44 asm("raise 1"); 53 asm("raise 1");