diff options
Diffstat (limited to 'arch/blackfin/kernel/reboot.c')
-rw-r--r-- | arch/blackfin/kernel/reboot.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/blackfin/kernel/reboot.c b/arch/blackfin/kernel/reboot.c index ae28aac6fec1..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,7 +39,13 @@ 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 | asm("ssync;"); | 42 | |
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 | |||
38 | /* clear system soft reset */ | 49 | /* clear system soft reset */ |
39 | bfin_write_SWRST(0); | 50 | bfin_write_SWRST(0); |
40 | asm("ssync;"); | 51 | asm("ssync;"); |