[U-Boot] [PATCH] watchdog: omap: Add handling for CONFIG_WATCHDOG_TIMEOUT_MSECS

This change add possibility to change watchdog timeout compile time. Previous default value is kept when CONFIG_WATCHDOG_TIMEOUT_MSECS is not defined in config file.
Signed-off-by: Marek Belisko marek.belisko@gmail.com --- drivers/watchdog/omap_wdt.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index 7ea4b60..26774d6 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c @@ -44,9 +44,6 @@ #include <asm/processor.h> #include <asm/arch/cpu.h>
-/* Hardware timeout in seconds */ -#define WDT_HW_TIMEOUT 60 - static unsigned int wdt_trgr_pattern = 0x1234;
void hw_watchdog_reset(void) @@ -92,8 +89,15 @@ void hw_watchdog_init(void) writel(WDT_WCLR_PRE | (PTV << WDT_WCLR_PTV_OFF), &wdt->wdtwclr); while (readl(&wdt->wdtwwps) & WDT_WWPS_PEND_WCLR) ; + /* + * If timeuot is not defined in config file + * use default 60 seconds + */ +#ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS +#define CONFIG_WATCHDOG_TIMEOUT_MSECS 60000 +#endif
- omap_wdt_set_timeout(WDT_HW_TIMEOUT); + omap_wdt_set_timeout(CONFIG_WATCHDOG_TIMEOUT_MSECS);
/* Sequence to enable the watchdog */ writel(0xBBBB, &wdt->wdtwspr);

Signed-off-by: Marek Belisko marek.belisko@gmail.com --- doc/README.watchdog | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/doc/README.watchdog b/doc/README.watchdog index 59f306b..b1b8d84 100644 --- a/doc/README.watchdog +++ b/doc/README.watchdog @@ -33,3 +33,6 @@ CONFIG_XILINX_TB_WATCHDOG
CONFIG_BFIN_WATCHDOG Available for bf5xx and bf6xx to service the watchdog. + +CONFIG_OMAP_WATCHDOG + Available for various TI OMAP 16xx, 24xx, 3xx, am33xx to service the watchdog.

On Thu, Jan 08, 2015 at 11:58:53AM +0100, Marek Belisko wrote:
This change add possibility to change watchdog timeout compile time. Previous default value is kept when CONFIG_WATCHDOG_TIMEOUT_MSECS is not defined in config file.
Lets do this with a Kconfig option please, thanks!
participants (2)
-
Marek Belisko
-
Tom Rini