commit: http://blackfin.uclinux.org/git/?p=u-boot;a=commitdiff;h=0b8917147cb450a0f31a7d8cd9b1d6629f930107
branch: http://blackfin.uclinux.org/git/?p=u-boot;a=shortlog;h=refs/heads/trunk

Signed-off-by: Sonic Zhang <sonic.zh...@analog.com>
---
 arch/blackfin/cpu/initcode.c |    5 ++++-
 arch/blackfin/cpu/start.S    |   13 +++++++++++--
 drivers/watchdog/bfin_wdt.c  |    5 ++++-
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/arch/blackfin/cpu/initcode.c b/arch/blackfin/cpu/initcode.c
index e0afce8..0a2d7d8 100644
--- a/arch/blackfin/cpu/initcode.c
+++ b/arch/blackfin/cpu/initcode.c
@@ -13,6 +13,7 @@
 
 #include <config.h>
 #include <asm/blackfin.h>
+#include <asm/mach-common/bits/watchdog.h>
 #include <asm/mach-common/bits/bootrom.h>
 #include <asm/mach-common/bits/core.h>
 #include <asm/serial.h>
@@ -468,9 +469,11 @@ program_early_devices(ADI_BOOT_DATA *bs, uint *sdivB, uint *divB, uint *vcoB)
 		bfin_write_SEC_GCTL(0x1);
 		bfin_write_SEC_CCTL(0x1);
 #endif
+		bfin_write_WDOG_CTL(WDDIS);
+		SSYNC();
 		bfin_write_WDOG_CNT(MSEC_TO_SCLK(CONFIG_HW_WATCHDOG_TIMEOUT_INITCODE));
 #if CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_UART
-		bfin_write_WDOG_CTL(0);
+		bfin_write_WDOG_CTL(WDEN);
 #endif
 		serial_putc('f');
 	}
diff --git a/arch/blackfin/cpu/start.S b/arch/blackfin/cpu/start.S
index 088ff6a..8188da3 100644
--- a/arch/blackfin/cpu/start.S
+++ b/arch/blackfin/cpu/start.S
@@ -32,6 +32,7 @@
 
 #include <config.h>
 #include <asm/blackfin.h>
+#include <asm/mach-common/bits/watchdog.h>
 #include <asm/mach-common/bits/core.h>
 #include <asm/mach-common/bits/pll.h>
 #include <asm/serial.h>
@@ -68,14 +69,22 @@ ENTRY(_start)
 	 * That should be long enough to bootstrap ourselves up and
 	 * then the common u-boot code can take over.
 	 */
+	r1 = WDDIS;
+# ifdef __ADSPBF60x__
+	[p4 + (WDOG_CTL - SYSMMR_BASE)] = r1;
+# else
+	W[p4 + (WDOG_CTL - SYSMMR_BASE)] = r1;
+# endif
+	SSYNC;
 	r0 = 0;
 	r0.h = HI(MSEC_TO_SCLK(CONFIG_WATCHDOG_TIMEOUT_MSECS));
 	[p4 + (WDOG_CNT - SYSMMR_BASE)] = r0;
+	r1 = WDEN;
 	/* fire up the watchdog - R0.L above needs to be 0x0000 */
 # ifdef __ADSPBF60x__
-	[p4 + (WDOG_CTL - SYSMMR_BASE)] = r0;
+	[p4 + (WDOG_CTL - SYSMMR_BASE)] = r1;
 # else
-	W[p4 + (WDOG_CTL - SYSMMR_BASE)] = r0;
+	W[p4 + (WDOG_CTL - SYSMMR_BASE)] = r1;
 # endif
 #endif
 
diff --git a/drivers/watchdog/bfin_wdt.c b/drivers/watchdog/bfin_wdt.c
index 2101f6e..7a6756b 100644
--- a/drivers/watchdog/bfin_wdt.c
+++ b/drivers/watchdog/bfin_wdt.c
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <watchdog.h>
 #include <asm/blackfin.h>
+#include <asm/mach-common/bits/watchdog.h>
 
 void hw_watchdog_reset(void)
 {
@@ -17,7 +18,9 @@ void hw_watchdog_reset(void)
 
 void hw_watchdog_init(void)
 {
+	bfin_write_WDOG_CTL(WDDIS);
+	SSYNC();
 	bfin_write_WDOG_CNT(CONFIG_WATCHDOG_TIMEOUT_MSECS / 1000 * get_sclk());
 	hw_watchdog_reset();
-	bfin_write_WDOG_CTL(0x0);
+	bfin_write_WDOG_CTL(WDEN);
 }
_______________________________________________
U-Boot-commits mailing list
U-Boot-commits@blackfin.uclinux.org
https://blackfin.uclinux.org/mailman/listinfo/u-boot-commits

Reply via email to