Skip to contentSkip to conversation

Enable IPQ9574 TSENS support

PATCH In review Varadarajan Narayanan 3 participants 16 messages Apr 28, 2023 – May 5, 2023

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover Enable IPQ9574 TSENS support

This patch set enables tsens in IPQ9574

Depends on

	https://lore.kernel.org/linux-arm-msm/[email protected]/

Praveenkumar I (2):
dt-bindings: thermal: tsens: Add ipq9574 compatible thermal/drivers/tsens: Add IPQ9574 support

Varadarajan Narayanan (2):
arm64: dts: qcom: ipq9574: add tsens node
arm64: dts: qcom: ipq9574: add thermal zone nodes

 .../devicetree/bindings/thermal/qcom-tsens.yaml    |   3 +
 arch/arm64/boot/dts/qcom/ipq9574.dtsi              | 217 +++++++++++++++++++++
 drivers/thermal/qcom/tsens.c                       |   3 +
 3 files changed, 223 insertions(+)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/4 dt-bindings: thermal: tsens: Add ipq9574 compatible

From: Praveenkumar I <[email protected]>

Qualcomm IPQ9574 has tsens v2.3.1 block, which is similar to IPQ8074 tsens.

---
 Documentation/devicetree/bindings/thermal/qcom-tsens.yaml | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/thermal/qcom-tsens.yaml +3 -0
index d1ec963..8e2208c 100644
@@ -66,6 +66,7 @@ properties:
       - description: v2 of TSENS with combined interrupt
         enum:
           - qcom,ipq8074-tsens
+          - qcom,ipq9574-tsens
 
   reg:
     items:
@@ -277,6 +278,7 @@ allOf:
           contains:
             enum:
               - qcom,ipq8074-tsens
+              - qcom,ipq9574-tsens
     then:
       properties:
         interrupts:
@@ -292,6 +294,7 @@ allOf:
           contains:
             enum:
               - qcom,ipq8074-tsens
+              - qcom,ipq9574-tsens
               - qcom,tsens-v0_1
               - qcom,tsens-v1
               - qcom,tsens-v2
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH 1/4] dt-bindings: thermal: tsens: Add ipq9574 compatible

Quoted 15 lines · Varadarajan Narayanan

From: Praveenkumar I <[email protected]>

Qualcomm IPQ9574 has tsens v2.3.1 block, which is similar to IPQ8074 tsens.

---
 Documentation/devicetree/bindings/thermal/qcom-tsens.yaml | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/thermal/qcom-tsens.yaml +0 -0
index d1ec963..8e2208c 100644

Documentation/devicetree/bindings/thermal/qcom-tsens.yaml properties: · line 69

Quoted 4 lines
Documentation/devicetree/bindings/thermal/qcom-tsens.yaml +1 -0
@@ -66,6 +66,7 @@ properties:
       - description: v2 of TSENS with combined interrupt
         enum:
           - qcom,ipq8074-tsens
+          - qcom,ipq9574-tsens

Your drive change indicates they are compatible, so make them compatible. 9574 followed by 8074.

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH 1/4] dt-bindings: thermal: tsens: Add ipq9574 compatible

Quoted 11 lines · Krzysztof Kozlowski
Quoted 10 lines · Varadarajan Narayanan

From: Praveenkumar I <[email protected]>

Qualcomm IPQ9574 has tsens v2.3.1 block, which is similar to IPQ8074 tsens.

---
 Documentation/devicetree/bindings/thermal/qcom-tsens.yaml | 3 +++
 1 file changed, 3 insertions(+)
Quoted 12 lines

Documentation/devicetree/bindings/thermal/qcom-tsens.yaml properties: · line 69

Quoted 9 lines
Documentation/devicetree/bindings/thermal/qcom-tsens.yaml +1 -0
index d1ec963..8e2208c 100644
@@ -66,6 +66,7 @@ properties:
       - description: v2 of TSENS with combined interrupt
         enum:
           - qcom,ipq8074-tsens
+          - qcom,ipq9574-tsens

Your drive change indicates they are compatible, so make them compatible. 9574 followed by 8074.

Not able to understand. You want IPQ9574 to use "qcom,ipq8074-tsens" instead of adding a "qcom,ipq9574-tsens" and no need to add an extra entry to the driver like

	}, {
		.compatible = "qcom,ipq9574-tsens",
		.data = &data_ipq8074,
	}, {

Thanks
Varada

Quoted 3 lines

Best regards,
Krzysztof

#4 lore raw

Re: [PATCH 1/4] dt-bindings: thermal: tsens: Add ipq9574 compatible

Quoted 25 lines · Varadarajan Narayanan
Quoted 11 lines · Krzysztof Kozlowski
Quoted 10 lines · Varadarajan Narayanan

From: Praveenkumar I <[email protected]>

Qualcomm IPQ9574 has tsens v2.3.1 block, which is similar to IPQ8074 tsens.

---
 Documentation/devicetree/bindings/thermal/qcom-tsens.yaml | 3 +++
 1 file changed, 3 insertions(+)
Quoted 12 lines

Documentation/devicetree/bindings/thermal/qcom-tsens.yaml properties: · line 69

Quoted 9 lines
Documentation/devicetree/bindings/thermal/qcom-tsens.yaml +1 -0
index d1ec963..8e2208c 100644
@@ -66,6 +66,7 @@ properties:
       - description: v2 of TSENS with combined interrupt
         enum:
           - qcom,ipq8074-tsens
+          - qcom,ipq9574-tsens

Your drive change indicates they are compatible, so make them compatible. 9574 followed by 8074.

Quoted 3 lines

Not able to understand. You want IPQ9574 to use "qcom,ipq8074-tsens" instead of adding a "qcom,ipq9574-tsens" and no need to add an extra entry to the driver like

Assuming the devices are really compatible, which your driver change suggests, I want to use two compatibles. 9574 followed by 8074 fallback, just like we do for all Qualcomm IP blocks. Then as you said - no need for driver change.

Best regards,
Krzysztof

#5 lore raw

Re: [PATCH 1/4] dt-bindings: thermal: tsens: Add ipq9574 compatible

Quoted 26 lines · Krzysztof Kozlowski
Quoted 25 lines · Varadarajan Narayanan
Quoted 23 lines · Krzysztof Kozlowski
Quoted 15 lines · Varadarajan Narayanan

From: Praveenkumar I <[email protected]>

Qualcomm IPQ9574 has tsens v2.3.1 block, which is similar to IPQ8074 tsens.

---
 Documentation/devicetree/bindings/thermal/qcom-tsens.yaml | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/thermal/qcom-tsens.yaml +0 -0
index d1ec963..8e2208c 100644

Documentation/devicetree/bindings/thermal/qcom-tsens.yaml properties: · line 69

Quoted 4 lines
Documentation/devicetree/bindings/thermal/qcom-tsens.yaml +1 -0
@@ -66,6 +66,7 @@ properties:
       - description: v2 of TSENS with combined interrupt
         enum:
           - qcom,ipq8074-tsens
+          - qcom,ipq9574-tsens

Your drive change indicates they are compatible, so make them compatible. 9574 followed by 8074.

Quoted 8 lines
Quoted 3 lines

Not able to understand. You want IPQ9574 to use "qcom,ipq8074-tsens" instead of adding a "qcom,ipq9574-tsens" and no need to add an extra entry to the driver like

Assuming the devices are really compatible, which your driver change suggests, I want to use two compatibles. 9574 followed by 8074 fallback, just like we do for all Qualcomm IP blocks. Then as you said - no need for driver change.

With schema like this
items:
- enum:
- qcom,ipq8074-tsens
- qcom,ipq9574-tsens
and DTS as

	compatible = "qcom,ipq9574-tsens", "qcom,ipq8074-tsens";

'make dtbs_check' gives the following error

arch/arm64/boot/dts/qcom/ipq9574-rdp433.dtb: thermal-sensor@4a9000: compatible: 'oneOf' conditional failed, one must be fixed:

        ['qcom,ipq9574-tsens', 'qcom,ipq8074-tsens'] is too long

To fix the above error, I have to change the schema as

items:
- enum:
- qcom,ipq8074-tsens
- qcom,ipq9574-tsens
- const: qcom,tsens-v2-combined-int

and change ipq8074 & ipq9754 DTS as

	compatible = "qcom,ipq8074-tsens", "qcom,tsens-v2-combined-int";
	compatible = "qcom,ipq9574-tsens", "qcom,tsens-v2-combined-int";

For this to work, have to introduce qcom,tsens-v2-combined-int in the driver with

	}, {
		.compatible = "qcom,tsens-v2-combined-int",
		.data = &data_ipq8074,
	},

This i guess will defeat the purpose. So shall we leave it as it is now, or shall I change driver, schema and ipq8074 + ip9574 DTS with qcom,tsens-v2-combined-int? Let me know.

Thanks
Varada

Quoted 2 lines

Best regards,
Krzysztof

#6 lore raw

Re: [PATCH 1/4] dt-bindings: thermal: tsens: Add ipq9574 compatible

Quoted 36 lines · Varadarajan Narayanan
Quoted 26 lines · Krzysztof Kozlowski
Quoted 25 lines · Varadarajan Narayanan
Quoted 23 lines · Krzysztof Kozlowski
Quoted 15 lines · Varadarajan Narayanan

From: Praveenkumar I <[email protected]>

Qualcomm IPQ9574 has tsens v2.3.1 block, which is similar to IPQ8074 tsens.

---
 Documentation/devicetree/bindings/thermal/qcom-tsens.yaml | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/thermal/qcom-tsens.yaml +0 -0
index d1ec963..8e2208c 100644

Documentation/devicetree/bindings/thermal/qcom-tsens.yaml properties: · line 69

Quoted 4 lines
Documentation/devicetree/bindings/thermal/qcom-tsens.yaml +1 -0
@@ -66,6 +66,7 @@ properties:
       - description: v2 of TSENS with combined interrupt
         enum:
           - qcom,ipq8074-tsens
+          - qcom,ipq9574-tsens

Your drive change indicates they are compatible, so make them compatible. 9574 followed by 8074.

Quoted 8 lines
Quoted 3 lines

Not able to understand. You want IPQ9574 to use "qcom,ipq8074-tsens" instead of adding a "qcom,ipq9574-tsens" and no need to add an extra entry to the driver like

Assuming the devices are really compatible, which your driver change suggests, I want to use two compatibles. 9574 followed by 8074 fallback, just like we do for all Qualcomm IP blocks. Then as you said - no need for driver change.

Quoted 7 lines

With schema like this
items:
- enum:
- qcom,ipq8074-tsens
- qcom,ipq9574-tsens
and DTS as

	compatible = "qcom,ipq9574-tsens", "qcom,ipq8074-tsens";

This file (and many others) shows you how to encode it in the DT schema

https://elixir.bootlin.com/linux/v6.3-rc6/source/Documentation/devicetree/bindings/sound/nvidia,tegra210-ope.yaml#L31

Quoted 6 lines

'make dtbs_check' gives the following error

arch/arm64/boot/dts/qcom/ipq9574-rdp433.dtb: thermal-sensor@4a9000: compatible: 'oneOf' conditional failed, one must be fixed:

        ['qcom,ipq9574-tsens', 'qcom,ipq8074-tsens'] is too long
Quoted 7 lines

To fix the above error, I have to change the schema as

items:
- enum:
- qcom,ipq8074-tsens
- qcom,ipq9574-tsens
- const: qcom,tsens-v2-combined-int

This is not what we talked about.

Best regards,
Krzysztof

#7 lore raw

Re: [PATCH 1/4] dt-bindings: thermal: tsens: Add ipq9574 compatible

Quoted 45 lines · Krzysztof Kozlowski
Quoted 36 lines · Varadarajan Narayanan
Quoted 26 lines · Krzysztof Kozlowski
Quoted 25 lines · Varadarajan Narayanan
Quoted 23 lines · Krzysztof Kozlowski
Quoted 15 lines · Varadarajan Narayanan

From: Praveenkumar I <[email protected]>

Qualcomm IPQ9574 has tsens v2.3.1 block, which is similar to IPQ8074 tsens.

---
 Documentation/devicetree/bindings/thermal/qcom-tsens.yaml | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/thermal/qcom-tsens.yaml +0 -0
index d1ec963..8e2208c 100644

Documentation/devicetree/bindings/thermal/qcom-tsens.yaml properties: · line 69

Quoted 4 lines
Documentation/devicetree/bindings/thermal/qcom-tsens.yaml +1 -0
@@ -66,6 +66,7 @@ properties:
       - description: v2 of TSENS with combined interrupt
         enum:
           - qcom,ipq8074-tsens
+          - qcom,ipq9574-tsens

Your drive change indicates they are compatible, so make them compatible. 9574 followed by 8074.

Quoted 8 lines
Quoted 3 lines

Not able to understand. You want IPQ9574 to use "qcom,ipq8074-tsens" instead of adding a "qcom,ipq9574-tsens" and no need to add an extra entry to the driver like

Assuming the devices are really compatible, which your driver change suggests, I want to use two compatibles. 9574 followed by 8074 fallback, just like we do for all Qualcomm IP blocks. Then as you said - no need for driver change.

Quoted 7 lines

With schema like this
items:
- enum:
- qcom,ipq8074-tsens
- qcom,ipq9574-tsens
and DTS as

	compatible = "qcom,ipq9574-tsens", "qcom,ipq8074-tsens";
Quoted 3 lines

This file (and many others) shows you how to encode it in the DT schema

https://elixir.bootlin.com/linux/v6.3-rc6/source/Documentation/devicetree/bindings/sound/nvidia,tegra210-ope.yaml#L31

Thanks for the pointer.
Will rework and post.

-Varada

Quoted 18 lines
Quoted 5 lines

'make dtbs_check' gives the following error

arch/arm64/boot/dts/qcom/ipq9574-rdp433.dtb: thermal-sensor@4a9000: compatible: 'oneOf' conditional failed, one must be fixed:

        ['qcom,ipq9574-tsens', 'qcom,ipq8074-tsens'] is too long
Quoted 7 lines

To fix the above error, I have to change the schema as

items:
- enum:
- qcom,ipq8074-tsens
- qcom,ipq9574-tsens
- const: qcom,tsens-v2-combined-int

This is not what we talked about.

Best regards,
Krzysztof

#8 lore raw

PATCH 2/4 thermal/drivers/tsens: Add IPQ9574 support

In reply to Varadarajan Narayanan

From: Praveenkumar I <[email protected]>

Qualcomm IPQ9574 uses tsens v2.3.1 IP, which is similar to IPQ8074 tsens. Hence reusing the data_ipq8074 for IPQ9574.

---
 drivers/thermal/qcom/tsens.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/thermal/qcom/tsens.c +3 -0
index d321812..e752b7d 100644
@@ -1093,6 +1093,9 @@ static const struct of_device_id tsens_table[] = {
 		.compatible = "qcom,ipq8074-tsens",
 		.data = &data_ipq8074,
 	}, {
+		.compatible = "qcom,ipq9574-tsens",
+		.data = &data_ipq8074,
+	}, {
 		.compatible = "qcom,mdm9607-tsens",
 		.data = &data_9607,
 	}, {
Signature · 1 line
2.7.4
#9 lore raw

PATCH 3/4 arm64: dts: qcom: ipq9574: add tsens node

In reply to Varadarajan Narayanan

IPQ9574 has a tsens v2.3.1 peripheral which monitors temperatures around the various subsystems on the die.

---
 arch/arm64/boot/dts/qcom/ipq9574.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/qcom/ipq9574.dtsi +9 -0
index 93b4ba9..7cd5bdb 100644
@@ -936,6 +936,15 @@
 			status = "disabled";
 		};
 
+		tsens: thermal-sensor@4a9000 {
+			compatible = "qcom,ipq9574-tsens";
+			reg = <0x4a9000 0x1000>, /* TM */
+			      <0x4a8000 0x1000>; /* SROT */
+			interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "combined";
+			#qcom,sensors = <16>;
+			#thermal-sensor-cells = <1>;
+		};
 	};
 
 	timer {
Signature · 1 line
2.7.4
#10 lore raw

PATCH 4/4 arm64: dts: qcom: ipq9574: add thermal zone nodes

In reply to Varadarajan Narayanan

This patch adds thermal zone nodes for the various sensors present in IPQ9574

---
 arch/arm64/boot/dts/qcom/ipq9574.dtsi | 208 ++++++++++++++++++++++++++++++++++
 1 file changed, 208 insertions(+)
arch/arm64/boot/dts/qcom/ipq9574.dtsi +208 -0
index 7cd5bdb..a7cb2b4c 100644
@@ -947,6 +947,214 @@
 		};
 	};
 
+	thermal_zones: thermal-zones {
+		tsens_tz_sensor3 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 3>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		tsens_tz_sensor4 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 4>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		tsens_tz_sensor5 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 5>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		tsens_tz_sensor6 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 6>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		tsens_tz_sensor7 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 7>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		tsens_tz_sensor8 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 8>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		tsens_tz_sensor9 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 9>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		tsens_tz_sensor10 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 10>;
+
+			trips {
+				cpu-critical {
+					temperature = <120000>;
+					hysteresis = <10000>;
+					type = "critical";
+				};
+
+				cpu-passive {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+			};
+		};
+
+		tsens_tz_sensor11 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 11>;
+
+			trips {
+				cpu-critical {
+					temperature = <120000>;
+					hysteresis = <10000>;
+					type = "critical";
+				};
+
+				cpu-passive {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+			};
+		};
+
+		tsens_tz_sensor12 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 12>;
+
+			trips {
+				cpu-critical {
+					temperature = <120000>;
+					hysteresis = <10000>;
+					type = "critical";
+				};
+
+				cpu-passive {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+			};
+		};
+
+		tsens_tz_sensor13 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 13>;
+
+			trips {
+				cpu-critical {
+					temperature = <120000>;
+					hysteresis = <10000>;
+					type = "critical";
+				};
+
+				cpu-passive {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+			};
+		};
+
+		tsens_tz_sensor14 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 14>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		tsens_tz_sensor15 {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 15>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+	};
+
 	timer {
 		compatible = "arm,armv8-timer";
 		interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
Signature · 1 line
2.7.4
#11 lore raw

Re: [PATCH 4/4] arm64: dts: qcom: ipq9574: add thermal zone nodes

Quoted 15 lines · Varadarajan Narayanan

This patch adds thermal zone nodes for the various sensors present in IPQ9574

---
 arch/arm64/boot/dts/qcom/ipq9574.dtsi | 208 ++++++++++++++++++++++++++++++++++
 1 file changed, 208 insertions(+)
arch/arm64/boot/dts/qcom/ipq9574.dtsi +0 -0
index 7cd5bdb..a7cb2b4c 100644

arch/arm64/boot/dts/qcom/ipq9574.dtsi line 951

Quoted 5 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +2 -0
@@ -947,6 +947,214 @@
                };
        };
 
+       thermal_zones: thermal-zones {
+               tsens_tz_sensor3 {

Please provide sensible names for all thermal zones. Please follow the examples in other DT files.

arch/arm64/boot/dts/qcom/ipq9574.dtsi line 958

Quoted 7 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +7 -0
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 3>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;

Can it really go up to 125 °C?

arch/arm64/boot/dts/qcom/ipq9574.dtsi line 961

Quoted 3 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +3 -0
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };

Please provide also a passive trip point, so that the passive cooling can be engaged.

Quoted 202 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +196 -1
+                       };
+               };
+
+               tsens_tz_sensor4 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 4>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor5 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 5>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor6 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 6>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor7 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 7>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor8 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 8>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor9 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 9>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor10 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 10>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <120000>;
+                                       hysteresis = <10000>;
+                                       type = "critical";
+                               };
+
+                               cpu-passive {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor11 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 11>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <120000>;
+                                       hysteresis = <10000>;
+                                       type = "critical";
+                               };
+
+                               cpu-passive {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor12 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 12>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <120000>;
+                                       hysteresis = <10000>;
+                                       type = "critical";
+                               };
+
+                               cpu-passive {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor13 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 13>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <120000>;
+                                       hysteresis = <10000>;
+                                       type = "critical";
+                               };
+
+                               cpu-passive {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor14 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 14>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor15 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 15>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+       };
+
        timer {
                compatible = "arm,armv8-timer";
                interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
--

2.7.4

Signature · 2 lines
With best wishes
Dmitry
#12 lore raw

Re: [PATCH 4/4] arm64: dts: qcom: ipq9574: add thermal zone nodes

Quoted 20 lines · Dmitry Baryshkov
Quoted 18 lines · Varadarajan Narayanan

This patch adds thermal zone nodes for the various sensors present in IPQ9574

---
 arch/arm64/boot/dts/qcom/ipq9574.dtsi | 208 ++++++++++++++++++++++++++++++++++
 1 file changed, 208 insertions(+)
arch/arm64/boot/dts/qcom/ipq9574.dtsi +0 -0
index 7cd5bdb..a7cb2b4c 100644
@@ -947,6 +947,214 @@
                };
        };
 
Quoted 5 lines

arch/arm64/boot/dts/qcom/ipq9574.dtsi line 951

Quoted 2 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +2 -0
+       thermal_zones: thermal-zones {
+               tsens_tz_sensor3 {

Please provide sensible names for all thermal zones. Please follow the examples in other DT files.

Ok.

Quoted 9 lines

arch/arm64/boot/dts/qcom/ipq9574.dtsi line 958

Quoted 7 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +7 -0
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 3>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;

Can it really go up to 125 °C?

The SoC product requirement is 120°C. It is capable of 125°C. This was tested inside a thermal chamber and ensured that it hits 125°C and system reboots at that temperature.

Quoted 6 lines

arch/arm64/boot/dts/qcom/ipq9574.dtsi line 961

Quoted 3 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +3 -0
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };

Please provide also a passive trip point, so that the passive cooling can be engaged.

The linux kernel cannot take any steps to initiate cooling for components other than the 4 CPU cores. The f/w that runs on these IP blocks have to take steps to initiate cooling. Additionally, the passive temperature for the non-cpu sensors are not characterised yet and I don't have the values now.

We have these nodes to be able to read the temperature of the other blocks via the sysfs entry /sys/devices/virtual/thermal/*/temp Have given the critical trip point so that the setup is rebooted if the critical temperature is reached.

Have given passive trip point for the CPU core related thermal nodes (tsens_tz_sensor10, tsens_tz_sensor11, tsens_tz_sensor12 and tsens_tz_sensor13).

If this is not acceptable, please let me know. Will remove the non-cpu nodes and post a patch with just the CPU entries.

Thanks
Varada

Quoted 207 lines
Quoted 200 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +196 -1
+                       };
+               };
+
+               tsens_tz_sensor4 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 4>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor5 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 5>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor6 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 6>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor7 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 7>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor8 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 8>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor9 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 9>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor10 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 10>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <120000>;
+                                       hysteresis = <10000>;
+                                       type = "critical";
+                               };
+
+                               cpu-passive {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor11 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 11>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <120000>;
+                                       hysteresis = <10000>;
+                                       type = "critical";
+                               };
+
+                               cpu-passive {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor12 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 12>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <120000>;
+                                       hysteresis = <10000>;
+                                       type = "critical";
+                               };
+
+                               cpu-passive {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor13 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 13>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <120000>;
+                                       hysteresis = <10000>;
+                                       type = "critical";
+                               };
+
+                               cpu-passive {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor14 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 14>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor15 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 15>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+       };
+
        timer {
                compatible = "arm,armv8-timer";
                interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
--
Quoted 2 lines

2.7.4

--
With best wishes
Dmitry

#13 lore raw

Re: [PATCH 4/4] arm64: dts: qcom: ipq9574: add thermal zone nodes

Quoted 38 lines · Varadarajan Narayanan
Quoted 20 lines · Dmitry Baryshkov
Quoted 18 lines · Varadarajan Narayanan

This patch adds thermal zone nodes for the various sensors present in IPQ9574

---
 arch/arm64/boot/dts/qcom/ipq9574.dtsi | 208 ++++++++++++++++++++++++++++++++++
 1 file changed, 208 insertions(+)
arch/arm64/boot/dts/qcom/ipq9574.dtsi +0 -0
index 7cd5bdb..a7cb2b4c 100644
@@ -947,6 +947,214 @@
                };
        };
 
Quoted 5 lines

arch/arm64/boot/dts/qcom/ipq9574.dtsi line 951

Quoted 2 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +2 -0
+       thermal_zones: thermal-zones {
+               tsens_tz_sensor3 {

Please provide sensible names for all thermal zones. Please follow the examples in other DT files.

Ok.

Quoted 8 lines
Quoted 7 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +7 -0
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 3>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
Quoted 5 lines
Quoted 1 line

Can it really go up to 125 °C?

The SoC product requirement is 120°C. It is capable of 125°C. This was tested inside a thermal chamber and ensured that it hits 125°C and system reboots at that temperature.

ack

Quoted 14 lines
Quoted 7 lines

arch/arm64/boot/dts/qcom/ipq9574.dtsi line 961

Quoted 4 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +3 -0
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };

Please provide also a passive trip point, so that the passive cooling can be engaged.

The linux kernel cannot take any steps to initiate cooling for components other than the 4 CPU cores. The f/w that runs on these IP blocks have to take steps to initiate cooling. Additionally, the passive temperature for the non-cpu sensors are not characterised yet and I don't have the values now.

Quoted 8 lines

We have these nodes to be able to read the temperature of the other blocks via the sysfs entry /sys/devices/virtual/thermal/*/temp Have given the critical trip point so that the setup is rebooted if the critical temperature is reached.

Have given passive trip point for the CPU core related thermal nodes (tsens_tz_sensor10, tsens_tz_sensor11, tsens_tz_sensor12 and tsens_tz_sensor13).

That's the point why we asked for the logical names for the sensors, like we have on the other platforms. Otherwise it is very hard to understand what is going on.

Quoted 3 lines

If this is not acceptable, please let me know. Will remove the non-cpu nodes and post a patch with just the CPU entries.

This is perfectly fine. Please take a look at other DTSI files.

Quoted 211 lines

Thanks
Varada

Quoted 207 lines
Quoted 200 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +196 -1
+                       };
+               };
+
+               tsens_tz_sensor4 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 4>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor5 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 5>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor6 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 6>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor7 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 7>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor8 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 8>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor9 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 9>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor10 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 10>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <120000>;
+                                       hysteresis = <10000>;
+                                       type = "critical";
+                               };
+
+                               cpu-passive {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor11 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 11>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <120000>;
+                                       hysteresis = <10000>;
+                                       type = "critical";
+                               };
+
+                               cpu-passive {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor12 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 12>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <120000>;
+                                       hysteresis = <10000>;
+                                       type = "critical";
+                               };
+
+                               cpu-passive {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor13 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 13>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <120000>;
+                                       hysteresis = <10000>;
+                                       type = "critical";
+                               };
+
+                               cpu-passive {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor14 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 14>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               tsens_tz_sensor15 {
+                       polling-delay-passive = <0>;
+                       polling-delay = <0>;
+                       thermal-sensors = <&tsens 15>;
+
+                       trips {
+                               cpu-critical {
+                                       temperature = <125000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+       };
+
        timer {
                compatible = "arm,armv8-timer";
                interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
--
Quoted 2 lines

2.7.4

--
With best wishes
Dmitry

Signature · 2 lines
With best wishes
Dmitry
#14 lore raw

Re: [PATCH 4/4] arm64: dts: qcom: ipq9574: add thermal zone nodes

In reply to Varadarajan Narayanan
Quoted 14 lines · Varadarajan Narayanan

This patch adds thermal zone nodes for the various sensors present in IPQ9574

---
 arch/arm64/boot/dts/qcom/ipq9574.dtsi | 208 ++++++++++++++++++++++++++++++++++
 1 file changed, 208 insertions(+)
arch/arm64/boot/dts/qcom/ipq9574.dtsi +0 -0
index 7cd5bdb..a7cb2b4c 100644

arch/arm64/boot/dts/qcom/ipq9574.dtsi line 951

Quoted 5 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +2 -0
@@ -947,6 +947,214 @@
 		};
 	};
 
+	thermal_zones: thermal-zones {
+		tsens_tz_sensor3 {

No underscores in node names.

Don't invent your own names, use the ones we already have everywhere.

Best regards,
Krzysztof

#15 lore raw

Re: [PATCH 4/4] arm64: dts: qcom: ipq9574: add thermal zone nodes

Quoted 18 lines · Krzysztof Kozlowski
Quoted 17 lines · Varadarajan Narayanan

This patch adds thermal zone nodes for the various sensors present in IPQ9574

---
 arch/arm64/boot/dts/qcom/ipq9574.dtsi | 208 ++++++++++++++++++++++++++++++++++
 1 file changed, 208 insertions(+)
arch/arm64/boot/dts/qcom/ipq9574.dtsi +0 -0
index 7cd5bdb..a7cb2b4c 100644
@@ -947,6 +947,214 @@
 		};
 	};
 
Quoted 6 lines

arch/arm64/boot/dts/qcom/ipq9574.dtsi line 951

Quoted 2 lines
arch/arm64/boot/dts/qcom/ipq9574.dtsi +2 -0
+	thermal_zones: thermal-zones {
+		tsens_tz_sensor3 {

No underscores in node names.

Don't invent your own names, use the ones we already have everywhere.

Thanks for the feedback. Will change and post and new version.

-Varada

Quoted 4 lines

Best regards,
Krzysztof