summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorSteffen Trumtrar <s.trumtrar@pengutronix.de>2015-03-27 20:23:11 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-03-30 19:24:01 +0200
commit5cef8a367097923ec2c59ee3603535958976c465 (patch)
tree8401d6e696b212001adba974e4a52f70a422bdf4 /drivers/watchdog
parent3da922bb1b8109f8e2d0851e039addddb3a5ecfa (diff)
downloadbarebox-5cef8a367097923ec2c59ee3603535958976c465.tar.gz
ARM/MXS/i.MX28: recognize watchdog reset
When a watchdog timeout is set in the linux kernel, the FORCE_UPDATE bit is set. Use this to recognize a system reset that was triggered by the watchdog. Since only the wdt part of the kernel driver sets this bit, this is a safe distinguishing feature. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/im28wd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/watchdog/im28wd.c b/drivers/watchdog/im28wd.c
index 3e73ecd..a9093a7 100644
--- a/drivers/watchdog/im28wd.c
+++ b/drivers/watchdog/im28wd.c
@@ -176,6 +176,13 @@ static void __maybe_unused imx28_detect_reset_source(const struct imx28_wd *p)
reset_source_set(RESET_RST);
return;
}
+ reg = readl(p->regs + MXS_RTC_PERSISTENT1);
+ if (reg & MXS_RTC_PERSISTENT1_FORCE_UPDATER) {
+ writel(MXS_RTC_PERSISTENT1_FORCE_UPDATER,
+ p->regs + MXS_RTC_PERSISTENT1 + MXS_RTC_CLR_ADDR);
+ reset_source_set(RESET_WDG);
+ return;
+ }
reset_source_set(RESET_RST);
}