From 648cc337cd27d03a4644d2a6e96f9ef0ce32dc11 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 20 Nov 2014 17:05:16 +0100 Subject: [PATCH] sysmobts_v2: Enable the HW watchdog in the bootloader We want to deal/detect events like uboot getting stuck in the ubi/ubifs code. Enable the watchdog feature of u-boot. We need to start the watchdog once by ourselves and then trigger the Davinci one. Once we have set the 60s it can not be changed later on. This requires an updated kernel as well. Fixes: SYS#374 --- board/davinci/sysmobts_v2/sysmobts_v2.c | 10 ++++++++++ include/configs/davinci_sysmobts_v2.h | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/board/davinci/sysmobts_v2/sysmobts_v2.c b/board/davinci/sysmobts_v2/sysmobts_v2.c index 5d1a06005e..2eca859f6a 100644 --- a/board/davinci/sysmobts_v2/sysmobts_v2.c +++ b/board/davinci/sysmobts_v2/sysmobts_v2.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #define DAVINCI_PLLM (0x01C40910) /* PLL 1 Multiplier */ @@ -139,6 +140,9 @@ int board_init(void) lpsc_on(DAVINCI_LPSC_TIMER1); timer_init(); +#ifdef CONFIG_HW_WATCHDOG + davinci_hw_watchdog_enable(); +#endif return(0); } @@ -170,3 +174,9 @@ int misc_init_r(void) return(0); } +#ifdef CONFIG_HW_WATCHDOG +void hw_watchdog_reset(void) +{ + davinci_hw_watchdog_reset(); +} +#endif diff --git a/include/configs/davinci_sysmobts_v2.h b/include/configs/davinci_sysmobts_v2.h index 94bc621d1d..16db6c723c 100644 --- a/include/configs/davinci_sysmobts_v2.h +++ b/include/configs/davinci_sysmobts_v2.h @@ -203,5 +203,11 @@ #define CONFIG_CLOCKS #endif +/* Enable the watchdog */ +#define CONFIG_HW_WATCHDOG +#define CONFIG_SYS_WDTTIMERBASE 0x01c21C00 +#define CONFIG_SYS_WDT_PERIOD_LOW 0x608f3d00 /* 60s */ +#define CONFIG_SYS_WDT_PERIOD_HIGH 0x0 + #endif /* __CONFIG_H */