diff options
Diffstat (limited to 'arch/blackfin/kernel/reboot.c')
-rw-r--r-- | arch/blackfin/kernel/reboot.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/arch/blackfin/kernel/reboot.c b/arch/blackfin/kernel/reboot.c index 367e2dc09881..ae97ca407b0d 100644 --- a/arch/blackfin/kernel/reboot.c +++ b/arch/blackfin/kernel/reboot.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <asm/bfin-global.h> | 10 | #include <asm/bfin-global.h> |
11 | #include <asm/reboot.h> | 11 | #include <asm/reboot.h> |
12 | #include <asm/system.h> | 12 | #include <asm/system.h> |
13 | #include <asm/bfrom.h> | ||
13 | 14 | ||
14 | /* A system soft reset makes external memory unusable so force | 15 | /* A system soft reset makes external memory unusable so force |
15 | * this function into L1. We use the compiler ssync here rather | 16 | * this function into L1. We use the compiler ssync here rather |
@@ -20,7 +21,7 @@ | |||
20 | * the core reset. | 21 | * the core reset. |
21 | */ | 22 | */ |
22 | __attribute__((l1_text)) | 23 | __attribute__((l1_text)) |
23 | void bfin_reset(void) | 24 | static void bfin_reset(void) |
24 | { | 25 | { |
25 | /* Wait for completion of "system" events such as cache line | 26 | /* Wait for completion of "system" events such as cache line |
26 | * line fills so that we avoid infinite stalls later on as | 27 | * line fills so that we avoid infinite stalls later on as |
@@ -34,15 +35,15 @@ void bfin_reset(void) | |||
34 | bfin_write_SWRST(0x7); | 35 | bfin_write_SWRST(0x7); |
35 | 36 | ||
36 | /* Due to the way reset is handled in the hardware, we need | 37 | /* Due to the way reset is handled in the hardware, we need |
37 | * to delay for 7 SCLKS. The only reliable way to do this is | 38 | * to delay for 10 SCLKS. The only reliable way to do this is |
38 | * to calculate the CCLK/SCLK ratio and multiply 7. For now, | 39 | * to calculate the CCLK/SCLK ratio and multiply 10. For now, |
39 | * we'll assume worse case which is a 1:15 ratio. | 40 | * we'll assume worse case which is a 1:15 ratio. |
40 | */ | 41 | */ |
41 | asm( | 42 | asm( |
42 | "LSETUP (1f, 1f) LC0 = %0\n" | 43 | "LSETUP (1f, 1f) LC0 = %0\n" |
43 | "1: nop;" | 44 | "1: nop;" |
44 | : | 45 | : |
45 | : "a" (15 * 7) | 46 | : "a" (15 * 10) |
46 | : "LC0", "LB0", "LT0" | 47 | : "LC0", "LB0", "LT0" |
47 | ); | 48 | ); |
48 | 49 | ||
@@ -74,7 +75,14 @@ void machine_restart(char *cmd) | |||
74 | { | 75 | { |
75 | native_machine_restart(cmd); | 76 | native_machine_restart(cmd); |
76 | local_irq_disable(); | 77 | local_irq_disable(); |
77 | bfin_reset(); | 78 | if (ANOMALY_05000353 || ANOMALY_05000386) |
79 | bfin_reset(); | ||
80 | else | ||
81 | /* the bootrom checks to see how it was reset and will | ||
82 | * automatically perform a software reset for us when | ||
83 | * it starts executing boot | ||
84 | */ | ||
85 | asm("raise 1;"); | ||
78 | } | 86 | } |
79 | 87 | ||
80 | __attribute__((weak)) | 88 | __attribute__((weak)) |