Lines Matching +full:watchdog +full:- +full:timeout +full:- +full:ms
1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2008-2009 ST-Ericsson AB
6 * Watchdog driver for the ST-Ericsson AB COH 901 327 IP core
12 #include <linux/watchdog.h>
28 /* WDOG_FEED Register 32bit (-/W) */
34 /* WDOG_DISABLE1 Register 32bit (-/W) */
47 /* WDOG_COUNT Register 32bit (R/-) */
56 /* WDOG_RESTART Register 32bit (-/W) */
70 /* Default timeout in seconds = 1 minute */
83 static void coh901327_enable(u16 timeout) in coh901327_enable() argument
105 /* Enable the watchdog interrupt */ in coh901327_enable()
107 /* Activate the watchdog timer */ in coh901327_enable()
108 writew(timeout, virtbase + U300_WDOG_TR); in coh901327_enable()
109 /* Start the watchdog timer */ in coh901327_enable()
112 * Extra read so that this change propagate in the watchdog. in coh901327_enable()
118 "%s(): watchdog not enabled! D2R value %04x\n", in coh901327_enable()
126 /* Disable the watchdog interrupt if it is active */ in coh901327_disable()
128 /* If the watchdog is currently enabled, attempt to disable it */ in coh901327_disable()
142 "%s(): watchdog not disabled! D2R value %04x\n", in coh901327_disable()
148 coh901327_enable(wdt_dev->timeout * 100); in coh901327_start()
160 /* Feed the watchdog */ in coh901327_ping()
169 wdt_dev->timeout = time; in coh901327_settimeout()
170 /* Set new timeout value */ in coh901327_settimeout()
194 * This interrupt occurs 10 ms before the watchdog WILL bark.
204 * when the system is about to watchdog-reset, add them here! in coh901327_interrupt()
206 * NOTE: on future versions of this IP-block, it will be possible in coh901327_interrupt()
207 * to prevent a watchdog reset by feeding the watchdog at this in coh901327_interrupt()
215 dev_crit(parent, "watchdog is barking!\n"); in coh901327_interrupt()
237 * Max timeout is 327 since the 10ms
238 * timeout register is max
239 * 0x7FFF = 327670ms ~= 327s.
243 .timeout = U300_WDOG_DEFAULT_TIMEOUT,
248 struct device *dev = &pdev->dev; in coh901327_probe()
273 dev_info(dev, "watchdog timed out since last chip reset!\n"); in coh901327_probe()
300 /* Reset the watchdog */ in coh901327_probe()
306 ret = -EIO; in coh901327_probe()
317 dev_info(dev, "initialized. (timeout=%d sec)\n", in coh901327_probe()
318 coh901327_wdt.timeout); in coh901327_probe()
339 /* If watchdog is on, disable it here and now */ in coh901327_suspend()
347 /* Restore the watchdog interrupt */ in coh901327_resume()
350 /* Restart the watchdog timer */ in coh901327_resume()
364 * Mistreating the watchdog is the only way to perform a software reset of the
373 * Timeout = 5s, we have to wait for the watchdog reset to in coh901327_watchdog_reset()
374 * actually take place: the watchdog will be reloaded with the in coh901327_watchdog_reset()
377 * The boot loader will typically deactivate the watchdog, so we in coh901327_watchdog_reset()
379 * deactivating the watchdog before it is shut down by it. in coh901327_watchdog_reset()
381 * NOTE: on future versions of the watchdog, this restriction is in coh901327_watchdog_reset()
382 * gone: the watchdog will be reloaded with a default value (1 min) in coh901327_watchdog_reset()
383 * instead of last value, and you can conveniently set the watchdog in coh901327_watchdog_reset()
384 * timeout to 10ms (value = 1) without any problems. in coh901327_watchdog_reset()
408 MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)");