Skip to content
Snippets Groups Projects
Commit 49c2da53 authored by Bob Liu's avatar Bob Liu Committed by sonic
Browse files

blackfin: bf60x: add hw watchdog support


Signed-off-by: default avatarBob Liu <lliubbo@gmail.com>
Signed-off-by: default avatarSonic Zhang <sonic.zhang@analog.com>
Signed-off-by: default avatarSonic Zhang <sonic.adi@gmail.com>
parent 4a207e8b
No related branches found
No related tags found
No related merge requests found
...@@ -461,8 +461,21 @@ program_early_devices(ADI_BOOT_DATA *bs, uint *sdivB, uint *divB, uint *vcoB) ...@@ -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) { if (CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_BYPASS) {
serial_putc('e'); 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)); 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(0);
#endif
serial_putc('f'); serial_putc('f');
} }
#endif #endif
......
...@@ -65,6 +65,7 @@ ENTRY(_start) ...@@ -65,6 +65,7 @@ ENTRY(_start)
p5.h = HI(COREMMR_BASE); p5.h = HI(COREMMR_BASE);
#ifdef CONFIG_HW_WATCHDOG #ifdef CONFIG_HW_WATCHDOG
#ifndef __ADSPBF60x__
# ifndef CONFIG_HW_WATCHDOG_TIMEOUT_START # ifndef CONFIG_HW_WATCHDOG_TIMEOUT_START
# define CONFIG_HW_WATCHDOG_TIMEOUT_START 5000 # define CONFIG_HW_WATCHDOG_TIMEOUT_START 5000
# endif # endif
...@@ -77,6 +78,7 @@ ENTRY(_start) ...@@ -77,6 +78,7 @@ ENTRY(_start)
[p4 + (WDOG_CNT - SYSMMR_BASE)] = r0; [p4 + (WDOG_CNT - SYSMMR_BASE)] = r0;
/* fire up the watchdog - R0.L above needs to be 0x0000 */ /* fire up the watchdog - R0.L above needs to be 0x0000 */
W[p4 + (WDOG_CTL - SYSMMR_BASE)] = r0; W[p4 + (WDOG_CTL - SYSMMR_BASE)] = r0;
#endif
#endif #endif
/* Turn on the serial for debugging the init process */ /* Turn on the serial for debugging the init process */
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
#define CONFIG_SYS_MONITOR_LEN (768 * 1024) #define CONFIG_SYS_MONITOR_LEN (768 * 1024)
#define CONFIG_SYS_MALLOC_LEN (512 * 1024) #define CONFIG_SYS_MALLOC_LEN (512 * 1024)
#define CONFIG_HW_WATCHDOG
/* /*
* Network Settings * Network Settings
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment