Skip to contentSkip to conversation

qcom: dts: thermal cleanups

PATCH Superseded Amit Kucheria 2 participants 19 messages Feb 18, 2019 – Feb 20, 2019

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover qcom: dts: thermal cleanups

- Expose all temperature sensors on msm8916, msm996, msm8998, sdm845
- split up the register address map for msm8998
- standardize names of the various thermal-zones across boards to make it easy for test scripts to parse

Amit Kucheria (12):
arm64: dts: msm8998: thermal: split address space into two
arm64: dts: msm8998: efficiency is not valid property
arm64: dts: msm8916: thermal: Add sensor for modem
arm64: dts: msm8996: thermal: Add temperature sensors near major
peripherals
arm64: dts: msm8998: thermal: Fix the cpu sensor numbers
arm64: dts: msm8998: thermal: Fix the gpu sensor number
arm64: dts: msm8998: thermal: GPU has two sensors, add the second
arm64: dts: msm8998: thermal: Add temperature sensors near major
peripherals
arm64: dts: sdm845: thermal: Add temperature sensors near major
peripherals
arm64: dts: msm8998: thermal: Make trip names consistent
arm64: dts: msm8916: thermal: Make trip names consistent
arm64: dts: msm8996: thermal: Make trip names consistent

 arch/arm64/boot/dts/qcom/msm8916.dtsi |  30 +++--
 arch/arm64/boot/dts/qcom/msm8996.dtsi | 122 ++++++++++++++++++--
 arch/arm64/boot/dts/qcom/msm8998.dtsi | 154 ++++++++++++++++++--------
 arch/arm64/boot/dts/qcom/sdm845.dtsi  |  91 +++++++++++++++
 4 files changed, 328 insertions(+), 69 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/12 arm64: dts: msm8998: thermal: split address space into two

We've earlier added support to split the register address space into TM and SROT regions. Split up the regmap address space into two for msm8998 that has a similar register layout.

The order is important (TM before SROT) because we make an assumption that SROT is always the second address space in order to support legacy DTs.

---
 arch/arm64/boot/dts/qcom/msm8998.dtsi | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/msm8998.dtsi +6 -4
index 8d41b69ec2da..3c5fb2509d5f 100644
@@ -579,17 +579,19 @@
 			cell-index = <0>;
 		};
 
-		tsens0: thermal@10aa000 {
+		tsens0: thermal@10ab000 {
 			compatible = "qcom,msm8998-tsens", "qcom,tsens-v2";
-			reg = <0x10aa000 0x2000>;
+			reg = <0x10ab000 0x1000>, /* TM */
+			      <0x10aa000 0x1000>; /* SROT */
 
 			#qcom,sensors = <12>;
 			#thermal-sensor-cells = <1>;
 		};
 
-		tsens1: thermal@10ad000 {
+		tsens1: thermal@10ae000 {
 			compatible = "qcom,msm8998-tsens", "qcom,tsens-v2";
-			reg = <0x10ad000 0x2000>;
+			reg = <0x10ae000 0x1000>, /* TM */
+			      <0x10ad000 0x1000>; /* SROT */
 
 			#qcom,sensors = <8>;
 			#thermal-sensor-cells = <1>;
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/12 arm64: dts: msm8998: efficiency is not valid property

In reply to Amit Kucheria

efficiency comes from downstream. The valid upstream property is capacity-dmips-mhz but until we can come up with those numbers, remove this property.

---
 arch/arm64/boot/dts/qcom/msm8998.dtsi | 8 --------
 1 file changed, 8 deletions(-)
arch/arm64/boot/dts/qcom/msm8998.dtsi +0 -8
index 3c5fb2509d5f..db4cb687126b 100644
@@ -77,7 +77,6 @@
 			compatible = "arm,armv8";
 			reg = <0x0 0x0>;
 			enable-method = "psci";
-			efficiency = <1024>;
 			next-level-cache = <&L2_0>;
 			L2_0: l2-cache {
 				compatible = "arm,arch-cache";
@@ -96,7 +95,6 @@
 			compatible = "arm,armv8";
 			reg = <0x0 0x1>;
 			enable-method = "psci";
-			efficiency = <1024>;
 			next-level-cache = <&L2_0>;
 			L1_I_1: l1-icache {
 				compatible = "arm,arch-cache";
@@ -111,7 +109,6 @@
 			compatible = "arm,armv8";
 			reg = <0x0 0x2>;
 			enable-method = "psci";
-			efficiency = <1024>;
 			next-level-cache = <&L2_0>;
 			L1_I_2: l1-icache {
 				compatible = "arm,arch-cache";
@@ -126,7 +123,6 @@
 			compatible = "arm,armv8";
 			reg = <0x0 0x3>;
 			enable-method = "psci";
-			efficiency = <1024>;
 			next-level-cache = <&L2_0>;
 			L1_I_3: l1-icache {
 				compatible = "arm,arch-cache";
@@ -141,7 +137,6 @@
 			compatible = "arm,armv8";
 			reg = <0x0 0x100>;
 			enable-method = "psci";
-			efficiency = <1536>;
 			next-level-cache = <&L2_1>;
 			L2_1: l2-cache {
 				compatible = "arm,arch-cache";
@@ -160,7 +155,6 @@
 			compatible = "arm,armv8";
 			reg = <0x0 0x101>;
 			enable-method = "psci";
-			efficiency = <1536>;
 			next-level-cache = <&L2_1>;
 			L1_I_101: l1-icache {
 				compatible = "arm,arch-cache";
@@ -175,7 +169,6 @@
 			compatible = "arm,armv8";
 			reg = <0x0 0x102>;
 			enable-method = "psci";
-			efficiency = <1536>;
 			next-level-cache = <&L2_1>;
 			L1_I_102: l1-icache {
 				compatible = "arm,arch-cache";
@@ -190,7 +183,6 @@
 			compatible = "arm,armv8";
 			reg = <0x0 0x103>;
 			enable-method = "psci";
-			efficiency = <1536>;
 			next-level-cache = <&L2_1>;
 			L1_I_103: l1-icache {
 				compatible = "arm,arch-cache";
Signature · 1 line
2.17.1
#3 lore raw

PATCH 3/12 arm64: dts: msm8916: thermal: Add sensor for modem

In reply to Amit Kucheria

On platforms that have a modem, sensor 0 monitors the modem.

---
 arch/arm64/boot/dts/qcom/msm8916.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/qcom/msm8916.dtsi +6 -0
index 9e598ab438a1..9e4a82e5e0b4 100644
@@ -278,7 +278,13 @@
 					type = "critical";
 				};
 			};
+		};
+
+		modem-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
 
+			thermal-sensors = <&tsens 0>;
 		};
 
 	};
Signature · 1 line
2.17.1
#4 lore raw

Re: [PATCH v1 03/12] arm64: dts: msm8916: thermal: Add sensor for modem

Quoted 12 lines · Amit Kucheria

On platforms that have a modem, sensor 0 monitors the modem.

---
 arch/arm64/boot/dts/qcom/msm8916.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/qcom/msm8916.dtsi +0 -0
index 9e598ab438a1..9e4a82e5e0b4 100644

arch/arm64/boot/dts/qcom/msm8916.dtsi line 287

Quoted 10 lines
arch/arm64/boot/dts/qcom/msm8916.dtsi +6 -0
@@ -278,7 +278,13 @@
 					type = "critical";
 				};
 			};
+		};
+
+		modem-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
 
+			thermal-sensors = <&tsens 0>;

A thermal zone with no trips no cooling? Please check the thermal.txt binding for the required properties.

Quoted 6 lines
arch/arm64/boot/dts/qcom/msm8916.dtsi +0 -0
 		};
 
 	};
Signature · 1 line
2.17.1
#5 lore raw

PATCH 4/12 arm64: dts: msm8996: thermal: Add temperature sensors near major peripherals

In reply to Amit Kucheria

msm8996 has a total of 21 temperature sensors. Populate DT with information about them.

There are 2 sensors on each of the cpus - one on the top, the other below (we only expose one on the top in DT for now). For the GPU, we expose both, the one on the top and the one below.

Depending on the version of the silicon, sensor 2 is either placed near the L3 cache or the venus video decoder. It would've been nice to be able to be version-specific but we don't have DTs that differentiate the two versions of silicon yet.

---
 arch/arm64/boot/dts/qcom/msm8996.dtsi | 98 +++++++++++++++++++++++++++
 1 file changed, 98 insertions(+)
arch/arm64/boot/dts/qcom/msm8996.dtsi +98 -0
index ae6e9f0778f0..8e36a39e1386 100644
@@ -237,6 +237,104 @@
 				};
 			};
 		};
+
+		gpu-thermal-top {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 6>;
+
+			trips {
+				gpu1_alert0: trip-point@0 {
+					temperature = <75000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				gpu1_crit: gpu_crit {
+					temperature = <95000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+		};
+
+		gpu-thermal-bottom {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 7>;
+
+			trips {
+				gpu2_alert0: trip-point@0 {
+					temperature = <75000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				gpu2_crit: gpu_crit {
+					temperature = <95000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+		};
+
+		m4m-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 1>;
+		};
+
+		l3_or_venus-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 2>;
+		};
+
+		cluster0-l2-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 7>;
+		};
+
+		cluster1-l2-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 12>;
+		};
+
+		camera-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 1>;
+		};
+
+		q6-dsp-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 2>;
+		};
+
+		mem-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 3>;
+		};
+
+		modemtx-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 4>;
+		};
 	};
 
 	timer {
Signature · 1 line
2.17.1
#6 lore raw

Re: [PATCH v1 04/12] arm64: dts: msm8996: thermal: Add temperature sensors near major peripherals

Quoted 27 lines · Amit Kucheria

msm8996 has a total of 21 temperature sensors. Populate DT with information about them.

There are 2 sensors on each of the cpus - one on the top, the other below (we only expose one on the top in DT for now). For the GPU, we expose both, the one on the top and the one below.

Depending on the version of the silicon, sensor 2 is either placed near the L3 cache or the venus video decoder. It would've been nice to be able to be version-specific but we don't have DTs that differentiate the two versions of silicon yet.

---
 arch/arm64/boot/dts/qcom/msm8996.dtsi | 98 +++++++++++++++++++++++++++
 1 file changed, 98 insertions(+)
arch/arm64/boot/dts/qcom/msm8996.dtsi +2 -0
index ae6e9f0778f0..8e36a39e1386 100644
@@ -237,6 +237,104 @@
 				};
 			};
 		};
+
+		gpu-thermal-top {

arch/arm64/boot/dts/qcom/msm8996.dtsi line 251

Quoted 10 lines
arch/arm64/boot/dts/qcom/msm8996.dtsi +10 -0
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 6>;
+
+			trips {
+				gpu1_alert0: trip-point@0 {
+					temperature = <75000>;
+					hysteresis = <2000>;
+					type = "passive";

What is the cooling map for this?

Quoted 92 lines
arch/arm64/boot/dts/qcom/msm8996.dtsi +86 -0
+				};
+
+				gpu1_crit: gpu_crit {
+					temperature = <95000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+		};
+
+		gpu-thermal-bottom {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 7>;
+
+			trips {
+				gpu2_alert0: trip-point@0 {
+					temperature = <75000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				gpu2_crit: gpu_crit {
+					temperature = <95000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+		};
+
+		m4m-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 1>;
+		};
+
+		l3_or_venus-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 2>;
+		};
+
+		cluster0-l2-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 7>;
+		};
+
+		cluster1-l2-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 12>;
+		};
+
+		camera-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 1>;
+		};
+
+		q6-dsp-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 2>;
+		};
+
+		mem-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 3>;
+		};
+
+		modemtx-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 4>;
+		};
 	};
 
 	timer {
Signature · 1 line
2.17.1
#7 lore raw

Re: [PATCH v1 04/12] arm64: dts: msm8996: thermal: Add temperature sensors near major peripherals

Quoted 33 lines · Eduardo Valentin
Quoted 31 lines · Amit Kucheria

msm8996 has a total of 21 temperature sensors. Populate DT with information about them.

There are 2 sensors on each of the cpus - one on the top, the other below (we only expose one on the top in DT for now). For the GPU, we expose both, the one on the top and the one below.

Depending on the version of the silicon, sensor 2 is either placed near the L3 cache or the venus video decoder. It would've been nice to be able to be version-specific but we don't have DTs that differentiate the two versions of silicon yet.

---
 arch/arm64/boot/dts/qcom/msm8996.dtsi | 98 +++++++++++++++++++++++++++
 1 file changed, 98 insertions(+)
arch/arm64/boot/dts/qcom/msm8996.dtsi +6 -0
index ae6e9f0778f0..8e36a39e1386 100644
@@ -237,6 +237,104 @@
                              };
                      };
              };
+
+             gpu-thermal-top {
+                     polling-delay-passive = <250>;
+                     polling-delay = <1000>;
+
+                     thermal-sensors = <&tsens1 6>;
Quoted 8 lines

arch/arm64/boot/dts/qcom/msm8996.dtsi line 251

Quoted 6 lines
arch/arm64/boot/dts/qcom/msm8996.dtsi +6 -0
+
+                     trips {
+                             gpu1_alert0: trip-point@0 {
+                                     temperature = <75000>;
+                                     hysteresis = <2000>;
+                                     type = "passive";

What is the cooling map for this?

I'm working on it. Will send out an update.

Quoted 92 lines
Quoted 92 lines
arch/arm64/boot/dts/qcom/msm8996.dtsi +86 -1
+                             };
+
+                             gpu1_crit: gpu_crit {
+                                     temperature = <95000>;
+                                     hysteresis = <2000>;
+                                     type = "critical";
+                             };
+                     };
+             };
+
+             gpu-thermal-bottom {
+                     polling-delay-passive = <250>;
+                     polling-delay = <1000>;
+
+                     thermal-sensors = <&tsens1 7>;
+
+                     trips {
+                             gpu2_alert0: trip-point@0 {
+                                     temperature = <75000>;
+                                     hysteresis = <2000>;
+                                     type = "passive";
+                             };
+
+                             gpu2_crit: gpu_crit {
+                                     temperature = <95000>;
+                                     hysteresis = <2000>;
+                                     type = "critical";
+                             };
+                     };
+             };
+
+             m4m-thermal {
+                     polling-delay-passive = <250>;
+                     polling-delay = <1000>;
+
+                     thermal-sensors = <&tsens0 1>;
+             };
+
+             l3_or_venus-thermal {
+                     polling-delay-passive = <250>;
+                     polling-delay = <1000>;
+
+                     thermal-sensors = <&tsens0 2>;
+             };
+
+             cluster0-l2-thermal {
+                     polling-delay-passive = <250>;
+                     polling-delay = <1000>;
+
+                     thermal-sensors = <&tsens0 7>;
+             };
+
+             cluster1-l2-thermal {
+                     polling-delay-passive = <250>;
+                     polling-delay = <1000>;
+
+                     thermal-sensors = <&tsens0 12>;
+             };
+
+             camera-thermal {
+                     polling-delay-passive = <250>;
+                     polling-delay = <1000>;
+
+                     thermal-sensors = <&tsens1 1>;
+             };
+
+             q6-dsp-thermal {
+                     polling-delay-passive = <250>;
+                     polling-delay = <1000>;
+
+                     thermal-sensors = <&tsens1 2>;
+             };
+
+             mem-thermal {
+                     polling-delay-passive = <250>;
+                     polling-delay = <1000>;
+
+                     thermal-sensors = <&tsens1 3>;
+             };
+
+             modemtx-thermal {
+                     polling-delay-passive = <250>;
+                     polling-delay = <1000>;
+
+                     thermal-sensors = <&tsens1 4>;
+             };
      };
 
      timer {
--

2.17.1

#8 lore raw

PATCH 5/12 arm64: dts: msm8998: thermal: Fix the cpu sensor numbers

In reply to Amit Kucheria

The silver cluster (typically cpu0-3) are monitored by sensor IDs 1-3 on tsens controller 0. The gold cluster (typically cpu4-7) are monitored by sensor IDs 7-10 on tsens controller 0.

Fixes 4449b6f248d9a1 ("arm64: dts: qcom: msm8998: Add tsens and thermal-zones")
---
 arch/arm64/boot/dts/qcom/msm8998.dtsi | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/qcom/msm8998.dtsi +8 -8
index db4cb687126b..662ca458e64a 100644
@@ -336,7 +336,7 @@
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
-			thermal-sensors = <&tsens0 6>;
+			thermal-sensors = <&tsens0 1>;
 
 			trips {
 				cpu_alert0: trip0 {
@@ -357,7 +357,7 @@
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
-			thermal-sensors = <&tsens0 7>;
+			thermal-sensors = <&tsens0 2>;
 
 			trips {
 				cpu_alert1: trip0 {
@@ -378,7 +378,7 @@
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
-			thermal-sensors = <&tsens0 8>;
+			thermal-sensors = <&tsens0 3>;
 
 			trips {
 				cpu_alert2: trip0 {
@@ -399,7 +399,7 @@
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
-			thermal-sensors = <&tsens0 9>;
+			thermal-sensors = <&tsens0 4>;
 
 			trips {
 				cpu_alert3: trip0 {
@@ -420,7 +420,7 @@
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
-			thermal-sensors = <&tsens0 10>;
+			thermal-sensors = <&tsens0 7>;
 
 			trips {
 				cpu_alert4: trip0 {
@@ -441,7 +441,7 @@
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
-			thermal-sensors = <&tsens0 11>;
+			thermal-sensors = <&tsens0 8>;
 
 			trips {
 				cpu_alert5: trip0 {
@@ -462,7 +462,7 @@
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
-			thermal-sensors = <&tsens1 0>;
+			thermal-sensors = <&tsens0 9>;
 
 			trips {
 				cpu_alert6: trip0 {
@@ -483,7 +483,7 @@
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
-			thermal-sensors = <&tsens1 1>;
+			thermal-sensors = <&tsens0 10>;
 
 			trips {
 				cpu_alert7: trip0 {
Signature · 1 line
2.17.1
#9 lore raw

PATCH 6/12 arm64: dts: msm8998: thermal: Fix the gpu sensor number

In reply to Amit Kucheria

The GPU sensor is sensor ID 13 on controller 0

Fixes 4449b6f248d9a1 ("arm64: dts: qcom: msm8998: Add tsens and thermal-zones")
---
 arch/arm64/boot/dts/qcom/msm8998.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8998.dtsi +1 -1
index 662ca458e64a..ba579cf10254 100644
@@ -504,7 +504,7 @@
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
-			thermal-sensors = <&tsens1 3>;
+			thermal-sensors = <&tsens0 13>;
 		};
 	};
 
Signature · 1 line
2.17.1
#10 lore raw

PATCH 7/12 arm64: dts: msm8998: thermal: GPU has two sensors, add the second

In reply to Amit Kucheria

The first sensor is on top and the second sensor below the GPU

---
 arch/arm64/boot/dts/qcom/msm8998.dtsi | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8998.dtsi +8 -1
index ba579cf10254..dc641523fcbd 100644
@@ -500,7 +500,14 @@
 			};
 		};
 
-		gpu-thermal {
+		gpu-thermal-bottom {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 12>;
+		};
+
+		gpu-thermal-top {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
Signature · 1 line
2.17.1
#11 lore raw

PATCH 8/12 arm64: dts: msm8998: thermal: Add temperature sensors near major peripherals

In reply to Amit Kucheria

msm8998 has a total of 22 temperature sensors. Populate DT with information about them.

---
 arch/arm64/boot/dts/qcom/msm8998.dtsi | 63 +++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)
arch/arm64/boot/dts/qcom/msm8998.dtsi +63 -0
index dc641523fcbd..26a493af0866 100644
@@ -513,6 +513,69 @@
 
 			thermal-sensors = <&tsens0 13>;
 		};
+
+		cluster0-mhm-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 5>;
+		};
+
+		cluster1-mhm-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 6>;
+		};
+
+		cluster1-l2-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 11>;
+		};
+
+		modem-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 1>;
+		};
+
+		mem-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 2>;
+		};
+
+		wlan-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 3>;
+		};
+
+		q6-dsp-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 4>;
+		};
+
+		camera-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 5>;
+		};
+
+		multimedia-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 6>;
+		};
 	};
 
 	timer {
Signature · 1 line
2.17.1
#12 lore raw

PATCH 9/12 arm64: dts: sdm845: thermal: Add temperature sensors near major peripherals

In reply to Amit Kucheria

sdm845 has a total of 21 temperature sensors. Populate DT with information about them.

---
 arch/arm64/boot/dts/qcom/sdm845.dtsi | 91 ++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)
arch/arm64/boot/dts/qcom/sdm845.dtsi +91 -0
index c27cbd3bcb0a..55c8f3f99add 100644
@@ -1851,5 +1851,96 @@
 				};
 			};
 		};
+
+		aoss0-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 0>;
+		};
+
+		cluster0-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 5>;
+		};
+
+		cluster1-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 6>;
+		};
+
+		gpu-thermal-top {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 11>;
+		};
+
+		gpu-thermal-bottom {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 12>;
+		};
+
+		aoss1-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 0>;
+		};
+
+		q6-modem-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 1>;
+		};
+
+		mem-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 2>;
+		};
+
+		wlan-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 3>;
+		};
+
+		q6-hvx-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 4>;
+		};
+
+		camera-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 5>;
+		};
+
+		video-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 6>;
+		};
+
+		modem-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 7>;
+		};
 	};
 };
Signature · 1 line
2.17.1
#13 lore raw

PATCH 10/12 arm64: dts: msm8998: thermal: Make trip names consistent

In reply to Amit Kucheria

Maintain naming consistency with what was landed for sdm845. Simplifies parsing for test tools.

---
 arch/arm64/boot/dts/qcom/msm8998.dtsi | 48 +++++++++++++--------------
 1 file changed, 24 insertions(+), 24 deletions(-)
arch/arm64/boot/dts/qcom/msm8998.dtsi +24 -24
index 26a493af0866..f05ce858c423 100644
@@ -332,20 +332,20 @@
 	};
 
 	thermal-zones {
-		cpu-thermal0 {
+		cpu0-thermal {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
 			thermal-sensors = <&tsens0 1>;
 
 			trips {
-				cpu_alert0: trip0 {
+				cpu0_alert0: trip-point@0 {
 					temperature = <75000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
 
-				cpu_crit0: trip1 {
+				cpu0_crit: cpu_crit {
 					temperature = <110000>;
 					hysteresis = <2000>;
 					type = "critical";
@@ -353,20 +353,20 @@
 			};
 		};
 
-		cpu-thermal1 {
+		cpu1-thermal {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
 			thermal-sensors = <&tsens0 2>;
 
 			trips {
-				cpu_alert1: trip0 {
+				cpu1_alert0: trip-point@0 {
 					temperature = <75000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
 
-				cpu_crit1: trip1 {
+				cpu1_crit: cpu_crit {
 					temperature = <110000>;
 					hysteresis = <2000>;
 					type = "critical";
@@ -374,20 +374,20 @@
 			};
 		};
 
-		cpu-thermal2 {
+		cpu2-thermal {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
 			thermal-sensors = <&tsens0 3>;
 
 			trips {
-				cpu_alert2: trip0 {
+				cpu2_alert0: trip-point@0 {
 					temperature = <75000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
 
-				cpu_crit2: trip1 {
+				cpu2_crit: cpu_crit {
 					temperature = <110000>;
 					hysteresis = <2000>;
 					type = "critical";
@@ -395,20 +395,20 @@
 			};
 		};
 
-		cpu-thermal3 {
+		cpu3-thermal {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
 			thermal-sensors = <&tsens0 4>;
 
 			trips {
-				cpu_alert3: trip0 {
+				cpu3_alert0: trip-point@0 {
 					temperature = <75000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
 
-				cpu_crit3: trip1 {
+				cpu3_crit: cpu_crit {
 					temperature = <110000>;
 					hysteresis = <2000>;
 					type = "critical";
@@ -416,20 +416,20 @@
 			};
 		};
 
-		cpu-thermal4 {
+		cpu4-thermal {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
 			thermal-sensors = <&tsens0 7>;
 
 			trips {
-				cpu_alert4: trip0 {
+				cpu4_alert0: trip-point@0 {
 					temperature = <75000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
 
-				cpu_crit4: trip1 {
+				cpu4_crit: cpu_crit {
 					temperature = <110000>;
 					hysteresis = <2000>;
 					type = "critical";
@@ -437,20 +437,20 @@
 			};
 		};
 
-		cpu-thermal5 {
+		cpu5-thermal {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
 			thermal-sensors = <&tsens0 8>;
 
 			trips {
-				cpu_alert5: trip0 {
+				cpu5_alert0: trip-point@0 {
 					temperature = <75000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
 
-				cpu_crit5: trip1 {
+				cpu5_crit: cpu_crit {
 					temperature = <110000>;
 					hysteresis = <2000>;
 					type = "critical";
@@ -458,20 +458,20 @@
 			};
 		};
 
-		cpu-thermal6 {
+		cpu6-thermal {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
 			thermal-sensors = <&tsens0 9>;
 
 			trips {
-				cpu_alert6: trip0 {
+				cpu6_alert0: trip-point@0 {
 					temperature = <75000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
 
-				cpu_crit6: trip1 {
+				cpu6_crit: cpu_crit {
 					temperature = <110000>;
 					hysteresis = <2000>;
 					type = "critical";
@@ -479,20 +479,20 @@
 			};
 		};
 
-		cpu-thermal7 {
+		cpu7-thermal {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
 			thermal-sensors = <&tsens0 10>;
 
 			trips {
-				cpu_alert7: trip0 {
+				cpu7_alert0: trip-point@0 {
 					temperature = <75000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
 
-				cpu_crit7: trip1 {
+				cpu7_crit: cpu_crit {
 					temperature = <110000>;
 					hysteresis = <2000>;
 					type = "critical";
Signature · 1 line
2.17.1
#14 lore raw

PATCH 11/12 arm64: dts: msm8916: thermal: Make trip names consistent

In reply to Amit Kucheria

Maintain naming consistency with what was landed for sdm845. Simplifies parsing for test tools.

---
 arch/arm64/boot/dts/qcom/msm8916.dtsi | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/qcom/msm8916.dtsi +12 -12
index 9e4a82e5e0b4..2002f5f91a83 100644
@@ -180,19 +180,19 @@
 	};
 
 	thermal-zones {
-		cpu-thermal0 {
+		cpu0_1-thermal {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
 			thermal-sensors = <&tsens 5>;
 
 			trips {
-				cpu_alert0: trip0 {
+				cpu0_1_alert0: trip-point@0 {
 					temperature = <75000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
-				cpu_crit0: trip1 {
+				cpu0_1_crit: cpu_crit {
 					temperature = <110000>;
 					hysteresis = <2000>;
 					type = "critical";
@@ -201,7 +201,7 @@
 
 			cooling-maps {
 				map0 {
-					trip = <&cpu_alert0>;
+					trip = <&cpu0_1_alert0>;
 					cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
 							 <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
 							 <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
@@ -210,19 +210,19 @@
 			};
 		};
 
-		cpu-thermal1 {
+		cpu2_3-thermal {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
 			thermal-sensors = <&tsens 4>;
 
 			trips {
-				cpu_alert1: trip0 {
+				cpu2_3_alert0: trip-point@0 {
 					temperature = <75000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
-				cpu_crit1: trip1 {
+				cpu2_3_crit: cpu_crit {
 					temperature = <110000>;
 					hysteresis = <2000>;
 					type = "critical";
@@ -231,7 +231,7 @@
 
 			cooling-maps {
 				map0 {
-					trip = <&cpu_alert1>;
+					trip = <&cpu2_3_alert0>;
 					cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
 							 <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
 							 <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
@@ -247,12 +247,12 @@
 			thermal-sensors = <&tsens 2>;
 
 			trips {
-				gpu_alert: trip0 {
+				gpu_alert0: trip-point@0 {
 					temperature = <75000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
-				gpu_crit: trip1 {
+				gpu_crit: gpu_crit {
 					temperature = <95000>;
 					hysteresis = <2000>;
 					type = "critical";
@@ -267,12 +267,12 @@
 			thermal-sensors = <&tsens 1>;
 
 			trips {
-				cam_alert: trip0 {
+				cam_alert0: trip-point@0 {
 					temperature = <75000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
-				cam_crit: trip1 {
+				cam_crit: cam_crit {
 					temperature = <95000>;
 					hysteresis = <2000>;
 					type = "critical";
Signature · 1 line
2.17.1
#15 lore raw

PATCH 12/12 arm64: dts: msm8996: thermal: Make trip names consistent

In reply to Amit Kucheria

Maintain naming consistency with what was landed for sdm845. Simplifies parsing for test tools.

---
 arch/arm64/boot/dts/qcom/msm8996.dtsi | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/qcom/msm8996.dtsi +12 -12
index 8e36a39e1386..67ab6e31b0e5 100644
@@ -154,20 +154,20 @@
 	};
 
 	thermal-zones {
-		cpu-thermal0 {
+		cpu0-thermal {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
 			thermal-sensors = <&tsens0 3>;
 
 			trips {
-				cpu_alert0: trip0 {
+				cpu0_alert0: trip-point@0 {
 					temperature = <75000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
 
-				cpu_crit0: trip1 {
+				cpu0_crit: cpu_crit {
 					temperature = <110000>;
 					hysteresis = <2000>;
 					type = "critical";
@@ -175,20 +175,20 @@
 			};
 		};
 
-		cpu-thermal1 {
+		cpu1-thermal {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
 			thermal-sensors = <&tsens0 5>;
 
 			trips {
-				cpu_alert1: trip0 {
+				cpu1_alert0: trip-point@0 {
 					temperature = <75000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
 
-				cpu_crit1: trip1 {
+				cpu1_crit: cpu_crit {
 					temperature = <110000>;
 					hysteresis = <2000>;
 					type = "critical";
@@ -196,20 +196,20 @@
 			};
 		};
 
-		cpu-thermal2 {
+		cpu2-thermal {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
 			thermal-sensors = <&tsens0 8>;
 
 			trips {
-				cpu_alert2: trip0 {
+				cpu2_alert0: trip-point@0 {
 					temperature = <75000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
 
-				cpu_crit2: trip1 {
+				cpu2_crit: cpu_crit {
 					temperature = <110000>;
 					hysteresis = <2000>;
 					type = "critical";
@@ -217,20 +217,20 @@
 			};
 		};
 
-		cpu-thermal3 {
+		cpu3-thermal {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 
 			thermal-sensors = <&tsens0 10>;
 
 			trips {
-				cpu_alert3: trip0 {
+				cpu3_alert0: trip-point@0 {
 					temperature = <75000>;
 					hysteresis = <2000>;
 					type = "passive";
 				};
 
-				cpu_crit3: trip1 {
+				cpu3_crit: cpu_crit {
 					temperature = <110000>;
 					hysteresis = <2000>;
 					type = "critical";
Signature · 1 line
2.17.1
#16 lore raw
In reply to Amit Kucheria

Hey

Quoted 5 lines · Amit Kucheria

- Expose all temperature sensors on msm8916, msm996, msm8998, sdm845
- split up the register address map for msm8998
- standardize names of the various thermal-zones across boards to make it easy for test scripts to parse

I am generally fine with the effort but please fix the following (applies for the whole series) wrt to required properties for DT thermal:
a. Trip points for your zones
b. Cooling Mappings for zones that have passive trips.

Quoted 26 lines

Amit Kucheria (12):
arm64: dts: msm8998: thermal: split address space into two
arm64: dts: msm8998: efficiency is not valid property
arm64: dts: msm8916: thermal: Add sensor for modem
arm64: dts: msm8996: thermal: Add temperature sensors near major
peripherals
arm64: dts: msm8998: thermal: Fix the cpu sensor numbers
arm64: dts: msm8998: thermal: Fix the gpu sensor number
arm64: dts: msm8998: thermal: GPU has two sensors, add the second
arm64: dts: msm8998: thermal: Add temperature sensors near major
peripherals
arm64: dts: sdm845: thermal: Add temperature sensors near major
peripherals
arm64: dts: msm8998: thermal: Make trip names consistent
arm64: dts: msm8916: thermal: Make trip names consistent
arm64: dts: msm8996: thermal: Make trip names consistent

 arch/arm64/boot/dts/qcom/msm8916.dtsi |  30 +++--
 arch/arm64/boot/dts/qcom/msm8996.dtsi | 122 ++++++++++++++++++--
 arch/arm64/boot/dts/qcom/msm8998.dtsi | 154 ++++++++++++++++++--------
 arch/arm64/boot/dts/qcom/sdm845.dtsi  |  91 +++++++++++++++
 4 files changed, 328 insertions(+), 69 deletions(-)
Signature · 1 line
2.17.1
#17 lore raw
Quoted 9 lines · Eduardo Valentin

Hey

Quoted 5 lines · Amit Kucheria

- Expose all temperature sensors on msm8916, msm996, msm8998, sdm845
- split up the register address map for msm8998
- standardize names of the various thermal-zones across boards to make it easy for test scripts to parse

Quoted 4 lines

I am generally fine with the effort but please fix the following (applies for the whole series) wrt to required properties for DT thermal:
a. Trip points for your zones

Thanks for the review.

In some cases, the temperatures are just exposed so something in userspace might read it and do something with it. We don't expect kernel trips for them.

Adding trip points also requires me to add cooling-maps (your point b. below).

I guess I'm looking for an example of how to just expose sensor temperatures w/o any associated trips and cooling maps.

Quoted 4 lines

b. Cooling Mappings for zones that have passive trips.

From what I can see currently only CPUs and GPUs (among the major heat

sources) can passively reduce heat by reducing frequencies.

Things like cameras, display, video might have a more ON/OFF approach to throttling that might be controlled from userspace. And we don't have a way to tell in DT that these zones are managed in userspace
(https://patchwork.kernel.org/patch/10259487/)

#18 lore raw
Quoted 15 lines · Amit Kucheria
Quoted 9 lines · Eduardo Valentin

Hey

Quoted 5 lines · Amit Kucheria

- Expose all temperature sensors on msm8916, msm996, msm8998, sdm845
- split up the register address map for msm8998
- standardize names of the various thermal-zones across boards to make it easy for test scripts to parse

Quoted 4 lines

I am generally fine with the effort but please fix the following (applies for the whole series) wrt to required properties for DT thermal:
a. Trip points for your zones

Quoted 5 lines

Thanks for the review.

In some cases, the temperatures are just exposed so something in userspace might read it and do something with it. We don't expect kernel trips for them.

Would a hwmon driver make more sense here?

Quoted 2 lines

Adding trip points also requires me to add cooling-maps (your point b. below).

Yes.

Quoted 7 lines

I guess I'm looking for an example of how to just expose sensor temperatures w/o any associated trips and cooling maps.

Quoted 2 lines

b. Cooling Mappings for zones that have passive trips.

Quoted 6 lines

From what I can see currently only CPUs and GPUs (among the major heat sources) can passively reduce heat by reducing frequencies.

Things like cameras, display, video might have a more ON/OFF approach to throttling that might be controlled from userspace. And we don't have a way to tell in DT that these zones are managed in userspace

You can always add a Hot trip point. To my understanding that is for notifying userspace.

Quoted 1 line

(https://patchwork.kernel.org/patch/10259487/)