Skip to contentSkip to conversation

watchdog: omap: Add handling for CONFIG_WATCHDOG_TIMEOUT_MSECS

PATCH New Marek Belisko 2 participants 3 messages Jan 8, 2015 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/watchdog/omap_wdt.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/watchdog/omap_wdt.c +8 -4
index 7ea4b60..26774d6 100644
@@ -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);
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 doc: watchdog: Add documentation for omap watchdog

---
 doc/README.watchdog |    3 +++
 1 file changed, 3 insertions(+)
doc/README.watchdog +3 -0
index 59f306b..b1b8d84 100644
@@ -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.
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 1/1 watchdog: omap: Add handling for CONFIG_WATCHDOG_TIMEOUT_MSECS

In reply to Marek Belisko
Quoted 3 lines · Marek Belisko

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!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150108/5d54a144/attachment.pgp>