[PATCH v8 0/5] Add support to read the watchdog bootstatus from IMEM
From: Kathiravan Thirumoorthy <hidden>
Date: 2026-02-26 16:59:47
Also in:
linux-arm-msm, linux-watchdog, lkml
In Qualcomm IPQ SoCs, if the system is rebooted due to the watchdog timeout, there is no way to identify it. Current approach of checking the EXPIRED_STATUS in WDT_STS is not working. To achieve this, if the system is rebooted due to watchdog timeout, the information is captured in the IMEM by the bootloader (along with other reason codes as well). This series attempts to address this by adding the support to read the IMEM and populate the information via bootstatus sysfs file. 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 Signed-off-by: Kathiravan Thirumoorthy <redacted> --- Changes in v8: - Collected the tags - Updated the commit msg with reasoning in 1/5 - Updated the comment in 4/5 - Link to v7: https://lore.kernel.org/r/20260225-wdt_reset_reason-v7-0-65d5b7e3e1eb@oss.qualcomm.com (local) Changes in v7: - Collected the tags - Added the reference link in 1/5 - Added the flag 'no-memory-wc' in 2/5 - Link to v6: https://lore.kernel.org/r/20260130-wdt_reset_reason-v6-0-417ab789cd97@oss.qualcomm.com (local) Changes in v6: - Moved the IMEM compatible from qcom,imem to sram binding - Updated the 'sram' property in watchdog binding to point to SRAM region and update the watchdog driver accordingly - Dropped the Konrad's R-b tag in 2/5 Changes in v5: - Rename property 'qcom,imem' to 'sram' - Use dev_err_probe instead of dev_err - Link to v4: https://lore.kernel.org/linux-arm-msm/20250519-wdt_reset_reason-v4-0-d59d21275c75@oss.qualcomm.com/ (local) Changes in v4: - Kept only the WDIOF_CARDRESET and dropped other codes (Guenter) - Renamed qcom_wdt_get_restart_reason() to qcom_wdt_get_bootstatus() - Dropped the device data and describe the required information in the DT (Konrad) - Link to v3: https://lore.kernel.org/linux-arm-msm/20250502-wdt_reset_reason-v3-0-b2dc7ace38ca@oss.qualcomm.com/ (local) Changes in v3: - Picked up the relevant tags - Dropped the fallback compatible handling - Split the driver changes into 2. Introduce the device data in one and extend the same in another for the use case - Link to v2: https://lore.kernel.org/linux-arm-msm/20250416-wdt_reset_reason-v2-0-c65bba312914@oss.qualcomm.com/ (local) Changes in v2: - Dropped the RFC tag - Reworked the driver changes to use the syscon API - Link to v1: https://lore.kernel.org/linux-arm-msm/20250408-wdt_reset_reason-v1-0-e6ec30c2c926@oss.qualcomm.com/ (local) Signed-off-by: Kathiravan Thirumoorthy <redacted> --- Kathiravan Thirumoorthy (5): dt-bindings: sram: describe the IPQ5424 IMEM as mmio-sram arm64: dts: qcom: ipq5424: Add the IMEM node dt-bindings: watchdog: qcom-wdt: Document sram property watchdog: qcom: add support to get the bootstatus from IMEM arm64: dts: qcom: ipq5424: add support to get watchdog bootstatus from IMEM .../devicetree/bindings/sram/qcom,imem.yaml | 1 - Documentation/devicetree/bindings/sram/sram.yaml | 1 + .../devicetree/bindings/watchdog/qcom-wdt.yaml | 6 ++++ arch/arm64/boot/dts/qcom/ipq5424.dtsi | 16 +++++++++ drivers/watchdog/qcom-wdt.c | 42 ++++++++++++++++++++-- 5 files changed, 63 insertions(+), 3 deletions(-) --- base-commit: 7d6661873f6b54c75195780a40d66bad3d482d8f change-id: 20250610-wdt_reset_reason-7a5afe702075 Best regards, -- Kathiravan Thirumoorthy [off-list ref]