Skip to contentSkip to conversation

arm64: dts: qcom: Add SDM845 SMEM nodes

PATCH Superseded Sibi Sankar 2 participants 3 messages Apr 25, 2018 – Apr 26, 2018

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: dts: qcom: Add SDM845 SMEM nodes

Add all the necessary dt nodes to support SMEM driver on SDM845. It also adds the required memory carveouts so that the kernel does not access memory that is in use.

---

This patch depends on:
https://patchwork.kernel.org/patch/10276419/
https://patchwork.kernel.org/patch/10363361/

 arch/arm64/boot/dts/qcom/sdm845.dtsi | 38 ++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
arch/arm64/boot/dts/qcom/sdm845.dtsi +38 -0
index 9be763da0664..bea985045759 100644
@@ -21,6 +21,27 @@
 		reg = <0 0x80000000 0 0>;
 	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		memory@85fc0000 {
+			reg = <0 0x85fc0000 0 0x40000>;
+			no-map;
+		};
+
+		smem_mem: smem-mem@86000000 {
+			reg = <0x0 0x86000000 0x0 0x200000>;
+			no-map;
+		};
+
+		memory@86000000 {
+			reg = <0 0x86200000 0 0x2d00000>;
+			no-map;
+		};
+	};
+
 	cpus {
 		#address-cells = <2>;
 		#size-cells = <0>;
@@ -147,6 +168,18 @@
 		};
 	};
 
+	tcsr_mutex: hwlock {
+		compatible = "qcom,tcsr-mutex";
+		syscon = <&tcsr_mutex_regs 0 0x1000>;
+		#hwlock-cells = <1>;
+	};
+
+	smem {
+		compatible = "qcom,smem";
+		memory-region = <&smem_mem>;
+		hwlocks = <&tcsr_mutex 3>;
+	};
+
 	psci {
 		compatible = "arm,psci-1.0";
 		method = "smc";
@@ -339,6 +372,11 @@
 			};
 		};
 
+		tcsr_mutex_regs: syscon@1f40000 {
+			compatible = "syscon";
+			reg = <0x1f40000 0x40000>;
+		};
+
 		apss_shared: mailbox@17990000 {
 			compatible = "qcom,sdm845-apss-shared";
 			reg = <0x17990000 0x1000>;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#1 lore raw
Quoted 5 lines · Sibi Sankar
arch/arm64/boot/dts/qcom/sdm845.dtsi +0 -0
index 9be763da0664..bea985045759 100644

arch/arm64/boot/dts/qcom/sdm845.dtsi line 30

Quoted 10 lines
arch/arm64/boot/dts/qcom/sdm845.dtsi +7 -0
@@ -21,6 +21,27 @@
 		reg = <0 0x80000000 0 0>;
 	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		memory@85fc0000 {
+			reg = <0 0x85fc0000 0 0x40000>;

The region 0x85fe0000 + 0x20000 seems to be command db, which should be described on its own. So please reduce the size to 0x20000.

arch/arm64/boot/dts/qcom/sdm845.dtsi line 34

Quoted 4 lines
arch/arm64/boot/dts/qcom/sdm845.dtsi +4 -0
+			no-map;
+		};
+
+		smem_mem: smem-mem@86000000 {

smem_mem: memory@86000000 ?

arch/arm64/boot/dts/qcom/sdm845.dtsi line 39

Quoted 5 lines
arch/arm64/boot/dts/qcom/sdm845.dtsi +5 -0
+			reg = <0x0 0x86000000 0x0 0x200000>;
+			no-map;
+		};
+
+		memory@86000000 {

memory@86200000

arch/arm64/boot/dts/qcom/sdm845.dtsi line 44

Quoted 5 lines
arch/arm64/boot/dts/qcom/sdm845.dtsi +5 -0
+			reg = <0 0x86200000 0 0x2d00000>;
+			no-map;
+		};
+	};
+

The rest looks good.

Regards,
Bjorn

author
#2 lore raw

Hi Bjorn,

Thanks for the review

Quoted 20 lines · Bjorn Andersson
Quoted 5 lines · Sibi Sankar
arch/arm64/boot/dts/qcom/sdm845.dtsi +0 -0
index 9be763da0664..bea985045759 100644

arch/arm64/boot/dts/qcom/sdm845.dtsi line 30

Quoted 10 lines
arch/arm64/boot/dts/qcom/sdm845.dtsi +7 -0
@@ -21,6 +21,27 @@
  		reg = <0 0x80000000 0 0>;
  	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		memory@85fc0000 {
+			reg = <0 0x85fc0000 0 0x40000>;

The region 0x85fe0000 + 0x20000 seems to be command db, which should be described on its own. So please reduce the size to 0x20000.

Quoted 6 lines

arch/arm64/boot/dts/qcom/sdm845.dtsi line 34

Quoted 4 lines
arch/arm64/boot/dts/qcom/sdm845.dtsi +4 -0
+			no-map;
+		};
+
+		smem_mem: smem-mem@86000000 {

smem_mem: memory@86000000 ?

Should I update kernel docs as well to say all nodes should have memory has default name? Just followed what was done in msm8916 and msm8996.

Quoted 20 lines

arch/arm64/boot/dts/qcom/sdm845.dtsi line 39

Quoted 6 lines
arch/arm64/boot/dts/qcom/sdm845.dtsi +5 -0
+			reg = <0x0 0x86000000 0x0 0x200000>;
+			no-map;
+		};
+
+		memory@86000000 {

memory@86200000

arch/arm64/boot/dts/qcom/sdm845.dtsi line 44

Quoted 5 lines
arch/arm64/boot/dts/qcom/sdm845.dtsi +5 -0
+			reg = <0 0x86200000 0 0x2d00000>;
+			no-map;
+		};
+	};
+

The rest looks good.

Regards,
Bjorn

Signature · 3 lines
Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc, is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project