]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
watchdog: omap_wdt: Fix WDT timeout configuration
authorMarek Vasut <marex@denx.de>
Fri, 24 Jan 2020 04:44:23 +0000 (05:44 +0100)
committerLokesh Vutla <lokeshvutla@ti.com>
Tue, 4 Feb 2020 03:37:24 +0000 (09:07 +0530)
The timeout parameter of omap3_wdt_start() is in miliseconds, while
GET_WLDR_VAL() expects parameter in seconds. Fix this so the WDT
driver is actually usable.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Sam Protsenko <semen.protsenko@linaro.org>
Cc: Suniel Mahesh <sunil.m@techveda.org>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
drivers/watchdog/omap_wdt.c

index 284cfbb2a891b57825ce1b713ea44d887719d255..b9cdf700363ee70c2a06e6ab7ee5b7fc3f0bb336 100644 (file)
@@ -188,7 +188,7 @@ static int omap3_wdt_stop(struct udevice *dev)
 static int omap3_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
 {
        struct omap3_wdt_priv *priv = dev_get_priv(dev);
-       u32 pre_margin = GET_WLDR_VAL(timeout_ms);
+       u32 pre_margin = GET_WLDR_VAL(timeout_ms / 1000);
 /*
  * Make sure the watchdog is disabled. This is unfortunately required
  * because writing to various registers with the watchdog running has no