Subject: [PATCH v2 0/1] 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(+)

--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


Subject: [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.

Signed-off-by: Rajeshwari <[email protected]>
---
arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 +++++++++++++++++++++++++++++++++++
1 file changed, 527 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi b/arch/arm64/boot/dts/qcom/sc7180.dtsi
index 666e9b9..6656ffc 100644
--- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
@@ -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>,
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

2019-12-11 19:04:42

by Doug Anderson

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

Hi,

On Thu, Nov 28, 2019 at 1:55 AM Rajeshwari <[email protected]> wrote:
>
> Add TSENS node and user thermal zone for TSENS sensors in SC7180.
>
> Signed-off-by: Rajeshwari <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 +++++++++++++++++++++++++++++++++++
> 1 file changed, 527 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi b/arch/arm64/boot/dts/qcom/sc7180.dtsi
> index 666e9b9..6656ffc 100644
> --- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
> @@ -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

2019-12-11 19:34:15

by Doug Anderson

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

Hi,

On Thu, Nov 28, 2019 at 1:55 AM Rajeshwari <[email protected]> wrote:
>
> Add TSENS node and user thermal zone for TSENS sensors in SC7180.
>
> Signed-off-by: Rajeshwari <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 +++++++++++++++++++++++++++++++++++
> 1 file changed, 527 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi b/arch/arm64/boot/dts/qcom/sc7180.dtsi
> index 666e9b9..6656ffc 100644
> --- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
> @@ -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

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

On 2019-12-12 00:31, Doug Anderson wrote:
> Hi,
>
> On Thu, Nov 28, 2019 at 1:55 AM Rajeshwari <[email protected]>
> wrote:
>>
>> Add TSENS node and user thermal zone for TSENS sensors in SC7180.
>>
>> Signed-off-by: Rajeshwari <[email protected]>
>> ---
>> arch/arm64/boot/dts/qcom/sc7180.dtsi | 527
>> +++++++++++++++++++++++++++++++++++
>> 1 file changed, 527 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi
>> b/arch/arm64/boot/dts/qcom/sc7180.dtsi
>> index 666e9b9..6656ffc 100644
>> --- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
>> @@ -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.

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

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

On 2019-12-12 01:03, Doug Anderson wrote:
> Hi,
>
> On Thu, Nov 28, 2019 at 1:55 AM Rajeshwari <[email protected]>
> wrote:
>>
>> Add TSENS node and user thermal zone for TSENS sensors in SC7180.
>>
>> Signed-off-by: Rajeshwari <[email protected]>
>> ---
>> arch/arm64/boot/dts/qcom/sc7180.dtsi | 527
>> +++++++++++++++++++++++++++++++++++
>> 1 file changed, 527 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi
>> b/arch/arm64/boot/dts/qcom/sc7180.dtsi
>> index 666e9b9..6656ffc 100644
>> --- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
>> @@ -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

yes, i will send the patch for critical interrupt support.
>
>
> Thanks!
>
> -Rajeshwari

2019-12-12 11:02:34

by Amit Kucheria

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

Hi Rajeshwari,

On Thu, Nov 28, 2019 at 3:25 PM Rajeshwari <[email protected]> wrote:
>
> Add TSENS node and user thermal zone for TSENS sensors in SC7180.
>
> Signed-off-by: Rajeshwari <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 +++++++++++++++++++++++++++++++++++
> 1 file changed, 527 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi b/arch/arm64/boot/dts/qcom/sc7180.dtsi
> index 666e9b9..6656ffc 100644
> --- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
> @@ -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";
> + };

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.

> + };
> + };
> +
> + 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";
> + };
> + };
> + };
> +

2019-12-12 16:10:31

by Doug Anderson

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

Hi,

On Thu, Dec 12, 2019 at 3:00 AM Amit Kucheria
<[email protected]> wrote:
>
> Hi Rajeshwari,
>
> On Thu, Nov 28, 2019 at 3:25 PM Rajeshwari <[email protected]> wrote:
> >
> > Add TSENS node and user thermal zone for TSENS sensors in SC7180.
> >
> > Signed-off-by: Rajeshwari <[email protected]>
> > ---
> > arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 +++++++++++++++++++++++++++++++++++
> > 1 file changed, 527 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi b/arch/arm64/boot/dts/qcom/sc7180.dtsi
> > index 666e9b9..6656ffc 100644
> > --- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
> > @@ -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";
> > + };
>
> 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

2019-12-12 16:58:02

by Amit Kucheria

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

On Thu, Dec 12, 2019 at 9:39 PM Doug Anderson <[email protected]> wrote:
>
> Hi,
>
> On Thu, Dec 12, 2019 at 3:00 AM Amit Kucheria
> <[email protected]> wrote:
> >
> > Hi Rajeshwari,
> >
> > On Thu, Nov 28, 2019 at 3:25 PM Rajeshwari <[email protected]> wrote:
> > >
> > > Add TSENS node and user thermal zone for TSENS sensors in SC7180.
> > >
> > > Signed-off-by: Rajeshwari <[email protected]>
> > > ---
> > > arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 +++++++++++++++++++++++++++++++++++
> > > 1 file changed, 527 insertions(+)
> > >
> > > diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi b/arch/arm64/boot/dts/qcom/sc7180.dtsi
> > > index 666e9b9..6656ffc 100644
> > > --- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
> > > +++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
> > > @@ -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";
> > > + };
> >
> > 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?

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

2019-12-12 17:02:28

by Doug Anderson

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

Hi,

On Thu, Dec 12, 2019 at 8:56 AM Amit Kucheria
<[email protected]> wrote:
>
> On Thu, Dec 12, 2019 at 9:39 PM Doug Anderson <[email protected]> wrote:
> >
> > Hi,
> >
> > On Thu, Dec 12, 2019 at 3:00 AM Amit Kucheria
> > <[email protected]> wrote:
> > >
> > > Hi Rajeshwari,
> > >
> > > On Thu, Nov 28, 2019 at 3:25 PM Rajeshwari <[email protected]> wrote:
> > > >
> > > > Add TSENS node and user thermal zone for TSENS sensors in SC7180.
> > > >
> > > > Signed-off-by: Rajeshwari <[email protected]>
> > > > ---
> > > > arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 +++++++++++++++++++++++++++++++++++
> > > > 1 file changed, 527 insertions(+)
> > > >
> > > > diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi b/arch/arm64/boot/dts/qcom/sc7180.dtsi
> > > > index 666e9b9..6656ffc 100644
> > > > --- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
> > > > +++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
> > > > @@ -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";
> > > > + };
> > >
> > > 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?
>
> 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

2019-12-12 17:10:21

by Amit Kucheria

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

On Thu, Dec 12, 2019 at 10:30 PM Doug Anderson <[email protected]> wrote:
>
> Hi,
>
> On Thu, Dec 12, 2019 at 8:56 AM Amit Kucheria
> <[email protected]> wrote:
> >
> > On Thu, Dec 12, 2019 at 9:39 PM Doug Anderson <[email protected]> wrote:
> > >
> > > Hi,
> > >
> > > On Thu, Dec 12, 2019 at 3:00 AM Amit Kucheria
> > > <[email protected]> wrote:
> > > >
> > > > Hi Rajeshwari,
> > > >
> > > > On Thu, Nov 28, 2019 at 3:25 PM Rajeshwari <[email protected]> wrote:
> > > > >
> > > > > Add TSENS node and user thermal zone for TSENS sensors in SC7180.
> > > > >
> > > > > Signed-off-by: Rajeshwari <[email protected]>
> > > > > ---
> > > > > arch/arm64/boot/dts/qcom/sc7180.dtsi | 527 +++++++++++++++++++++++++++++++++++
> > > > > 1 file changed, 527 insertions(+)
> > > > >
> > > > > diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi b/arch/arm64/boot/dts/qcom/sc7180.dtsi
> > > > > index 666e9b9..6656ffc 100644
> > > > > --- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
> > > > > +++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
> > > > > @@ -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";
> > > > > + };
> > > >
> > > > 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?
> >
> > 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.