diff options
author | Robin Gong <yibin.gong@nxp.com> | 2017-12-12 14:33:14 +0800 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | c75aad0aed10665d839b929158933d56fa6582e6 (patch) | |
tree | 3c482dd1f910b0ff3b1ae27a6b8b3a64c050554b /drivers/watchdog | |
parent | 59b17ca25d47974e7fec75f9e81f57c4ee6a0038 (diff) |
MLK-17154 watchdog: imx8_wdt: align timeout value with imx2_wdt
Align timeout value with imx2_wdt.
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/imx8_wdt.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/watchdog/imx8_wdt.c b/drivers/watchdog/imx8_wdt.c index 6564532aca7b..955f1295d591 100644 --- a/drivers/watchdog/imx8_wdt.c +++ b/drivers/watchdog/imx8_wdt.c @@ -12,6 +12,7 @@ #include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/platform_device.h> #include <linux/reboot.h> #include <linux/watchdog.h> @@ -19,13 +20,23 @@ #include <soc/imx8/sc/sci.h> #include <soc/imx8/sc/svc/irq/api.h> -#define DEFAULT_TIMEOUT 10 +#define DEFAULT_TIMEOUT 60 /* * Software timer tick implemented in scfw side, support 10ms to 0xffffffff ms - * in theory, but for normal case, 1s~60s is enough, you can change this max + * in theory, but for normal case, 1s~128s is enough, you can change this max * value in case it's not enough. */ -#define MAX_TIMEOUT 60 +#define MAX_TIMEOUT 128 + +static bool nowayout = WATCHDOG_NOWAYOUT; +module_param(nowayout, bool, 0000); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" + __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); + +static unsigned int timeout = DEFAULT_TIMEOUT; +module_param(timeout, uint, 0000); +MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds (default=" + __MODULE_STRING(DEFAULT_TIMEOUT) ")"); static struct watchdog_device imx8_wdd; @@ -82,6 +93,8 @@ static int imx8_wdt_set_timeout(struct watchdog_device *wdog, { struct arm_smccc_res res; + wdog->timeout = timeout; + arm_smccc_smc(FSL_SIP_SRTC, FSL_SIP_SRTC_SET_TIMEOUT_WDOG, timeout * 1000, 0, 0, 0, 0, 0, &res); |