2023-02-10 06:04:31

by Kathiravan Thirumoorthy

[permalink] [raw]
Subject: [PATCH V2 0/2] Add the download mode support for IPQ5332

Enable the support for download mode to collect the RAM dumps if
system crashes, to perform the post mortem analysis.

During the bootup, bootloaders initialize the SMEM. However the bootup
after crash, SMEM will not be initialized again. If the memory for the
SMEM is not reserved, linux consumes that region, which leads to the
loss of SMEM data. So, during the next bootup after crash, bootloaders
will hang due to invalid data present in the SMEM region. Due to this,
added the SMEM support along with this series.

This series depends on the IPQ5332 baseport patches
https://lore.kernel.org/linux-arm-msm/[email protected]/

Changes in V2:
- Dropped the qcom,tcsr binding patch, since it is part of
linux-next/master

Kathiravan T (2):
arm64: dts: qcom: ipq5332: enable the download mode support
arm64: dts: qcom: ipq5332: add SMEM support

arch/arm64/boot/dts/qcom/ipq5332.dtsi | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

--
2.17.1



2023-02-10 06:04:37

by Kathiravan Thirumoorthy

[permalink] [raw]
Subject: [PATCH V2 1/2] arm64: dts: qcom: ipq5332: enable the download mode support

Enable the support for download mode to collect the RAM dumps if
system crashes, to perform the post mortem analysis.

Signed-off-by: Kathiravan T <[email protected]>
---
Changes in V2:
- Mapped the entire TCSR_REGS region and updated the offset in
qcom,dload-mode property

arch/arm64/boot/dts/qcom/ipq5332.dtsi | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/ipq5332.dtsi b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
index bdf33ef30e10..ad6481dd57ba 100644
--- a/arch/arm64/boot/dts/qcom/ipq5332.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
@@ -70,6 +70,7 @@
firmware {
scm {
compatible = "qcom,scm-ipq5332", "qcom,scm";
+ qcom,dload-mode = <&tcsr 0x6100>;
};
};

@@ -142,6 +143,11 @@
<0>;
};

+ tcsr: syscon@1937000 {
+ compatible = "qcom,tcsr-ipq5332", "syscon";
+ reg = <0x01937000 0x21000>;
+ };
+
sdhc: mmc@7804000 {
compatible = "qcom,ipq5332-sdhci", "qcom,sdhci-msm-v5";
reg = <0x07804000 0x1000>, <0x07805000 0x1000>;
--
2.17.1


2023-02-10 06:04:39

by Kathiravan Thirumoorthy

[permalink] [raw]
Subject: [PATCH V2 2/2] arm64: dts: qcom: ipq5332: add SMEM support

Add SMEM support by adding required nodes.

Signed-off-by: Kathiravan T <[email protected]>
---
Changes in V2:
- Rebased on V4 series of baseport patches
https://lore.kernel.org/linux-arm-msm/[email protected]/

arch/arm64/boot/dts/qcom/ipq5332.dtsi | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/ipq5332.dtsi b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
index ad6481dd57ba..0eaf6a5a3da6 100644
--- a/arch/arm64/boot/dts/qcom/ipq5332.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
@@ -99,6 +99,14 @@
reg = <0x0 0x4a600000 0x0 0x200000>;
no-map;
};
+
+ smem@4a800000 {
+ compatible = "qcom,smem";
+ reg = <0x0 0x4a800000 0x0 0x00100000>;
+ no-map;
+
+ hwlocks = <&tcsr_mutex 0>;
+ };
};

soc@0 {
@@ -143,6 +151,12 @@
<0>;
};

+ tcsr_mutex: hwlock@1905000 {
+ compatible = "qcom,tcsr-mutex";
+ reg = <0x01905000 0x20000>;
+ #hwlock-cells = <1>;
+ };
+
tcsr: syscon@1937000 {
compatible = "qcom,tcsr-ipq5332", "syscon";
reg = <0x01937000 0x21000>;
--
2.17.1


2023-03-15 23:36:08

by Bjorn Andersson

[permalink] [raw]
Subject: Re: (subset) [PATCH V2 0/2] Add the download mode support for IPQ5332

On Fri, 10 Feb 2023 11:33:59 +0530, Kathiravan T wrote:
> Enable the support for download mode to collect the RAM dumps if
> system crashes, to perform the post mortem analysis.
>
> During the bootup, bootloaders initialize the SMEM. However the bootup
> after crash, SMEM will not be initialized again. If the memory for the
> SMEM is not reserved, linux consumes that region, which leads to the
> loss of SMEM data. So, during the next bootup after crash, bootloaders
> will hang due to invalid data present in the SMEM region. Due to this,
> added the SMEM support along with this series.
>
> [...]

Applied, thanks!

[1/2] arm64: dts: qcom: ipq5332: enable the download mode support
commit: ed32155302fc3e5b8d30c51b95666e844f1449e1
[2/2] arm64: dts: qcom: ipq5332: add SMEM support
commit: d56dd7f935e125244bc15f5a0a9e68cdb0ec87ca

Best regards,
--
Bjorn Andersson <[email protected]>