aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorMike Frysinger <vapier.adi@gmail.com>2009-02-04 03:49:45 -0500
committerBryan Wu <cooloney@kernel.org>2009-02-04 03:49:45 -0500
commitadab7eb883a0b0fb7f13b1d7b30b596139f6f40d (patch)
tree13891052c36d173d71964d2cf93d2ca52aac6643 /arch/blackfin
parentaa9c33b496ca9434f26beaa1b447a6e2e5d8ad6a (diff)
Blackfin arch: sync reboot handler with version in u-boot
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/kernel/reboot.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/arch/blackfin/kernel/reboot.c b/arch/blackfin/kernel/reboot.c
index eeee8cb43360..f7ca5789cccf 100644
--- a/arch/blackfin/kernel/reboot.c
+++ b/arch/blackfin/kernel/reboot.c
@@ -20,7 +20,7 @@
20 * reset while the Core B bit (on dual core parts) is cleared by 20 * reset while the Core B bit (on dual core parts) is cleared by
21 * the core reset. 21 * the core reset.
22 */ 22 */
23__attribute__((l1_text)) 23__attribute__ ((__l1_text__, __noreturn__))
24static void _bfin_reset(void) 24static void _bfin_reset(void)
25{ 25{
26 /* Wait for completion of "system" events such as cache line 26 /* Wait for completion of "system" events such as cache line
@@ -30,7 +30,11 @@ static void _bfin_reset(void)
30 */ 30 */
31 __builtin_bfin_ssync(); 31 __builtin_bfin_ssync();
32 32
33 while (1) { 33 /* The bootrom checks to see how it was reset and will
34 * automatically perform a software reset for us when
35 * it starts executing after the core reset.
36 */
37 if (ANOMALY_05000353 || ANOMALY_05000386) {
34 /* Initiate System software reset. */ 38 /* Initiate System software reset. */
35 bfin_write_SWRST(0x7); 39 bfin_write_SWRST(0x7);
36 40
@@ -50,6 +54,11 @@ static void _bfin_reset(void)
50 /* Clear System software reset */ 54 /* Clear System software reset */
51 bfin_write_SWRST(0); 55 bfin_write_SWRST(0);
52 56
57 /* The BF526 ROM will crash during reset */
58#if defined(__ADSPBF522__) || defined(__ADSPBF524__) || defined(__ADSPBF526__)
59 bfin_read_SWRST();
60#endif
61
53 /* Wait for the SWRST write to complete. Cannot rely on SSYNC 62 /* Wait for the SWRST write to complete. Cannot rely on SSYNC
54 * though as the System state is all reset now. 63 * though as the System state is all reset now.
55 */ 64 */
@@ -60,22 +69,17 @@ static void _bfin_reset(void)
60 : "a" (15 * 1) 69 : "a" (15 * 1)
61 : "LC1", "LB1", "LT1" 70 : "LC1", "LB1", "LT1"
62 ); 71 );
72 }
63 73
74 while (1)
64 /* Issue core reset */ 75 /* Issue core reset */
65 asm("raise 1"); 76 asm("raise 1");
66 }
67} 77}
68 78
79__attribute__ ((__noreturn__))
69static void bfin_reset(void) 80static void bfin_reset(void)
70{ 81{
71 if (ANOMALY_05000353 || ANOMALY_05000386) 82 _bfin_reset();
72 _bfin_reset();
73 else
74 /* the bootrom checks to see how it was reset and will
75 * automatically perform a software reset for us when
76 * it starts executing boot
77 */
78 asm("raise 1;");
79} 83}
80 84
81__attribute__((weak)) 85__attribute__((weak))