From 8b1b75441d415de7c73b6f68dd2e29b7e0ead9fb Mon Sep 17 00:00:00 2001 From: Juergen Borleis Date: Wed, 7 Jun 2017 12:45:42 +0200 Subject: i.MX/WD: setup the watchdog according to its datasheet From earlier SoCs like the i.MX21 up to i.MX7 their datasheets states after reset the watchdog timer has to be set first prior enabling the watchdog itself. This change do it this way. Signed-off-by: Juergen Borleis Signed-off-by: Sascha Hauer --- drivers/watchdog/imxwd.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/watchdog') diff --git a/drivers/watchdog/imxwd.c b/drivers/watchdog/imxwd.c index b920c7234b..5cc178f3e8 100644 --- a/drivers/watchdog/imxwd.c +++ b/drivers/watchdog/imxwd.c @@ -114,6 +114,12 @@ static int imx21_watchdog_set_timeout(struct imx_wd *priv, unsigned timeout) if (priv->ext_reset) val |= IMX21_WDOG_WCR_WDT; + /* + * set time and some write once bits first prior enabling the + * watchdog according to the datasheet + */ + writew(val, priv->base + IMX21_WDOG_WCR); + writew(IMX21_WDOG_WCR_WDE | val, priv->base + IMX21_WDOG_WCR); /* Write Service Sequence */ -- cgit v1.2.3