watchdog: make imx2_wdt report boot status correctly
authorOskar Schirmer <oskar@scara.com>
Thu, 16 Feb 2012 12:17:45 +0000 (12:17 +0000)
committerWim Van Sebroeck <wim@iguana.be>
Tue, 27 Mar 2012 17:58:30 +0000 (19:58 +0200)
commit474ef121008a2992bcc496930166ced89bda23d2
tree5411110e4ff37ca1e2e4196d5433d4065c583e62
parent5ba927e8ca3f73acb98f417d126652e26ab40a57
watchdog: make imx2_wdt report boot status correctly

Ioctl WDIOC_GETBOOTSTATUS is supposed to return some information
on why the system did (re)boot recently, value WDIOF_CARDRESET
being used to indicate watchdog induced reboot.

Up to now, imx2_wdt did not provide a value here, always returning
zero to indicate normal boot.

Do evaluate the IMX Watchdog Reset Status Register and
produce WDIOF_CARDRESET with WDIOC_GETBOOTSTATUS in case
of a watchdog induced reset.

Signed-off-by: Oskar Schirmer <oskar@scara.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/watchdog/imx2_wdt.c