summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomaz Solc <tomaz.solc@tablix.org>2019-02-14 14:36:34 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-02-18 14:26:08 +0100
commit73f2bc1466e257dbe2a0edd7d3c2ab4dba8e9470 (patch)
treeb2ce69206c23c5a284754c513376756b200a47aa
parentd1bebc03b3005b33da3d1541782bb037974d1486 (diff)
downloadbarebox-73f2bc1466e257dbe2a0edd7d3c2ab4dba8e9470.tar.gz
barebox-73f2bc1466e257dbe2a0edd7d3c2ab4dba8e9470.tar.xz
watchdog: bcm2835: set timeout_max.
BCM2835 watchdog timeout can be set to maximum 15 seconds (0xffffff >> 16). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/watchdog/bcm2835_wdt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/watchdog/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c
index d0c51ed9e..781626fa0 100644
--- a/drivers/watchdog/bcm2835_wdt.c
+++ b/drivers/watchdog/bcm2835_wdt.c
@@ -45,6 +45,10 @@
#define SECS_TO_WDOG_TICKS(x) ((x) << 16)
+/* Largest value where SECS_TO_WDOG_TICKS doesn't overflow 20 bits
+ * (PM_WDOG_TIME_SET) */
+#define WDOG_SECS_MAX 15
+
struct bcm2835_wd {
struct watchdog wd;
void __iomem *base;
@@ -101,6 +105,7 @@ static int bcm2835_wd_probe(struct device_d *dev)
}
priv->base = IOMEM(iores->start);
priv->wd.set_timeout = bcm2835_wd_set_timeout;
+ priv->wd.timeout_max = WDOG_SECS_MAX;
priv->wd.hwdev = dev;
priv->dev = dev;