]> git.sur5r.net Git - u-boot/commitdiff
blackfin: bf60x: add hw watchdog support
authorBob Liu <lliubbo@gmail.com>
Tue, 27 Dec 2011 07:05:53 +0000 (15:05 +0800)
committersonic <sonic@sonic-linuxvm.(none)>
Mon, 4 Mar 2013 05:42:07 +0000 (13:42 +0800)
Signed-off-by: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Sonic Zhang <sonic.adi@gmail.com>
arch/blackfin/cpu/initcode.c
arch/blackfin/cpu/start.S
include/configs/bf609-ezkit.h

index a717148651f4f671eab30b055ee576118ca96891..ce9a43598c7951167029aa202204443a30f0beb8 100644 (file)
@@ -461,8 +461,21 @@ program_early_devices(ADI_BOOT_DATA *bs, uint *sdivB, uint *divB, uint *vcoB)
         */
        if (CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_BYPASS) {
                serial_putc('e');
+#ifdef __ADSPBF60x__
+               bfin_write_SEC_GCTL(0x2);
+               SSYNC();
+               bfin_write_SEC_FCTL(0xc1);
+               bfin_write_SEC_SCTL(2, bfin_read_SEC_SCTL(2) | 0x6);
+
+               bfin_write_SEC_CCTL(0x2);
+               SSYNC();
+               bfin_write_SEC_GCTL(0x1);
+               bfin_write_SEC_CCTL(0x1);
+#endif
                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);
+#endif
                serial_putc('f');
        }
 #endif
index 90b4d1ae942c50617c967fc8b9c295190d3f178b..7155fc858b781d7d9a579f3879d228dab2d2e6fb 100644 (file)
@@ -65,6 +65,7 @@ ENTRY(_start)
        p5.h = HI(COREMMR_BASE);
 
 #ifdef CONFIG_HW_WATCHDOG
+#ifndef __ADSPBF60x__
 # ifndef CONFIG_HW_WATCHDOG_TIMEOUT_START
 #  define CONFIG_HW_WATCHDOG_TIMEOUT_START 5000
 # endif
@@ -77,6 +78,7 @@ ENTRY(_start)
        [p4 + (WDOG_CNT - SYSMMR_BASE)] = r0;
        /* fire up the watchdog - R0.L above needs to be 0x0000 */
        W[p4 + (WDOG_CTL - SYSMMR_BASE)] = r0;
+#endif
 #endif
 
        /* Turn on the serial for debugging the init process */
index 6dffab86dc4c5f7496693a9d69e8c5ca80d911b8..02149fa94df9849bc57568aae08f7643bb1d8e70 100644 (file)
@@ -63,6 +63,7 @@
 #define CONFIG_SYS_MONITOR_LEN (768 * 1024)
 #define CONFIG_SYS_MALLOC_LEN  (512 * 1024)
 
+#define CONFIG_HW_WATCHDOG
 /*
  * Network Settings
  */