2023-01-30 17:02:25

by Kathiravan Thirumoorthy

[permalink] [raw]
Subject: [PATCH 0/3] 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 intialized 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]/T/#t

Kathiravan T (3):
dt-bindings: mfd: qcom,tcsr: add compatible for IPQ5332
arm64: dts: qcom: ipq5332: enable the download mode support
arm64: dts: qcom: ipq5332: add SMEM support

.../devicetree/bindings/mfd/qcom,tcsr.yaml | 1 +
arch/arm64/boot/dts/qcom/ipq5332.dtsi | 20 +++++++++++++++++++
2 files changed, 21 insertions(+)

--
2.17.1



2023-01-30 17:02:30

by Kathiravan Thirumoorthy

[permalink] [raw]
Subject: [PATCH 1/3] dt-bindings: mfd: qcom,tcsr: add compatible for IPQ5332

Document the qcom,tcsr-ipq5332 compatible.

Signed-off-by: Kathiravan T <[email protected]>
---
Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml b/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml
index d463fb47278f..2eeebe920e6e 100644
--- a/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml
+++ b/Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml
@@ -28,6 +28,7 @@ properties:
- qcom,sm8150-tcsr
- qcom,tcsr-apq8064
- qcom,tcsr-apq8084
+ - qcom,tcsr-ipq5332
- qcom,tcsr-ipq6018
- qcom,tcsr-ipq8064
- qcom,tcsr-mdm9615
--
2.17.1


2023-01-30 17:02:39

by Kathiravan Thirumoorthy

[permalink] [raw]
Subject: [PATCH 2/3] 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]>
---
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 7f0ba2ec339c..6a1d0cc927ef 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 0x0>;
};
};

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

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


2023-01-30 17:02:41

by Kathiravan Thirumoorthy

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

add SMEM support by adding required nodes.

Signed-off-by: Kathiravan T <[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 6a1d0cc927ef..17f30118f9fd 100644
--- a/arch/arm64/boot/dts/qcom/ipq5332.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
@@ -99,6 +99,14 @@
no-map;
reg = <0x0 0x4a600000 0x0 0x200000>;
};
+
+ 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@193d100 {
compatible = "qcom,tcsr-ipq5332", "syscon";
reg = <0x0193d100 0x4>;
--
2.17.1


2023-01-31 09:25:00

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: mfd: qcom,tcsr: add compatible for IPQ5332

On Mon, 30 Jan 2023, Kathiravan T wrote:

> Document the qcom,tcsr-ipq5332 compatible.
>
> Signed-off-by: Kathiravan T <[email protected]>
> ---
> Documentation/devicetree/bindings/mfd/qcom,tcsr.yaml | 1 +
> 1 file changed, 1 insertion(+)

Applied, thanks

--
Lee Jones [李琼斯]

2023-02-08 23:34:48

by Bjorn Andersson

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

On Mon, Jan 30, 2023 at 10:31:54PM +0530, Kathiravan T wrote:
> 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]>
> ---
> 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 7f0ba2ec339c..6a1d0cc927ef 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 0x0>;
> };
> };
>
> @@ -142,6 +143,11 @@
> <0>;
> };
>
> + tcsr: syscon@193d100 {
> + compatible = "qcom,tcsr-ipq5332", "syscon";
> + reg = <0x0193d100 0x4>;

Please map the entire TCSR_REGS here, and use qcom,dload-mode to encode
the offset within this.

Thanks,
Bjorn

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

2023-02-09 15:05:02

by Kathiravan Thirumoorthy

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


On 2/9/2023 5:06 AM, Bjorn Andersson wrote:
> On Mon, Jan 30, 2023 at 10:31:54PM +0530, Kathiravan T wrote:
>> 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]>
>> ---
>> 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 7f0ba2ec339c..6a1d0cc927ef 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 0x0>;
>> };
>> };
>>
>> @@ -142,6 +143,11 @@
>> <0>;
>> };
>>
>> + tcsr: syscon@193d100 {
>> + compatible = "qcom,tcsr-ipq5332", "syscon";
>> + reg = <0x0193d100 0x4>;
> Please map the entire TCSR_REGS here, and use qcom,dload-mode to encode
> the offset within this.


Sure, will fix it in V2.


>
> Thanks,
> Bjorn
>
>> + };
>> +
>> sdhc: mmc@7804000 {
>> compatible = "qcom,ipq5332-sdhci", "qcom,sdhci-msm-v5";
>> reg = <0x07804000 0x1000>, <0x07805000 0x1000>;
>> --
>> 2.17.1
>>