]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
watchdog: qcom: add support to get the bootstatus from IMEM
authorKathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
Wed, 8 Apr 2026 09:24:38 +0000 (14:54 +0530)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 3 May 2026 15:35:52 +0000 (08:35 -0700)
commit158dd300b07b0d39e9fb791a4ad1bc68c8588530
tree49ce892e4579fc816c7382eb60e6df7dffc04340
parentea333d1991e449b13a3b28812c4493d376492012
watchdog: qcom: add support to get the bootstatus from IMEM

When the system boots up after a watchdog reset, the EXPIRED_STATUS bit
in the WDT_STS register is cleared. To identify if the system was
restarted due to WDT expiry, XBL update the information in the IMEM region.
Update the driver to read the restart reason from IMEM and populate the
bootstatus accordingly.

With the CONFIG_WATCHDOG_SYSFS enabled, user can extract the information
as below:

cat /sys/devices/platform/soc@0/f410000.watchdog/watchdog/watchdog0/bootstatus
32

For backward compatibility, keep the EXPIRED_STATUS bit check. Add a new
function qcom_wdt_get_bootstatus() to read the restart reason from
IMEM.

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260408-wdt_reset_reason-v10-2-caf66786329f@oss.qualcomm.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/watchdog/qcom-wdt.c