Title: [4105] trunk/arch/blackfin/kernel/reboot.c: [#2424] Add proper SW System Reset delay sequence
Revision
4105
Author
hennerich
Date
2008-01-16 01:20:27 -0600 (Wed, 16 Jan 2008)

Log Message

[#2424] Add proper SW System Reset delay sequence

Diffstat

 reboot.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

Modified Paths

Diff

Modified: trunk/arch/blackfin/kernel/reboot.c (4104 => 4105)


--- trunk/arch/blackfin/kernel/reboot.c	2008-01-16 06:51:48 UTC (rev 4104)
+++ trunk/arch/blackfin/kernel/reboot.c	2008-01-16 07:20:27 UTC (rev 4105)
@@ -19,12 +19,18 @@
 #define SYSCR_VAL 	0x10
 #endif
 
+/*
+ * Delay min 5 SCLK cycles using worst case CCLK/SCLK ratio (15)
+ */
+#define SWRST_DELAY	(5 * 15)
+
 /* A system soft reset makes external memory unusable
  * so force this function into L1.
  */
 __attribute__((l1_text))
 void bfin_reset(void)
 {
+	int cntr;
 	/* force BMODE and disable Core B (as needed) */
 	bfin_write_SYSCR(SYSCR_VAL);
 
@@ -34,12 +40,12 @@
 	while (1) {
 		/* initiate system soft reset with magic 0x7 */
 		bfin_write_SWRST(0x7);
-		bfin_read_SWRST();
-		asm("ssync;");
+		for (cntr = 0; cntr < SWRST_DELAY; cntr++)
+			asm("NOP;");
 		/* clear system soft reset */
 		bfin_write_SWRST(0);
-		bfin_read_SWRST();
-		asm("ssync;");
+		for (cntr = 0; cntr < SWRST_DELAY; cntr++)
+			asm("NOP;");
 		/* issue core reset */
 		asm("raise 1");
 	}
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to