I thought I would share a possible solution to WDIOC_GETBOOTSTATUS always returning 0 for the twl4030 watchdog (driver is hard-coded to do so).
After reading this post (http://e2e.ti.com/support/power_management/pmu/f/43/t/159584.aspx) and taking a look at the source (drivers/watchdog/twl4030_watchdog.c and include/linux/i2c/twl.h), I believe that the functionality is there to read the boot status flag.
I modified two cases in twl4030_wdt_ioctl() from twl4030_watchdog.c:
// used to fall thru to WDIOC_GETBOOTSTATUS
// which returned put_user(0, p)
return put_user(0, p);
// boot status is in TWL4030_MODULE_PM_MASTER, register TWL4030_PM_MASTER_STS_BOOT, bit 5
if ((error = twl_i2c_read(TWL4030_MODULE_PM_MASTER, &status, TWL4030_PM_MASTER_STS_BOOT, 1)) < 0)
// return 0 if no watchdog reset
return put_user(status & 0x20, p);
Is there any reason why reading the boot status flag would be a bad idea? I'm not sure if it was left unimplemented for a specific reason, but I tested it on my Overo Fire and it seems to work. Once the boot status flag is set it will remain set until a hard power cycle (i.e. soft reboots, shutdowns/boots won't affect it).