Skip to contentSkip to conversation

Add device node support for TSENS in SC7180

PATCH In review Rajeshwari 3 participants 11 messages Nov 28, 2019 – Dec 12, 2019

Subsystems (4)
lore
Share & tools
lore

Rajeshwari

author
#0 lore raw

v2 cover Add device node support for TSENS in SC7180

Add TSENS node and user thermal zone configurations for TSENS sensors in SC7180.

The change has dependency on adding device tree support for sc7180 [1] to merge first.

Dependencies:

[1] https://lkml.org/lkml/2019/11/8/149

changes in v2:
* Added polling delay.
* Removed unwanted properties.
* Updated sensor names under thermal-zones.
* Updated trip points.
* Added interrupt support.

Rajeshwari (1):
arm64: dts: qcom: sc7180: Add device node support for TSENS in SC7180

 arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 +++++++++++++++++++++++++++++++++++
 1 file changed, 527 insertions(+)
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member 
of Code Aurora Forum, hosted by The Linux Foundation
author
#1 lore raw

PATCH v2 1/1 arm64: dts: qcom: sc7180: Add device node support for TSENS in SC7180

Add TSENS node and user thermal zone for TSENS sensors in SC7180.

---
 arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 +++++++++++++++++++++++++++++++++++
 1 file changed, 527 insertions(+)
arch/arm64/boot/dts/qcom/sc7180.dtsi +527 -0
index 666e9b9..6656ffc 100644
@@ -911,6 +911,26 @@
 			status = "disabled";
 		};
 
+		tsens0: thermal-sensor@c263000 {
+			compatible = "qcom,sc7180-tsens","qcom,tsens-v2";
+			reg = <0 0x0c263000 0 0x1ff>, /* TM */
+				<0 0x0c222000 0 0x1ff>; /* SROT */
+			#qcom,sensors = <15>;
+			interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "uplow";
+			#thermal-sensor-cells = <1>;
+		};
+
+		tsens1: thermal-sensor@c265000 {
+			compatible = "qcom,sc7180-tsens","qcom,tsens-v2";
+			reg = <0 0x0c265000 0 0x1ff>, /* TM */
+				<0 0x0c223000 0 0x1ff>; /* SROT */
+			#qcom,sensors = <10>;
+			interrupts = <GIC_SPI 507 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "uplow";
+			#thermal-sensor-cells = <1>;
+		};
+
 		spmi_bus: spmi@c440000 {
 			compatible = "qcom,spmi-pmic-arb";
 			reg = <0 0x0c440000 0 0x1100>,
@@ -1121,6 +1141,513 @@
 		};
 	};
 
+	thermal-zones {
+		cpu0-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 1>;
+
+			trips {
+				cpu0_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu0_alert1: trip-point1 {
+					temperature = <95000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu0_crit: cpu_crit {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		cpu1-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 2>;
+
+			trips {
+				cpu1_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu1_alert1: trip-point1 {
+					temperature = <95000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu1_crit: cpu_crit {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		cpu2-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 3>;
+
+			trips {
+				cpu2_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu2_alert1: trip-point1 {
+					temperature = <95000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu2_crit: cpu_crit {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		cpu3-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 4>;
+
+			trips {
+				cpu3_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu3_alert1: trip-point1 {
+					temperature = <95000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu3_crit: cpu_crit {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		cpu4-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 5>;
+
+			trips {
+				cpu4_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu4_alert1: trip-point1 {
+					temperature = <95000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu4_crit: cpu_crit {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		cpu5-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 6>;
+
+			trips {
+				cpu5_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu5_alert1: trip-point1 {
+					temperature = <95000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu5_crit: cpu_crit {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		cpu6-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 9>;
+
+			trips {
+				cpu6_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu6_alert1: trip-point1 {
+					temperature = <95000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu6_crit: cpu_crit {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		cpu7-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 10>;
+
+			trips {
+				cpu7_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu7_alert1: trip-point1 {
+					temperature = <95000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu7_crit: cpu_crit {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		cpu8-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 11>;
+
+			trips {
+				cpu8_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu8_alert1: trip-point1 {
+					temperature = <95000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu8_crit: cpu_crit {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		cpu9-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 12>;
+
+			trips {
+				cpu9_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu9_alert1: trip-point1 {
+					temperature = <95000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				cpu9_crit: cpu_crit {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		aoss0-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 0>;
+
+			trips {
+				aoss0_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+
+		cpuss0-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 7>;
+
+			trips {
+				cpuss0_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+				cpuss0_crit: cluster0_crit {
+					temperature = <110000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+		};
+
+		cpuss1-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 8>;
+
+			trips {
+				cpuss1_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+				cpuss1_crit: cluster0_crit {
+					temperature = <110000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+		};
+
+		gpuss0-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 13>;
+
+			trips {
+				gpuss0_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+
+		gpuss1-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens0 14>;
+
+			trips {
+				gpuss1_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+
+		aoss1-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 0>;
+
+			trips {
+				aoss1_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+
+		cwlan-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 1>;
+
+			trips {
+				cwlan_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+
+		audio-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 2>;
+
+			trips {
+				audio_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+
+		ddr-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 3>;
+
+			trips {
+				ddr_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+
+		q6-hvx-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 4>;
+
+			trips {
+				q6_hvx_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+
+		camera-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 5>;
+
+			trips {
+				camera_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+
+		mdm-core-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 6>;
+
+			trips {
+				mdm_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+
+		mdm-dsp-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 7>;
+
+			trips {
+				mdm_dsp_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+
+		npu-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 8>;
+
+			trips {
+				npu_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+
+		video-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens1 9>;
+
+			trips {
+				video_alert0: trip-point0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+			};
+		};
+	};
+
 	timer {
 		compatible = "arm,armv8-timer";
 		interrupts = <GIC_PPI 1 IRQ_TYPE_LEVEL_LOW>,
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member 
of Code Aurora Forum, hosted by The Linux Foundation
#2 lore raw

Re: [PATCH v2 1/1] arm64: dts: qcom: sc7180: Add device node support for TSENS in SC7180

Hi,

Quoted 13 lines · Rajeshwari

Add TSENS node and user thermal zone for TSENS sensors in SC7180.

---
 arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 +++++++++++++++++++++++++++++++++++
 1 file changed, 527 insertions(+)
arch/arm64/boot/dts/qcom/sc7180.dtsi +0 -0
index 666e9b9..6656ffc 100644

arch/arm64/boot/dts/qcom/sc7180.dtsi line 915

Quoted 5 lines
arch/arm64/boot/dts/qcom/sc7180.dtsi +2 -0
@@ -911,6 +911,26 @@
                        status = "disabled";
                };
 
+               tsens0: thermal-sensor@c263000 {
+                       compatible = "qcom,sc7180-tsens","qcom,tsens-v2";

Can you please send a patch listing this configuration in "Documentation/devicetree/bindings/thermal/qcom-tsens.yaml"? You shouldn't need to re-send the dts since it looks like it's already landed, but it's good to get the bindings happy.

Thanks!

-Doug

#4 lore raw

Re: [PATCH v2 1/1] arm64: dts: qcom: sc7180: Add device node support for TSENS in SC7180

In reply to Rajeshwari

Hi,

Quoted 13 lines · Rajeshwari

Add TSENS node and user thermal zone for TSENS sensors in SC7180.

---
 arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 +++++++++++++++++++++++++++++++++++
 1 file changed, 527 insertions(+)
arch/arm64/boot/dts/qcom/sc7180.dtsi +0 -0
index 666e9b9..6656ffc 100644

arch/arm64/boot/dts/qcom/sc7180.dtsi line 920

Quoted 10 lines
arch/arm64/boot/dts/qcom/sc7180.dtsi +7 -0
@@ -911,6 +911,26 @@
                        status = "disabled";
                };
 
+               tsens0: thermal-sensor@c263000 {
+                       compatible = "qcom,sc7180-tsens","qcom,tsens-v2";
+                       reg = <0 0x0c263000 0 0x1ff>, /* TM */
+                               <0 0x0c222000 0 0x1ff>; /* SROT */
+                       #qcom,sensors = <15>;
+                       interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "uplow";

Can you also send a patch to match Amit's ("arm64: dts: sdm845:
thermal: Add critical interrupt support") [1]. If I'm reading things correctly it should be 508 for tsens0 and 509 for tsens1 just like on sdm845.

[1] https://lore.kernel.org/r/c536e9cdb448bbad3441f6580fa57f1f921fb580.1573499020.git.amit.kucheria@linaro.org

-Doug

#3 lore raw

Re: [PATCH v2 1/1] arm64: dts: qcom: sc7180: Add device node support for TSENS in SC7180

In reply to Doug Anderson
Quoted 20 lines · Doug Anderson

Hi,

Quoted 17 lines · Rajeshwari

Add TSENS node and user thermal zone for TSENS sensors in SC7180.

---
 arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 
+++++++++++++++++++++++++++++++++++
 1 file changed, 527 insertions(+)
arch/arm64/boot/dts/qcom/sc7180.dtsi +0 -0
index 666e9b9..6656ffc 100644
@@ -911,6 +911,26 @@
                        status = "disabled";
                };
 
Quoted 8 lines

arch/arm64/boot/dts/qcom/sc7180.dtsi line 916

Quoted 3 lines
arch/arm64/boot/dts/qcom/sc7180.dtsi +2 -0
+               tsens0: thermal-sensor@c263000 {
+                       compatible = 
 "qcom,sc7180-tsens","qcom,tsens-v2";

Can you please send a patch listing this configuration in "Documentation/devicetree/bindings/thermal/qcom-tsens.yaml"? You shouldn't need to re-send the dts since it looks like it's already landed, but it's good to get the bindings happy.

Sure, i will send the patch, adding this configuration in qcom-tsens.yaml.

Quoted 4 lines

Thanks!

-Rajeshwari

#5 lore raw

Re: [PATCH v2 1/1] arm64: dts: qcom: sc7180: Add device node support for TSENS in SC7180

In reply to Doug Anderson
Quoted 35 lines · Doug Anderson

Hi,

Quoted 16 lines · Rajeshwari

Add TSENS node and user thermal zone for TSENS sensors in SC7180.

---
 arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 
+++++++++++++++++++++++++++++++++++
 1 file changed, 527 insertions(+)
arch/arm64/boot/dts/qcom/sc7180.dtsi +0 -0
index 666e9b9..6656ffc 100644
@@ -911,6 +911,26 @@
                        status = "disabled";
                };

arch/arm64/boot/dts/qcom/sc7180.dtsi line 922

Quoted 10 lines
arch/arm64/boot/dts/qcom/sc7180.dtsi +7 -0
 
+               tsens0: thermal-sensor@c263000 {
+                       compatible = 
 "qcom,sc7180-tsens","qcom,tsens-v2";
+                       reg = <0 0x0c263000 0 0x1ff>, /* TM */
+                               <0 0x0c222000 0 0x1ff>; /* SROT */
+                       #qcom,sensors = <15>;
+                       interrupts = <GIC_SPI 506 
 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "uplow";

Can you also send a patch to match Amit's ("arm64: dts: sdm845:
thermal: Add critical interrupt support") [1]. If I'm reading things correctly it should be 508 for tsens0 and 509 for tsens1 just like on sdm845.

Quoted 2 lines

[1]
https://lore.kernel.org/r/c536e9cdb448bbad3441f6580fa57f1f921fb580.1573499020.git.amit.kucheria@linaro.org

yes, i will send the patch for critical interrupt support.

Quoted 5 lines

Thanks!

-Rajeshwari

#6 lore raw

Re: [PATCH v2 1/1] arm64: dts: qcom: sc7180: Add device node support for TSENS in SC7180

In reply to Rajeshwari

Hi Rajeshwari,

Quoted 58 lines · Rajeshwari

Add TSENS node and user thermal zone for TSENS sensors in SC7180.

---
 arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 +++++++++++++++++++++++++++++++++++
 1 file changed, 527 insertions(+)
arch/arm64/boot/dts/qcom/sc7180.dtsi +35 -0
index 666e9b9..6656ffc 100644
@@ -911,6 +911,26 @@
                        status = "disabled";
                };
 
+               tsens0: thermal-sensor@c263000 {
+                       compatible = "qcom,sc7180-tsens","qcom,tsens-v2";
+                       reg = <0 0x0c263000 0 0x1ff>, /* TM */
+                               <0 0x0c222000 0 0x1ff>; /* SROT */
+                       #qcom,sensors = <15>;
+                       interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "uplow";
+                       #thermal-sensor-cells = <1>;
+               };
+
+               tsens1: thermal-sensor@c265000 {
+                       compatible = "qcom,sc7180-tsens","qcom,tsens-v2";
+                       reg = <0 0x0c265000 0 0x1ff>, /* TM */
+                               <0 0x0c223000 0 0x1ff>; /* SROT */
+                       #qcom,sensors = <10>;
+                       interrupts = <GIC_SPI 507 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "uplow";
+                       #thermal-sensor-cells = <1>;
+               };
+
                spmi_bus: spmi@c440000 {
                        compatible = "qcom,spmi-pmic-arb";
                        reg = <0 0x0c440000 0 0x1100>,
@@ -1121,6 +1141,513 @@
                };
        };
 
+       thermal-zones {
+               cpu0-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 1>;
+
+                       trips {
+                               cpu0_alert0: trip-point0 {
+                                       temperature = <90000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu0_alert1: trip-point1 {

arch/arm64/boot/dts/qcom/sc7180.dtsi line 1168

Quoted 10 lines
arch/arm64/boot/dts/qcom/sc7180.dtsi +10 -0
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu0_crit: cpu_crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };

Where are the cooling maps for all the cpu thermal zones? A passive trip point w/o a cooling map is not of much use. If you are waiting for cpufreq support to land before adding them, then remove the passive trip points for now and add them along with the cooling maps when you have cooling devices.

Quoted 246 lines
arch/arm64/boot/dts/qcom/sc7180.dtsi +246 -0
+                       };
+               };
+
+               cpu1-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 2>;
+
+                       trips {
+                               cpu1_alert0: trip-point0 {
+                                       temperature = <90000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu1_alert1: trip-point1 {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu1_crit: cpu_crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               cpu2-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 3>;
+
+                       trips {
+                               cpu2_alert0: trip-point0 {
+                                       temperature = <90000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu2_alert1: trip-point1 {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu2_crit: cpu_crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               cpu3-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 4>;
+
+                       trips {
+                               cpu3_alert0: trip-point0 {
+                                       temperature = <90000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu3_alert1: trip-point1 {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu3_crit: cpu_crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               cpu4-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 5>;
+
+                       trips {
+                               cpu4_alert0: trip-point0 {
+                                       temperature = <90000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu4_alert1: trip-point1 {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu4_crit: cpu_crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               cpu5-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 6>;
+
+                       trips {
+                               cpu5_alert0: trip-point0 {
+                                       temperature = <90000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu5_alert1: trip-point1 {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu5_crit: cpu_crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               cpu6-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 9>;
+
+                       trips {
+                               cpu6_alert0: trip-point0 {
+                                       temperature = <90000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu6_alert1: trip-point1 {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu6_crit: cpu_crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               cpu7-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 10>;
+
+                       trips {
+                               cpu7_alert0: trip-point0 {
+                                       temperature = <90000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu7_alert1: trip-point1 {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu7_crit: cpu_crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               cpu8-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 11>;
+
+                       trips {
+                               cpu8_alert0: trip-point0 {
+                                       temperature = <90000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu8_alert1: trip-point1 {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu8_crit: cpu_crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               cpu9-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 12>;
+
+                       trips {
+                               cpu9_alert0: trip-point0 {
+                                       temperature = <90000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu9_alert1: trip-point1 {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu9_crit: cpu_crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
#7 lore raw

Re: [PATCH v2 1/1] arm64: dts: qcom: sc7180: Add device node support for TSENS in SC7180

Hi,

Quoted 70 lines · Amit Kucheria

Hi Rajeshwari,

Quoted 66 lines · Rajeshwari

Add TSENS node and user thermal zone for TSENS sensors in SC7180.

---
 arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 +++++++++++++++++++++++++++++++++++
 1 file changed, 527 insertions(+)
arch/arm64/boot/dts/qcom/sc7180.dtsi +43 -0
index 666e9b9..6656ffc 100644
@@ -911,6 +911,26 @@
                        status = "disabled";
                };
 
+               tsens0: thermal-sensor@c263000 {
+                       compatible = "qcom,sc7180-tsens","qcom,tsens-v2";
+                       reg = <0 0x0c263000 0 0x1ff>, /* TM */
+                               <0 0x0c222000 0 0x1ff>; /* SROT */
+                       #qcom,sensors = <15>;
+                       interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "uplow";
+                       #thermal-sensor-cells = <1>;
+               };
+
+               tsens1: thermal-sensor@c265000 {
+                       compatible = "qcom,sc7180-tsens","qcom,tsens-v2";
+                       reg = <0 0x0c265000 0 0x1ff>, /* TM */
+                               <0 0x0c223000 0 0x1ff>; /* SROT */
+                       #qcom,sensors = <10>;
+                       interrupts = <GIC_SPI 507 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "uplow";
+                       #thermal-sensor-cells = <1>;
+               };
+
                spmi_bus: spmi@c440000 {
                        compatible = "qcom,spmi-pmic-arb";
                        reg = <0 0x0c440000 0 0x1100>,
@@ -1121,6 +1141,513 @@
                };
        };
 
+       thermal-zones {
+               cpu0-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 1>;
+
+                       trips {
+                               cpu0_alert0: trip-point0 {
+                                       temperature = <90000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu0_alert1: trip-point1 {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu0_crit: cpu_crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
Quoted 8 lines

arch/arm64/boot/dts/qcom/sc7180.dtsi line 1168

Quoted 2 lines
arch/arm64/boot/dts/qcom/sc7180.dtsi +2 -0
+                                       type = "critical";
+                               };

Where are the cooling maps for all the cpu thermal zones? A passive trip point w/o a cooling map is not of much use. If you are waiting for cpufreq support to land before adding them, then remove the passive trip points for now and add them along with the cooling maps when you have cooling devices.

I will note that cpufreq support has landed in the qcom tree::

https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git/commit/?h=for-next&id=86899d8235ea0d3d7c293404fb43a6fabff866e6

...so I guess the right thing is to send a patch adding the cooling maps for the cpu thermal zones?

-Doug

#8 lore raw

Re: [PATCH v2 1/1] arm64: dts: qcom: sc7180: Add device node support for TSENS in SC7180

Quoted 84 lines · Doug Anderson

Hi,

Quoted 70 lines · Amit Kucheria

Hi Rajeshwari,

Quoted 66 lines · Rajeshwari

Add TSENS node and user thermal zone for TSENS sensors in SC7180.

---
 arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 +++++++++++++++++++++++++++++++++++
 1 file changed, 527 insertions(+)
arch/arm64/boot/dts/qcom/sc7180.dtsi +43 -0
index 666e9b9..6656ffc 100644
@@ -911,6 +911,26 @@
                        status = "disabled";
                };
 
+               tsens0: thermal-sensor@c263000 {
+                       compatible = "qcom,sc7180-tsens","qcom,tsens-v2";
+                       reg = <0 0x0c263000 0 0x1ff>, /* TM */
+                               <0 0x0c222000 0 0x1ff>; /* SROT */
+                       #qcom,sensors = <15>;
+                       interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "uplow";
+                       #thermal-sensor-cells = <1>;
+               };
+
+               tsens1: thermal-sensor@c265000 {
+                       compatible = "qcom,sc7180-tsens","qcom,tsens-v2";
+                       reg = <0 0x0c265000 0 0x1ff>, /* TM */
+                               <0 0x0c223000 0 0x1ff>; /* SROT */
+                       #qcom,sensors = <10>;
+                       interrupts = <GIC_SPI 507 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "uplow";
+                       #thermal-sensor-cells = <1>;
+               };
+
                spmi_bus: spmi@c440000 {
                        compatible = "qcom,spmi-pmic-arb";
                        reg = <0 0x0c440000 0 0x1100>,
@@ -1121,6 +1141,513 @@
                };
        };
 
+       thermal-zones {
+               cpu0-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 1>;
+
+                       trips {
+                               cpu0_alert0: trip-point0 {
+                                       temperature = <90000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu0_alert1: trip-point1 {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu0_crit: cpu_crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
Quoted 8 lines

arch/arm64/boot/dts/qcom/sc7180.dtsi line 1168

Quoted 2 lines
arch/arm64/boot/dts/qcom/sc7180.dtsi +2 -0
+                                       type = "critical";
+                               };

Where are the cooling maps for all the cpu thermal zones? A passive trip point w/o a cooling map is not of much use. If you are waiting for cpufreq support to land before adding them, then remove the passive trip points for now and add them along with the cooling maps when you have cooling devices.

Quoted 6 lines

I will note that cpufreq support has landed in the qcom tree::

https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git/commit/?h=for-next&id=86899d8235ea0d3d7c293404fb43a6fabff866e6

...so I guess the right thing is to send a patch adding the cooling maps for the cpu thermal zones?

Great, then the cooling maps should be added to this patch itself.

#9 lore raw

Re: [PATCH v2 1/1] arm64: dts: qcom: sc7180: Add device node support for TSENS in SC7180

Hi,

Quoted 86 lines · Amit Kucheria
Quoted 84 lines · Doug Anderson

Hi,

Quoted 78 lines · Amit Kucheria

Hi Rajeshwari,

Quoted 58 lines · Rajeshwari

Add TSENS node and user thermal zone for TSENS sensors in SC7180.

---
 arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 +++++++++++++++++++++++++++++++++++
 1 file changed, 527 insertions(+)
arch/arm64/boot/dts/qcom/sc7180.dtsi +35 -0
index 666e9b9..6656ffc 100644
@@ -911,6 +911,26 @@
                        status = "disabled";
                };
 
+               tsens0: thermal-sensor@c263000 {
+                       compatible = "qcom,sc7180-tsens","qcom,tsens-v2";
+                       reg = <0 0x0c263000 0 0x1ff>, /* TM */
+                               <0 0x0c222000 0 0x1ff>; /* SROT */
+                       #qcom,sensors = <15>;
+                       interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "uplow";
+                       #thermal-sensor-cells = <1>;
+               };
+
+               tsens1: thermal-sensor@c265000 {
+                       compatible = "qcom,sc7180-tsens","qcom,tsens-v2";
+                       reg = <0 0x0c265000 0 0x1ff>, /* TM */
+                               <0 0x0c223000 0 0x1ff>; /* SROT */
+                       #qcom,sensors = <10>;
+                       interrupts = <GIC_SPI 507 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "uplow";
+                       #thermal-sensor-cells = <1>;
+               };
+
                spmi_bus: spmi@c440000 {
                        compatible = "qcom,spmi-pmic-arb";
                        reg = <0 0x0c440000 0 0x1100>,
@@ -1121,6 +1141,513 @@
                };
        };
 
+       thermal-zones {
+               cpu0-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 1>;
+
+                       trips {
+                               cpu0_alert0: trip-point0 {
+                                       temperature = <90000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu0_alert1: trip-point1 {

arch/arm64/boot/dts/qcom/sc7180.dtsi line 1168

Quoted 10 lines
arch/arm64/boot/dts/qcom/sc7180.dtsi +10 -0
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu0_crit: cpu_crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };

Where are the cooling maps for all the cpu thermal zones? A passive trip point w/o a cooling map is not of much use. If you are waiting for cpufreq support to land before adding them, then remove the passive trip points for now and add them along with the cooling maps when you have cooling devices.

Quoted 8 lines
Quoted 6 lines

I will note that cpufreq support has landed in the qcom tree::

https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git/commit/?h=for-next&id=86899d8235ea0d3d7c293404fb43a6fabff866e6

...so I guess the right thing is to send a patch adding the cooling maps for the cpu thermal zones?

Great, then the cooling maps should be added to this patch itself.

Well, except that this patch itself has also landed:

https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git/commit/?h=for-next&id=82bdc93972bf293c3407cb7fdac163aadfbb2c12

...so I think my advice is still correct: the right thing is to send a patch adding the cooling maps for the cpu thermal zones

-Doug

#10 lore raw

Re: [PATCH v2 1/1] arm64: dts: qcom: sc7180: Add device node support for TSENS in SC7180

Quoted 98 lines · Doug Anderson

Hi,

Quoted 93 lines · Amit Kucheria
Quoted 90 lines · Doug Anderson

Hi,

Quoted 70 lines · Amit Kucheria

Hi Rajeshwari,

Quoted 66 lines · Rajeshwari

Add TSENS node and user thermal zone for TSENS sensors in SC7180.

---
 arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 +++++++++++++++++++++++++++++++++++
 1 file changed, 527 insertions(+)
arch/arm64/boot/dts/qcom/sc7180.dtsi +43 -0
index 666e9b9..6656ffc 100644
@@ -911,6 +911,26 @@
                        status = "disabled";
                };
 
+               tsens0: thermal-sensor@c263000 {
+                       compatible = "qcom,sc7180-tsens","qcom,tsens-v2";
+                       reg = <0 0x0c263000 0 0x1ff>, /* TM */
+                               <0 0x0c222000 0 0x1ff>; /* SROT */
+                       #qcom,sensors = <15>;
+                       interrupts = <GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "uplow";
+                       #thermal-sensor-cells = <1>;
+               };
+
+               tsens1: thermal-sensor@c265000 {
+                       compatible = "qcom,sc7180-tsens","qcom,tsens-v2";
+                       reg = <0 0x0c265000 0 0x1ff>, /* TM */
+                               <0 0x0c223000 0 0x1ff>; /* SROT */
+                       #qcom,sensors = <10>;
+                       interrupts = <GIC_SPI 507 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "uplow";
+                       #thermal-sensor-cells = <1>;
+               };
+
                spmi_bus: spmi@c440000 {
                        compatible = "qcom,spmi-pmic-arb";
                        reg = <0 0x0c440000 0 0x1100>,
@@ -1121,6 +1141,513 @@
                };
        };
 
+       thermal-zones {
+               cpu0-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 1>;
+
+                       trips {
+                               cpu0_alert0: trip-point0 {
+                                       temperature = <90000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu0_alert1: trip-point1 {
+                                       temperature = <95000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu0_crit: cpu_crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
Quoted 8 lines

arch/arm64/boot/dts/qcom/sc7180.dtsi line 1168

Quoted 2 lines
arch/arm64/boot/dts/qcom/sc7180.dtsi +2 -0
+                                       type = "critical";
+                               };

Where are the cooling maps for all the cpu thermal zones? A passive trip point w/o a cooling map is not of much use. If you are waiting for cpufreq support to land before adding them, then remove the passive trip points for now and add them along with the cooling maps when you have cooling devices.

I will note that cpufreq support has landed in the qcom tree::

https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git/commit/?h=for-next&id=86899d8235ea0d3d7c293404fb43a6fabff866e6

...so I guess the right thing is to send a patch adding the cooling maps for the cpu thermal zones?

Quoted 8 lines
Quoted 1 line

Great, then the cooling maps should be added to this patch itself.

Well, except that this patch itself has also landed:

https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git/commit/?h=for-next&id=82bdc93972bf293c3407cb7fdac163aadfbb2c12

...so I think my advice is still correct: the right thing is to send a patch adding the cooling maps for the cpu thermal zones

In that case, yes.