* [PATCH v5 0/5] Add support to read the watchdog bootstatus from IMEM
@ 2025-06-10 13:45 Kathiravan Thirumoorthy
2025-06-10 13:45 ` [PATCH v5 1/5] dt-bindings: sram: qcom,imem: Document IPQ5424 compatible Kathiravan Thirumoorthy
` (4 more replies)
0 siblings, 5 replies; 12+ messages in thread
From: Kathiravan Thirumoorthy @ 2025-06-10 13:45 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
Konrad Dybcio, Wim Van Sebroeck, Guenter Roeck, Rajendra Nayak
Cc: linux-arm-msm, devicetree, linux-kernel, linux-watchdog,
Kathiravan Thirumoorthy, Konrad Dybcio
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 <kathiravan.thirumoorthy@oss.qualcomm.com>
---
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/
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/
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/
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/
Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
---
Kathiravan Thirumoorthy (5):
dt-bindings: sram: qcom,imem: Document IPQ5424 compatible
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 +
.../devicetree/bindings/watchdog/qcom-wdt.yaml | 20 ++++++++++
arch/arm64/boot/dts/qcom/ipq5424.dtsi | 10 +++++
drivers/watchdog/qcom-wdt.c | 43 +++++++++++++++++++++-
4 files changed, 72 insertions(+), 2 deletions(-)
---
base-commit: b27cc623e01be9de1580eaa913508b237a7a9673
change-id: 20250610-wdt_reset_reason-7a5afe702075
Best regards,
--
Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v5 1/5] dt-bindings: sram: qcom,imem: Document IPQ5424 compatible
2025-06-10 13:45 [PATCH v5 0/5] Add support to read the watchdog bootstatus from IMEM Kathiravan Thirumoorthy
@ 2025-06-10 13:45 ` Kathiravan Thirumoorthy
2025-06-10 13:45 ` [PATCH v5 2/5] arm64: dts: qcom: ipq5424: Add the IMEM node Kathiravan Thirumoorthy
` (3 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Kathiravan Thirumoorthy @ 2025-06-10 13:45 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
Konrad Dybcio, Wim Van Sebroeck, Guenter Roeck, Rajendra Nayak
Cc: linux-arm-msm, devicetree, linux-kernel, linux-watchdog,
Kathiravan Thirumoorthy
Add compatible for Qualcomm's IPQ5424 IMEM.
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
---
Changes in v5:
- No changes
Changes in v4:
- No changes
Changes in v3:
- Picked up the A-b tag
---
Documentation/devicetree/bindings/sram/qcom,imem.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/sram/qcom,imem.yaml b/Documentation/devicetree/bindings/sram/qcom,imem.yaml
index 2711f90d9664b70fcd1e2f7e2dfd3386ed5c1952..dec1b1ee924cf1386f559eb262ea864f2788c165 100644
--- a/Documentation/devicetree/bindings/sram/qcom,imem.yaml
+++ b/Documentation/devicetree/bindings/sram/qcom,imem.yaml
@@ -18,6 +18,7 @@ properties:
items:
- enum:
- qcom,apq8064-imem
+ - qcom,ipq5424-imem
- qcom,msm8226-imem
- qcom,msm8974-imem
- qcom,msm8976-imem
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v5 2/5] arm64: dts: qcom: ipq5424: Add the IMEM node
2025-06-10 13:45 [PATCH v5 0/5] Add support to read the watchdog bootstatus from IMEM Kathiravan Thirumoorthy
2025-06-10 13:45 ` [PATCH v5 1/5] dt-bindings: sram: qcom,imem: Document IPQ5424 compatible Kathiravan Thirumoorthy
@ 2025-06-10 13:45 ` Kathiravan Thirumoorthy
2025-06-10 13:45 ` [PATCH v5 3/5] dt-bindings: watchdog: qcom-wdt: Document sram property Kathiravan Thirumoorthy
` (2 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Kathiravan Thirumoorthy @ 2025-06-10 13:45 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
Konrad Dybcio, Wim Van Sebroeck, Guenter Roeck, Rajendra Nayak
Cc: linux-arm-msm, devicetree, linux-kernel, linux-watchdog,
Kathiravan Thirumoorthy, Konrad Dybcio
Add the IMEM node to the device tree to extract debugging information
like system restart reason, which is populated via IMEM. Define the
IMEM region to enable this functionality.
As described, overall IMEM region is 112KB but only initial 4KB is
accessible by all masters in the SoC.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
---
Changes in v5:
- No changes
Changes in v4:
- No changes
Changes in v3:
- Picked up the R-b tag
Changes in v2:
- Describe the entire IMEM region in the node
- Explicitly call out that initial 4K only accessible by all
masters in the commit message
---
arch/arm64/boot/dts/qcom/ipq5424.dtsi | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/ipq5424.dtsi b/arch/arm64/boot/dts/qcom/ipq5424.dtsi
index 66bd2261eb25d79051adddef604c55f5b01e6e8b..7fdc003f210e5a69944b00361a16fbdf58f39801 100644
--- a/arch/arm64/boot/dts/qcom/ipq5424.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5424.dtsi
@@ -591,6 +591,15 @@ ssphy_0: phy@7d000 {
status = "disabled";
};
+ sram@8600000 {
+ compatible = "qcom,ipq5424-imem", "syscon", "simple-mfd";
+ reg = <0 0x08600000 0 0x1c000>;
+ ranges = <0 0 0x08600000 0x1c000>;
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+ };
+
usb3: usb3@8a00000 {
compatible = "qcom,ipq5424-dwc3", "qcom,dwc3";
reg = <0 0x08af8800 0 0x400>;
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v5 3/5] dt-bindings: watchdog: qcom-wdt: Document sram property
2025-06-10 13:45 [PATCH v5 0/5] Add support to read the watchdog bootstatus from IMEM Kathiravan Thirumoorthy
2025-06-10 13:45 ` [PATCH v5 1/5] dt-bindings: sram: qcom,imem: Document IPQ5424 compatible Kathiravan Thirumoorthy
2025-06-10 13:45 ` [PATCH v5 2/5] arm64: dts: qcom: ipq5424: Add the IMEM node Kathiravan Thirumoorthy
@ 2025-06-10 13:45 ` Kathiravan Thirumoorthy
2025-06-10 16:36 ` Rob Herring (Arm)
2025-06-10 18:03 ` Rob Herring
2025-06-10 13:45 ` [PATCH v5 4/5] watchdog: qcom: add support to get the bootstatus from IMEM Kathiravan Thirumoorthy
2025-06-10 13:45 ` [PATCH v5 5/5] arm64: dts: qcom: ipq5424: add support to get watchdog " Kathiravan Thirumoorthy
4 siblings, 2 replies; 12+ messages in thread
From: Kathiravan Thirumoorthy @ 2025-06-10 13:45 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
Konrad Dybcio, Wim Van Sebroeck, Guenter Roeck, Rajendra Nayak
Cc: linux-arm-msm, devicetree, linux-kernel, linux-watchdog,
Kathiravan Thirumoorthy
Document the "sram" property for the watchdog device on Qualcomm
IPQ platforms. Use this property to extract the restart reason from
IMEM, which is updated by XBL. Populate the watchdog's bootstatus sysFS
entry with this information, when the system reboots due to a watchdog
timeout.
Describe this property for the IPQ5424 watchdog device and extend support
to other targets subsequently.
Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
---
Changes in v5:
- Rename the property 'qcom,imem' to 'sram'
Changes in v4:
- New patch
---
.../devicetree/bindings/watchdog/qcom-wdt.yaml | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
index 49e2b807db0bc9d3edfc93ec41ad0df0b74ed032..74a09c391fd8e2befeac07f254ea16d0ca362248 100644
--- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
@@ -81,6 +81,16 @@ properties:
minItems: 1
maxItems: 5
+ sram:
+ $ref: /schemas/types.yaml#/definitions/phandle-array
+ description:
+ phandle to the IMEM syscon node that exposes the system restart reason
+ items:
+ - items:
+ - description: phandle of IMEM syscon
+ - description: offset of restart reason region
+ - description: value indicate that the watchdog timeout has occurred
+
required:
- compatible
- reg
@@ -117,6 +127,16 @@ allOf:
required:
- clock-frequency
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - qcom,apss-wdt-ipq5424
+ then:
+ required:
+ - sram
+
unevaluatedProperties: false
examples:
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v5 4/5] watchdog: qcom: add support to get the bootstatus from IMEM
2025-06-10 13:45 [PATCH v5 0/5] Add support to read the watchdog bootstatus from IMEM Kathiravan Thirumoorthy
` (2 preceding siblings ...)
2025-06-10 13:45 ` [PATCH v5 3/5] dt-bindings: watchdog: qcom-wdt: Document sram property Kathiravan Thirumoorthy
@ 2025-06-10 13:45 ` Kathiravan Thirumoorthy
2025-06-10 13:45 ` [PATCH v5 5/5] arm64: dts: qcom: ipq5424: add support to get watchdog " Kathiravan Thirumoorthy
4 siblings, 0 replies; 12+ messages in thread
From: Kathiravan Thirumoorthy @ 2025-06-10 13:45 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
Konrad Dybcio, Wim Van Sebroeck, Guenter Roeck, Rajendra Nayak
Cc: linux-arm-msm, devicetree, linux-kernel, linux-watchdog,
Kathiravan Thirumoorthy
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.
Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
---
Changes in v5:
- Use dev_err_probe instead of dev_err
Changes in v4:
- Kept only WDIOF_CARDRESET and dropped other codes
- Renamed qcom_wdt_get_reason_reason() to
qcom_wdt_get_bootstatus()
- Moved the existing check inside qcom_wdt_get_bootstatus()
- Dropped the device data and put all the details in the DT node
Changes in v3:
- Split the introduction of device data into separate patch
- s/bootloaders/XBL - for clarity of which bootloader is
involved
- Mention the sysfs path on to extract this information
- s/compatible/imem_compatible in the device data structure to
avoid the confusion / better naming
Changes in v2:
- Use the syscon API to access the IMEM region
- Handle the error cases returned by qcom_wdt_get_restart_reason
- Define device specific data to retrieve the IMEM compatible,
offset and the value for non secure WDT, which allows to
extend the support for other SoCs
---
drivers/watchdog/qcom-wdt.c | 43 +++++++++++++++++++++++++++++++++++++++++--
1 file changed, 41 insertions(+), 2 deletions(-)
diff --git a/drivers/watchdog/qcom-wdt.c b/drivers/watchdog/qcom-wdt.c
index dfaac5995c84c1f377023e6e62770c5548528a4c..795f409506c6bb1dfb26cd8af18bece3cc35aebf 100644
--- a/drivers/watchdog/qcom-wdt.c
+++ b/drivers/watchdog/qcom-wdt.c
@@ -7,9 +7,11 @@
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
+#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
+#include <linux/regmap.h>
#include <linux/watchdog.h>
enum wdt_reg {
@@ -193,6 +195,42 @@ static const struct qcom_wdt_match_data match_data_kpss = {
.max_tick_count = 0xFFFFFU,
};
+static int qcom_wdt_get_bootstatus(struct device *dev, struct qcom_wdt *wdt)
+{
+ unsigned int args[2];
+ struct regmap *imem;
+ unsigned int val;
+ int ret;
+
+ imem = syscon_regmap_lookup_by_phandle_args(dev->of_node, "sram",
+ ARRAY_SIZE(args), args);
+ if (IS_ERR(imem)) {
+ ret = PTR_ERR(imem);
+ if (ret != -ENOENT) {
+ dev_err_probe(dev, ret, "Failed to lookup syscon\n");
+ return ret;
+ }
+
+ /* Fallback to the existing check */
+ if (readl(wdt_addr(wdt, WDT_STS)) & 1)
+ wdt->wdd.bootstatus = WDIOF_CARDRESET;
+
+ return 0;
+ }
+
+ ret = regmap_read(imem, args[0], &val);
+ if (ret) {
+ dev_err_probe(dev, ret,
+ "Failed to read the restart reason info\n");
+ return ret;
+ }
+
+ if (val == args[1])
+ wdt->wdd.bootstatus = WDIOF_CARDRESET;
+
+ return 0;
+}
+
static int qcom_wdt_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -273,8 +311,9 @@ static int qcom_wdt_probe(struct platform_device *pdev)
wdt->wdd.parent = dev;
wdt->layout = data->offset;
- if (readl(wdt_addr(wdt, WDT_STS)) & 1)
- wdt->wdd.bootstatus = WDIOF_CARDRESET;
+ ret = qcom_wdt_get_bootstatus(dev, wdt);
+ if (ret)
+ return ret;
/*
* If 'timeout-sec' unspecified in devicetree, assume a 30 second
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v5 5/5] arm64: dts: qcom: ipq5424: add support to get watchdog bootstatus from IMEM
2025-06-10 13:45 [PATCH v5 0/5] Add support to read the watchdog bootstatus from IMEM Kathiravan Thirumoorthy
` (3 preceding siblings ...)
2025-06-10 13:45 ` [PATCH v5 4/5] watchdog: qcom: add support to get the bootstatus from IMEM Kathiravan Thirumoorthy
@ 2025-06-10 13:45 ` Kathiravan Thirumoorthy
4 siblings, 0 replies; 12+ messages in thread
From: Kathiravan Thirumoorthy @ 2025-06-10 13:45 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
Konrad Dybcio, Wim Van Sebroeck, Guenter Roeck, Rajendra Nayak
Cc: linux-arm-msm, devicetree, linux-kernel, linux-watchdog,
Kathiravan Thirumoorthy
Add the "sram" property to the watchdog device node to enable
retrieval of the system restart reason from IMEM, populated by XBL.
Parse this information in the watchdog driver and update the bootstatus
sysFS if the restart was triggered by a watchdog timeout.
Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
---
Changes in v5:
- Rename the property 'qcom,imem' to 'sram'
Changes in v4:
- New patch
---
arch/arm64/boot/dts/qcom/ipq5424.dtsi | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/qcom/ipq5424.dtsi b/arch/arm64/boot/dts/qcom/ipq5424.dtsi
index 7fdc003f210e5a69944b00361a16fbdf58f39801..1d5f943b3aa6be1c1bb7b74d9d44c8e1755678a4 100644
--- a/arch/arm64/boot/dts/qcom/ipq5424.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5424.dtsi
@@ -485,6 +485,7 @@ watchdog@f410000 {
reg = <0 0x0f410000 0 0x1000>;
interrupts = <GIC_SPI 0 IRQ_TYPE_EDGE_RISING>;
clocks = <&sleep_clk>;
+ sram = <&imem 0x7b0 0x5>;
};
qusb_phy_1: phy@71000 {
@@ -591,7 +592,7 @@ ssphy_0: phy@7d000 {
status = "disabled";
};
- sram@8600000 {
+ imem: sram@8600000 {
compatible = "qcom,ipq5424-imem", "syscon", "simple-mfd";
reg = <0 0x08600000 0 0x1c000>;
ranges = <0 0 0x08600000 0x1c000>;
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v5 3/5] dt-bindings: watchdog: qcom-wdt: Document sram property
2025-06-10 13:45 ` [PATCH v5 3/5] dt-bindings: watchdog: qcom-wdt: Document sram property Kathiravan Thirumoorthy
@ 2025-06-10 16:36 ` Rob Herring (Arm)
2025-06-10 18:03 ` Rob Herring
1 sibling, 0 replies; 12+ messages in thread
From: Rob Herring (Arm) @ 2025-06-10 16:36 UTC (permalink / raw)
To: Kathiravan Thirumoorthy
Cc: Conor Dooley, Krzysztof Kozlowski, Wim Van Sebroeck,
Rajendra Nayak, linux-watchdog, linux-arm-msm, devicetree,
Guenter Roeck, linux-kernel, Bjorn Andersson, Konrad Dybcio
On Tue, 10 Jun 2025 19:15:19 +0530, Kathiravan Thirumoorthy wrote:
> Document the "sram" property for the watchdog device on Qualcomm
> IPQ platforms. Use this property to extract the restart reason from
> IMEM, which is updated by XBL. Populate the watchdog's bootstatus sysFS
> entry with this information, when the system reboots due to a watchdog
> timeout.
>
> Describe this property for the IPQ5424 watchdog device and extend support
> to other targets subsequently.
>
> Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
> ---
> Changes in v5:
> - Rename the property 'qcom,imem' to 'sram'
> Changes in v4:
> - New patch
> ---
> .../devicetree/bindings/watchdog/qcom-wdt.yaml | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/dma/stericsson,dma40.example.dtb: dma-controller@801c0000 (stericsson,db8500-dma40): sram:0: [4294967295, 4294967295] is too long
from schema $id: http://devicetree.org/schemas/dma/stericsson,dma40.yaml#
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20250610-wdt_reset_reason-v5-3-2d2835160ab5@oss.qualcomm.com
The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v5 3/5] dt-bindings: watchdog: qcom-wdt: Document sram property
2025-06-10 13:45 ` [PATCH v5 3/5] dt-bindings: watchdog: qcom-wdt: Document sram property Kathiravan Thirumoorthy
2025-06-10 16:36 ` Rob Herring (Arm)
@ 2025-06-10 18:03 ` Rob Herring
2025-06-16 5:18 ` Kathiravan Thirumoorthy
1 sibling, 1 reply; 12+ messages in thread
From: Rob Herring @ 2025-06-10 18:03 UTC (permalink / raw)
To: Kathiravan Thirumoorthy
Cc: Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
Wim Van Sebroeck, Guenter Roeck, Rajendra Nayak, linux-arm-msm,
devicetree, linux-kernel, linux-watchdog
On Tue, Jun 10, 2025 at 07:15:19PM +0530, Kathiravan Thirumoorthy wrote:
> Document the "sram" property for the watchdog device on Qualcomm
> IPQ platforms. Use this property to extract the restart reason from
> IMEM, which is updated by XBL. Populate the watchdog's bootstatus sysFS
> entry with this information, when the system reboots due to a watchdog
> timeout.
>
> Describe this property for the IPQ5424 watchdog device and extend support
> to other targets subsequently.
>
> Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
> ---
> Changes in v5:
> - Rename the property 'qcom,imem' to 'sram'
> Changes in v4:
> - New patch
> ---
> .../devicetree/bindings/watchdog/qcom-wdt.yaml | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> index 49e2b807db0bc9d3edfc93ec41ad0df0b74ed032..74a09c391fd8e2befeac07f254ea16d0ca362248 100644
> --- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
> @@ -81,6 +81,16 @@ properties:
> minItems: 1
> maxItems: 5
>
> + sram:
> + $ref: /schemas/types.yaml#/definitions/phandle-array
> + description:
> + phandle to the IMEM syscon node that exposes the system restart reason
> + items:
> + - items:
> + - description: phandle of IMEM syscon
> + - description: offset of restart reason region
> + - description: value indicate that the watchdog timeout has occurred
A 'sram' property points to an SRAM region (see mmio-sram binding), not
a syscon and offset.
The 'value' should be a separate property or implied by the compatible.
Rob
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v5 3/5] dt-bindings: watchdog: qcom-wdt: Document sram property
2025-06-10 18:03 ` Rob Herring
@ 2025-06-16 5:18 ` Kathiravan Thirumoorthy
2025-06-19 5:48 ` Kathiravan Thirumoorthy
0 siblings, 1 reply; 12+ messages in thread
From: Kathiravan Thirumoorthy @ 2025-06-16 5:18 UTC (permalink / raw)
To: Rob Herring
Cc: Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
Wim Van Sebroeck, Guenter Roeck, Rajendra Nayak, linux-arm-msm,
devicetree, linux-kernel, linux-watchdog
Thanks Rob for the review comments!
On 6/10/2025 11:33 PM, Rob Herring wrote:
> On Tue, Jun 10, 2025 at 07:15:19PM +0530, Kathiravan Thirumoorthy wrote:
>> Document the "sram" property for the watchdog device on Qualcomm
>> IPQ platforms. Use this property to extract the restart reason from
>> IMEM, which is updated by XBL. Populate the watchdog's bootstatus sysFS
>> entry with this information, when the system reboots due to a watchdog
>> timeout.
>>
>> Describe this property for the IPQ5424 watchdog device and extend support
>> to other targets subsequently.
>>
>> Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
>> ---
>> Changes in v5:
>> - Rename the property 'qcom,imem' to 'sram'
>> Changes in v4:
>> - New patch
>> ---
>> .../devicetree/bindings/watchdog/qcom-wdt.yaml | 20 ++++++++++++++++++++
>> 1 file changed, 20 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
>> index 49e2b807db0bc9d3edfc93ec41ad0df0b74ed032..74a09c391fd8e2befeac07f254ea16d0ca362248 100644
>> --- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
>> +++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
>> @@ -81,6 +81,16 @@ properties:
>> minItems: 1
>> maxItems: 5
>>
>> + sram:
>> + $ref: /schemas/types.yaml#/definitions/phandle-array
>> + description:
>> + phandle to the IMEM syscon node that exposes the system restart reason
>> + items:
>> + - items:
>> + - description: phandle of IMEM syscon
>> + - description: offset of restart reason region
>> + - description: value indicate that the watchdog timeout has occurred
> A 'sram' property points to an SRAM region (see mmio-sram binding), not
> a syscon and offset.
>
> The 'value' should be a separate property or implied by the compatible.
Sorry for the delay. It was a long weekend here!
Let me start with the requirement (Please feel free to skip it). When
the system goes for reboot, Xtensible Boot loader (XBL) find the cause
and update the particular offset (in this case it is 0x7b0) in the IMEM
region with the known values. On the next boot, if the system is
rebooted due to watchdog timeout, watchdog's bootstatus is updated
accordingly, which this series tries to address it.
Based on the previous review comments / discussions [1], it is decided
to go with the above approach, i.e., name the property to 'sram' and let
it points to the syscon region (IMEM) along with the offset to read and
what value to expect. So that we don't have to touch the driver if
either of the offset or the value changes across the platforms.
Currently, IMEM region (which is a on-chip SRAM) in the most of the QCOM
platforms are modeled as 'syscon' [2]. So I have followed the same
approach here as well. Should I describe the IMEM region as "sram"
(mmio-sram) instead of the "syscon" (existing approach) and retrieve
the offset and desired value from the compatible? or stick with existing
approach and name the property to something else? Could you guide me
here to proceed further?
[1]
https://lore.kernel.org/linux-arm-msm/20250519-wdt_reset_reason-v4-3-d59d21275c75@oss.qualcomm.com/#t
[2]
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/devicetree/bindings/sram/qcom,imem.yaml
Thanks,
Kathiravan T.
>
> Rob
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v5 3/5] dt-bindings: watchdog: qcom-wdt: Document sram property
2025-06-16 5:18 ` Kathiravan Thirumoorthy
@ 2025-06-19 5:48 ` Kathiravan Thirumoorthy
2025-07-14 14:51 ` Konrad Dybcio
0 siblings, 1 reply; 12+ messages in thread
From: Kathiravan Thirumoorthy @ 2025-06-19 5:48 UTC (permalink / raw)
To: Rob Herring
Cc: Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
Wim Van Sebroeck, Guenter Roeck, Rajendra Nayak, linux-arm-msm,
devicetree, linux-kernel, linux-watchdog
On 6/16/2025 10:48 AM, Kathiravan Thirumoorthy wrote:
> Thanks Rob for the review comments!
>
> On 6/10/2025 11:33 PM, Rob Herring wrote:
>> On Tue, Jun 10, 2025 at 07:15:19PM +0530, Kathiravan Thirumoorthy wrote:
>>> Document the "sram" property for the watchdog device on Qualcomm
>>> IPQ platforms. Use this property to extract the restart reason from
>>> IMEM, which is updated by XBL. Populate the watchdog's bootstatus sysFS
>>> entry with this information, when the system reboots due to a watchdog
>>> timeout.
>>>
>>> Describe this property for the IPQ5424 watchdog device and extend
>>> support
>>> to other targets subsequently.
>>>
>>> Signed-off-by: Kathiravan Thirumoorthy
>>> <kathiravan.thirumoorthy@oss.qualcomm.com>
>>> ---
>>> Changes in v5:
>>> - Rename the property 'qcom,imem' to 'sram'
>>> Changes in v4:
>>> - New patch
>>> ---
>>> .../devicetree/bindings/watchdog/qcom-wdt.yaml | 20
>>> ++++++++++++++++++++
>>> 1 file changed, 20 insertions(+)
>>>
>>> diff --git
>>> a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
>>> b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
>>> index
>>> 49e2b807db0bc9d3edfc93ec41ad0df0b74ed032..74a09c391fd8e2befeac07f254ea16d0ca362248
>>> 100644
>>> --- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
>>> +++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
>>> @@ -81,6 +81,16 @@ properties:
>>> minItems: 1
>>> maxItems: 5
>>> + sram:
>>> + $ref: /schemas/types.yaml#/definitions/phandle-array
>>> + description:
>>> + phandle to the IMEM syscon node that exposes the system
>>> restart reason
>>> + items:
>>> + - items:
>>> + - description: phandle of IMEM syscon
>>> + - description: offset of restart reason region
>>> + - description: value indicate that the watchdog timeout
>>> has occurred
>> A 'sram' property points to an SRAM region (see mmio-sram binding), not
>> a syscon and offset.
>>
>> The 'value' should be a separate property or implied by the compatible.
>
> Sorry for the delay. It was a long weekend here!
>
> Let me start with the requirement (Please feel free to skip it). When
> the system goes for reboot, Xtensible Boot loader (XBL) find the cause
> and update the particular offset (in this case it is 0x7b0) in the
> IMEM region with the known values. On the next boot, if the system is
> rebooted due to watchdog timeout, watchdog's bootstatus is updated
> accordingly, which this series tries to address it.
>
> Based on the previous review comments / discussions [1], it is decided
> to go with the above approach, i.e., name the property to 'sram' and
> let it points to the syscon region (IMEM) along with the offset to
> read and what value to expect. So that we don't have to touch the
> driver if either of the offset or the value changes across the platforms.
>
> Currently, IMEM region (which is a on-chip SRAM) in the most of the
> QCOM platforms are modeled as 'syscon' [2]. So I have followed the
> same approach here as well. Should I describe the IMEM region as
> "sram" (mmio-sram) instead of the "syscon" (existing approach) and
> retrieve the offset and desired value from the compatible? or stick
> with existing approach and name the property to something else? Could
> you guide me here to proceed further?
>
> [1]
> https://lore.kernel.org/linux-arm-msm/20250519-wdt_reset_reason-v4-3-d59d21275c75@oss.qualcomm.com/#t
>
> [2]
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/devicetree/bindings/sram/qcom,imem.yaml
Konrad,
The bootloader team confirmed that the IMEM offset and restart reason
value are fixed for the SoC's lifetime. Based on Rob’s suggestion, let’s
pull these values from the device data using the compatible string. Let
me know your thoughts.
Kathiravan T.
>
>
> Thanks,
>
> Kathiravan T.
>
>>
>> Rob
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v5 3/5] dt-bindings: watchdog: qcom-wdt: Document sram property
2025-06-19 5:48 ` Kathiravan Thirumoorthy
@ 2025-07-14 14:51 ` Konrad Dybcio
2025-07-22 4:16 ` Kathiravan Thirumoorthy
0 siblings, 1 reply; 12+ messages in thread
From: Konrad Dybcio @ 2025-07-14 14:51 UTC (permalink / raw)
To: Kathiravan Thirumoorthy, Rob Herring
Cc: Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
Wim Van Sebroeck, Guenter Roeck, Rajendra Nayak, linux-arm-msm,
devicetree, linux-kernel, linux-watchdog
On 6/19/25 7:48 AM, Kathiravan Thirumoorthy wrote:
>
> On 6/16/2025 10:48 AM, Kathiravan Thirumoorthy wrote:
>> Thanks Rob for the review comments!
>>
>> On 6/10/2025 11:33 PM, Rob Herring wrote:
>>> On Tue, Jun 10, 2025 at 07:15:19PM +0530, Kathiravan Thirumoorthy wrote:
>>>> Document the "sram" property for the watchdog device on Qualcomm
>>>> IPQ platforms. Use this property to extract the restart reason from
>>>> IMEM, which is updated by XBL. Populate the watchdog's bootstatus sysFS
>>>> entry with this information, when the system reboots due to a watchdog
>>>> timeout.
>>>>
>>>> Describe this property for the IPQ5424 watchdog device and extend support
>>>> to other targets subsequently.
>>>>
>>>> Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
>>>> ---
>>>> Changes in v5:
>>>> - Rename the property 'qcom,imem' to 'sram'
>>>> Changes in v4:
>>>> - New patch
>>>> ---
>>>> .../devicetree/bindings/watchdog/qcom-wdt.yaml | 20 ++++++++++++++++++++
>>>> 1 file changed, 20 insertions(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
>>>> index 49e2b807db0bc9d3edfc93ec41ad0df0b74ed032..74a09c391fd8e2befeac07f254ea16d0ca362248 100644
>>>> --- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
>>>> +++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
>>>> @@ -81,6 +81,16 @@ properties:
>>>> minItems: 1
>>>> maxItems: 5
>>>> + sram:
>>>> + $ref: /schemas/types.yaml#/definitions/phandle-array
>>>> + description:
>>>> + phandle to the IMEM syscon node that exposes the system restart reason
>>>> + items:
>>>> + - items:
>>>> + - description: phandle of IMEM syscon
>>>> + - description: offset of restart reason region
>>>> + - description: value indicate that the watchdog timeout has occurred
>>> A 'sram' property points to an SRAM region (see mmio-sram binding), not
>>> a syscon and offset.
>>>
>>> The 'value' should be a separate property or implied by the compatible.
>>
>> Sorry for the delay. It was a long weekend here!
>>
>> Let me start with the requirement (Please feel free to skip it). When the system goes for reboot, Xtensible Boot loader (XBL) find the cause and update the particular offset (in this case it is 0x7b0) in the IMEM region with the known values. On the next boot, if the system is rebooted due to watchdog timeout, watchdog's bootstatus is updated accordingly, which this series tries to address it.
>>
>> Based on the previous review comments / discussions [1], it is decided to go with the above approach, i.e., name the property to 'sram' and let it points to the syscon region (IMEM) along with the offset to read and what value to expect. So that we don't have to touch the driver if either of the offset or the value changes across the platforms.
>>
>> Currently, IMEM region (which is a on-chip SRAM) in the most of the QCOM platforms are modeled as 'syscon' [2]. So I have followed the same approach here as well. Should I describe the IMEM region as "sram" (mmio-sram) instead of the "syscon" (existing approach) and retrieve the offset and desired value from the compatible? or stick with existing approach and name the property to something else? Could you guide me here to proceed further?
>>
>> [1] https://lore.kernel.org/linux-arm-msm/20250519-wdt_reset_reason-v4-3-d59d21275c75@oss.qualcomm.com/#t
>>
>> [2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/devicetree/bindings/sram/qcom,imem.yaml
>
> Konrad,
>
> The bootloader team confirmed that the IMEM offset and restart reason value are fixed for the SoC's lifetime. Based on Rob’s suggestion, let’s pull these values from the device data using the compatible string. Let me know your thoughts.
>
> Kathiravan T.
So I'm not sure whether I proposed this before, but this is how I solved a
parallel problem for IPA, also consuming a slice of IMEM:
https://lore.kernel.org/all/20250527-topic-ipa_imem-v2-0-6d1aad91b841@oss.qualcomm.com/
Konrad
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v5 3/5] dt-bindings: watchdog: qcom-wdt: Document sram property
2025-07-14 14:51 ` Konrad Dybcio
@ 2025-07-22 4:16 ` Kathiravan Thirumoorthy
0 siblings, 0 replies; 12+ messages in thread
From: Kathiravan Thirumoorthy @ 2025-07-22 4:16 UTC (permalink / raw)
To: Konrad Dybcio, Rob Herring
Cc: Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson, Konrad Dybcio,
Wim Van Sebroeck, Guenter Roeck, Rajendra Nayak, linux-arm-msm,
devicetree, linux-kernel, linux-watchdog
On 7/14/2025 8:21 PM, Konrad Dybcio wrote:
> On 6/19/25 7:48 AM, Kathiravan Thirumoorthy wrote:
>> On 6/16/2025 10:48 AM, Kathiravan Thirumoorthy wrote:
>>> Thanks Rob for the review comments!
>>>
>>> On 6/10/2025 11:33 PM, Rob Herring wrote:
>>>> On Tue, Jun 10, 2025 at 07:15:19PM +0530, Kathiravan Thirumoorthy wrote:
>>>>> Document the "sram" property for the watchdog device on Qualcomm
>>>>> IPQ platforms. Use this property to extract the restart reason from
>>>>> IMEM, which is updated by XBL. Populate the watchdog's bootstatus sysFS
>>>>> entry with this information, when the system reboots due to a watchdog
>>>>> timeout.
>>>>>
>>>>> Describe this property for the IPQ5424 watchdog device and extend support
>>>>> to other targets subsequently.
>>>>>
>>>>> Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
>>>>> ---
>>>>> Changes in v5:
>>>>> - Rename the property 'qcom,imem' to 'sram'
>>>>> Changes in v4:
>>>>> - New patch
>>>>> ---
>>>>> .../devicetree/bindings/watchdog/qcom-wdt.yaml | 20 ++++++++++++++++++++
>>>>> 1 file changed, 20 insertions(+)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
>>>>> index 49e2b807db0bc9d3edfc93ec41ad0df0b74ed032..74a09c391fd8e2befeac07f254ea16d0ca362248 100644
>>>>> --- a/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
>>>>> +++ b/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
>>>>> @@ -81,6 +81,16 @@ properties:
>>>>> minItems: 1
>>>>> maxItems: 5
>>>>> + sram:
>>>>> + $ref: /schemas/types.yaml#/definitions/phandle-array
>>>>> + description:
>>>>> + phandle to the IMEM syscon node that exposes the system restart reason
>>>>> + items:
>>>>> + - items:
>>>>> + - description: phandle of IMEM syscon
>>>>> + - description: offset of restart reason region
>>>>> + - description: value indicate that the watchdog timeout has occurred
>>>> A 'sram' property points to an SRAM region (see mmio-sram binding), not
>>>> a syscon and offset.
>>>>
>>>> The 'value' should be a separate property or implied by the compatible.
>>> Sorry for the delay. It was a long weekend here!
>>>
>>> Let me start with the requirement (Please feel free to skip it). When the system goes for reboot, Xtensible Boot loader (XBL) find the cause and update the particular offset (in this case it is 0x7b0) in the IMEM region with the known values. On the next boot, if the system is rebooted due to watchdog timeout, watchdog's bootstatus is updated accordingly, which this series tries to address it.
>>>
>>> Based on the previous review comments / discussions [1], it is decided to go with the above approach, i.e., name the property to 'sram' and let it points to the syscon region (IMEM) along with the offset to read and what value to expect. So that we don't have to touch the driver if either of the offset or the value changes across the platforms.
>>>
>>> Currently, IMEM region (which is a on-chip SRAM) in the most of the QCOM platforms are modeled as 'syscon' [2]. So I have followed the same approach here as well. Should I describe the IMEM region as "sram" (mmio-sram) instead of the "syscon" (existing approach) and retrieve the offset and desired value from the compatible? or stick with existing approach and name the property to something else? Could you guide me here to proceed further?
>>>
>>> [1] https://lore.kernel.org/linux-arm-msm/20250519-wdt_reset_reason-v4-3-d59d21275c75@oss.qualcomm.com/#t
>>>
>>> [2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/devicetree/bindings/sram/qcom,imem.yaml
>> Konrad,
>>
>> The bootloader team confirmed that the IMEM offset and restart reason value are fixed for the SoC's lifetime. Based on Rob’s suggestion, let’s pull these values from the device data using the compatible string. Let me know your thoughts.
>>
>> Kathiravan T.
> So I'm not sure whether I proposed this before, but this is how I solved a
> parallel problem for IPA, also consuming a slice of IMEM:
>
> https://lore.kernel.org/all/20250527-topic-ipa_imem-v2-0-6d1aad91b841@oss.qualcomm.com/
Yeah thanks for pointing it out. But based on the recent comments from
Krzysztof, I'm more inclined towards describing IMEM as syscon but not
MFD and let the consumers to fetch the required information from the
device data. Please let me know if you think otherwise.
>
> Konrad
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-07-22 4:16 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-10 13:45 [PATCH v5 0/5] Add support to read the watchdog bootstatus from IMEM Kathiravan Thirumoorthy
2025-06-10 13:45 ` [PATCH v5 1/5] dt-bindings: sram: qcom,imem: Document IPQ5424 compatible Kathiravan Thirumoorthy
2025-06-10 13:45 ` [PATCH v5 2/5] arm64: dts: qcom: ipq5424: Add the IMEM node Kathiravan Thirumoorthy
2025-06-10 13:45 ` [PATCH v5 3/5] dt-bindings: watchdog: qcom-wdt: Document sram property Kathiravan Thirumoorthy
2025-06-10 16:36 ` Rob Herring (Arm)
2025-06-10 18:03 ` Rob Herring
2025-06-16 5:18 ` Kathiravan Thirumoorthy
2025-06-19 5:48 ` Kathiravan Thirumoorthy
2025-07-14 14:51 ` Konrad Dybcio
2025-07-22 4:16 ` Kathiravan Thirumoorthy
2025-06-10 13:45 ` [PATCH v5 4/5] watchdog: qcom: add support to get the bootstatus from IMEM Kathiravan Thirumoorthy
2025-06-10 13:45 ` [PATCH v5 5/5] arm64: dts: qcom: ipq5424: add support to get watchdog " Kathiravan Thirumoorthy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).