Devicetree
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Add support for reporting boot status on Qualcomm IPQ9574 and IPQ5332
@ 2026-10-19 16:46 Kathiravan Thirumoorthy
  2026-10-19 16:46 ` [PATCH v3 1/3] dt-bindings: sram: Document IMEM found in Qualcomm's " Kathiravan Thirumoorthy
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Kathiravan Thirumoorthy @ 2026-10-19 16:46 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
	Konrad Dybcio, Abel Vesa
  Cc: devicetree, linux-kernel, linux-arm-msm, Kathiravan Thirumoorthy,
	Krzysztof Kozlowski

Similar to IPQ5424, add the IMEM node and the restart-reason child node
on IPQ9574 and IPQ5332 to enable reporting of watchdog boot status.

Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
---
Changes in v3:
- Picked the A-b tag
- Squashed 2/5, 3/5 and 4/5, 5/5 into one to match with the schema
  definition
- Link to v2: https://patch.msgid.link/20261002-imem_restart_reason-v2-0-61703c6362e3@oss.qualcomm.com

Changes in v2:
- Placed the compatibles in alphabetical order
- Fixed the unit-address in the restartreason-sram node in 4/5 and 5/5
- Link to v1: https://patch.msgid.link/20261001-imem_restart_reason-v1-0-79f516906010@oss.qualcomm.com

To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
To: Bjorn Andersson <andersson@kernel.org>
To: Konrad Dybcio <konradybcio@kernel.org>
To: Abel Vesa <abelvesa@kernel.org>
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org

---
Kathiravan Thirumoorthy (3):
      dt-bindings: sram: Document IMEM found in Qualcomm's IPQ9574 and IPQ5332
      arm64: dts: qcom: ipq9574: add support to get watchdog bootstatus from IMEM
      arm64: dts: qcom: ipq5332: add support to get watchdog bootstatus from IMEM

 Documentation/devicetree/bindings/sram/sram.yaml |  2 ++
 arch/arm64/boot/dts/qcom/ipq5332.dtsi            | 16 ++++++++++++++++
 arch/arm64/boot/dts/qcom/ipq9574.dtsi            | 16 ++++++++++++++++
 3 files changed, 34 insertions(+)
---
base-commit: 2efb7a11f1aa4d2dc285fe2680cca22cb9f72f64
change-id: 20260929-imem_restart_reason-15c5b95f9a5a

Best regards,
--  
Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3 1/3] dt-bindings: sram: Document IMEM found in Qualcomm's IPQ9574 and IPQ5332
  2026-10-19 16:46 [PATCH v3 0/3] Add support for reporting boot status on Qualcomm IPQ9574 and IPQ5332 Kathiravan Thirumoorthy
@ 2026-10-19 16:46 ` Kathiravan Thirumoorthy
  2026-10-19 16:46 ` [PATCH v3 2/3] arm64: dts: qcom: ipq9574: add support to get watchdog bootstatus from IMEM Kathiravan Thirumoorthy
  2026-10-19 16:46 ` [PATCH v3 3/3] arm64: dts: qcom: ipq5332: " Kathiravan Thirumoorthy
  2 siblings, 0 replies; 5+ messages in thread
From: Kathiravan Thirumoorthy @ 2026-10-19 16:46 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
	Konrad Dybcio, Abel Vesa
  Cc: devicetree, linux-kernel, linux-arm-msm, Kathiravan Thirumoorthy,
	Krzysztof Kozlowski

Document the compatibles for the IMEM found in the Qualcomm's IPQ9574
and IPQ5332 SoCs.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
---
 Documentation/devicetree/bindings/sram/sram.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/sram/sram.yaml b/Documentation/devicetree/bindings/sram/sram.yaml
index 6ee0b1464722..b09a70b3d576 100644
--- a/Documentation/devicetree/bindings/sram/sram.yaml
+++ b/Documentation/devicetree/bindings/sram/sram.yaml
@@ -37,7 +37,9 @@ properties:
         - qcom,eliza-imem
         - qcom,glymur-imem
         - qcom,hawi-imem
+        - qcom,ipq5332-imem
         - qcom,ipq5424-imem
+        - qcom,ipq9574-imem
         - qcom,kaanapali-imem
         - qcom,maili-imem
         - qcom,milos-imem

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v3 2/3] arm64: dts: qcom: ipq9574: add support to get watchdog bootstatus from IMEM
  2026-10-19 16:46 [PATCH v3 0/3] Add support for reporting boot status on Qualcomm IPQ9574 and IPQ5332 Kathiravan Thirumoorthy
  2026-10-19 16:46 ` [PATCH v3 1/3] dt-bindings: sram: Document IMEM found in Qualcomm's " Kathiravan Thirumoorthy
@ 2026-10-19 16:46 ` Kathiravan Thirumoorthy
  2026-10-19 16:46 ` [PATCH v3 3/3] arm64: dts: qcom: ipq5332: " Kathiravan Thirumoorthy
  2 siblings, 0 replies; 5+ messages in thread
From: Kathiravan Thirumoorthy @ 2026-10-19 16:46 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
	Konrad Dybcio, Abel Vesa
  Cc: devicetree, linux-kernel, linux-arm-msm, 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.

To achieve this, add the IMEM node. The overall IMEM region is 32KB but
only initial 4KB is accessible by all masters in the SoC.

Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
---
 arch/arm64/boot/dts/qcom/ipq9574.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
index 771a59585645..e1908f01851d 100644
--- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
@@ -757,6 +757,21 @@ usb_0_qmpphy: phy@7d000 {
 			status = "disabled";
 		};
 
+		sram@8600000 {
+			compatible = "qcom,ipq9574-imem", "mmio-sram";
+			reg = <0x08600000 0x8000>;
+			ranges = <0 0x08600000 0x8000>;
+
+			no-memory-wc;
+
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			restart_reason: restartreason-sram@7a4 {
+				reg = <0x7a4 0x4>;
+			};
+		};
+
 		usb3: usb@8af8800 {
 			compatible = "qcom,ipq9574-dwc3", "qcom,dwc3";
 			reg = <0x08af8800 0x400>;
@@ -847,6 +862,7 @@ watchdog: watchdog@b017000 {
 			interrupts = <GIC_SPI 3 IRQ_TYPE_EDGE_RISING>;
 			clocks = <&sleep_clk>;
 			timeout-sec = <30>;
+			sram = <&restart_reason>;
 		};
 
 		apcs_glb: mailbox@b111000 {

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v3 3/3] arm64: dts: qcom: ipq5332: add support to get watchdog bootstatus from IMEM
  2026-10-19 16:46 [PATCH v3 0/3] Add support for reporting boot status on Qualcomm IPQ9574 and IPQ5332 Kathiravan Thirumoorthy
  2026-10-19 16:46 ` [PATCH v3 1/3] dt-bindings: sram: Document IMEM found in Qualcomm's " Kathiravan Thirumoorthy
  2026-10-19 16:46 ` [PATCH v3 2/3] arm64: dts: qcom: ipq9574: add support to get watchdog bootstatus from IMEM Kathiravan Thirumoorthy
@ 2026-10-19 16:46 ` Kathiravan Thirumoorthy
  2026-10-19 16:57   ` sashiko-bot
  2 siblings, 1 reply; 5+ messages in thread
From: Kathiravan Thirumoorthy @ 2026-10-19 16:46 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
	Konrad Dybcio, Abel Vesa
  Cc: devicetree, linux-kernel, linux-arm-msm, 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.

To achieve this, add the IMEM node. The overall IMEM region is 32KB but
only initial 4KB is accessible by all masters in the SoC.

Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>
---
 arch/arm64/boot/dts/qcom/ipq5332.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/ipq5332.dtsi b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
index 74d9de8d7641..c1b083624696 100644
--- a/arch/arm64/boot/dts/qcom/ipq5332.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
@@ -493,6 +493,21 @@ qpic_nand: spi@79b0000 {
 			status = "disabled";
 		};
 
+		sram@8600000 {
+			compatible = "qcom,ipq5332-imem", "mmio-sram";
+			reg = <0x08600000 0x14000>;
+			ranges = <0 0x08600000 0x14000>;
+
+			no-memory-wc;
+
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			restart_reason: restartreason-sram@7a4 {
+				reg = <0x7a4 0x4>;
+			};
+		};
+
 		usb: usb@8af8800 {
 			compatible = "qcom,ipq5332-dwc3", "qcom,dwc3";
 			reg = <0x08af8800 0x400>;
@@ -578,6 +593,7 @@ watchdog: watchdog@b017000 {
 			interrupts = <GIC_SPI 3 IRQ_TYPE_EDGE_RISING>;
 			clocks = <&sleep_clk>;
 			timeout-sec = <30>;
+			sram = <&restart_reason>;
 		};
 
 		apcs_glb: mailbox@b111000 {

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 3/3] arm64: dts: qcom: ipq5332: add support to get watchdog bootstatus from IMEM
  2026-10-19 16:46 ` [PATCH v3 3/3] arm64: dts: qcom: ipq5332: " Kathiravan Thirumoorthy
@ 2026-10-19 16:57   ` sashiko-bot
  0 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-10-19 16:57 UTC (permalink / raw)
  To: Kathiravan Thirumoorthy; +Cc: devicetree, robh, conor+dt

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] arm64: dts: qcom: ipq5332: sram@8600000 size 0x14000 mismatches IMEM bounds
--

commit 353fa282f26f76cd09b02c6b70d1605ceadf060b
Author: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com>

arm64: dts: qcom: ipq5332: add support to get watchdog bootstatus from IMEM

This commit adds the sram@8600000 IMEM node and links the restart_reason
subnode to the watchdog node via the sram property on IPQ5332 so the
watchdog driver can read the system restart reason populated by XBL.

> diff --git a/arch/arm64/boot/dts/qcom/ipq5332.dtsi b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
> index 74d9de8d7641d..c1b0836246964 100644
> --- a/arch/arm64/boot/dts/qcom/ipq5332.dtsi
> +++ b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
> @@ -493,6 +493,21 @@ qpic_nand: spi@79b0000 {
>  			status = "disabled";
>  		};
>  
> +		sram@8600000 {
> +			compatible = "qcom,ipq5332-imem", "mmio-sram";
> +			reg = <0x08600000 0x14000>;
> +			ranges = <0 0x08600000 0x14000>;

[Severity: Medium]
Should the reg and ranges size in sram@8600000 be 0x1000 (or 0x8000 with
the inaccessible portion reserved) rather than 0x14000?

The commit message notes:

    The overall IMEM region is 32KB but only initial 4KB is accessible by
    all masters in the SoC.

However, sram@8600000 in arch/arm64/boot/dts/qcom/ipq5332.dtsi specifies
0x14000 (80KB), which matches neither the 32KB (0x8000) total IMEM size
nor the 4KB (0x1000) accessible window.

When the mmio-sram driver probes sram@8600000 via
sram_probe()->sram_reserve_regions() in drivers/misc/sram.c, it maps the
entire reg range and adds all unreserved chunks ([0x0, 0x7a4) and
[0x7a8, 0x14000)) into the general-purpose SRAM allocation pool:

drivers/misc/sram.c:sram_reserve_regions() {
    ...
		if (sram->pool) {
			dev_dbg(sram->dev, "adding chunk 0x%lx-0x%lx\n",
				cur_start, cur_start + cur_size);

			ret = gen_pool_add_virt(sram->pool,
					(unsigned long)sram->virt_base + cur_start,
					res->start + cur_start, cur_size, -1);
    ...
}

If the hardware IMEM is only 32KB or access-protected beyond the initial
4KB window, won't exposing offsets [0x1000, 0x14000) as allocatable SRAM
risk bus aborts or access violations if any consumer allocates from the
pool?

> +
> +			no-memory-wc;
> +
> +			#address-cells = <1>;
> +			#size-cells = <1>;
> +
> +			restart_reason: restartreason-sram@7a4 {
> +				reg = <0x7a4 0x4>;
> +			};
> +		};
[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261019-imem_restart_reason-v3-0-e6b1ff5de841@oss.qualcomm.com?part=3

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-10-19 16:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-19 16:46 [PATCH v3 0/3] Add support for reporting boot status on Qualcomm IPQ9574 and IPQ5332 Kathiravan Thirumoorthy
2026-10-19 16:46 ` [PATCH v3 1/3] dt-bindings: sram: Document IMEM found in Qualcomm's " Kathiravan Thirumoorthy
2026-10-19 16:46 ` [PATCH v3 2/3] arm64: dts: qcom: ipq9574: add support to get watchdog bootstatus from IMEM Kathiravan Thirumoorthy
2026-10-19 16:46 ` [PATCH v3 3/3] arm64: dts: qcom: ipq5332: " Kathiravan Thirumoorthy
2026-10-19 16:57   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox