9
0
Fork 0

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>
This commit is contained in:
Steffen Trumtrar 2015-03-27 20:23:11 +01:00 committed by Sascha Hauer
parent 3da922bb1b
commit 5cef8a3670
1 changed files with 7 additions and 0 deletions

View File

@ -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);
}