Skip to content

Commit

Permalink
watchdog: imx2_wdt: Disable power down counter on boot
Browse files Browse the repository at this point in the history
Disable power down counter of the watchdog to avoid system resets. The
watchdog power down counter is set automatically by the chip. If it is
not set to 0 in the driver, the system resets.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
  • Loading branch information
Markus Pargmann authored and Wim Van Sebroeck committed Jan 21, 2015
1 parent bbd5900 commit 5fe65ce
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/watchdog/imx2_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
#define IMX2_WDT_WRSR 0x04 /* Reset Status Register */
#define IMX2_WDT_WRSR_TOUT (1 << 1) /* -> Reset due to Timeout */

#define IMX2_WDT_WMCR 0x08 /* Misc Register */

#define IMX2_WDT_MAX_TIME 128
#define IMX2_WDT_DEFAULT_TIME 60 /* in seconds */

Expand Down Expand Up @@ -274,6 +276,13 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)

imx2_wdt_ping_if_active(wdog);

/*
* Disable the watchdog power down counter at boot. Otherwise the power
* down counter will pull down the #WDOG interrupt line for one clock
* cycle.
*/
regmap_write(wdev->regmap, IMX2_WDT_WMCR, 0);

ret = watchdog_register_device(wdog);
if (ret) {
dev_err(&pdev->dev, "cannot register watchdog device\n");
Expand Down

0 comments on commit 5fe65ce

Please sign in to comment.