All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/3] Enable IPQ9574 TSENS support
@ 2023-06-02 11:03 Varadarajan Narayanan
  2023-06-02 11:03 ` [PATCH v5 1/3] dt-bindings: thermal: tsens: Add ipq9574 compatible Varadarajan Narayanan
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Varadarajan Narayanan @ 2023-06-02 11:03 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, linux-arm-msm, linux-pm, devicetree, linux-kernel
  Cc: Varadarajan Narayanan

This patch set enables tsens in IPQ9574

Depends on
	https://lore.kernel.org/linux-arm-msm/20230406061314.10916-1-quic_devipriy@quicinc.com/
[v5]:
	Fix make DT_CHECKER_FLAGS=-m dt_binding_check and make dtbs_check errors without removing existing entries

[v4]:
	Drop the sm6375-tsens and qcm2290-tsens related bindings
	fix as it is already posted

	Remove unnecessary changes from previous version

[v3]:
	Fix make DT_CHECKER_FLAGS=-m dt_binding_check and make dtbs_check errors

[v2]:
	Drop the driver change (https://lore.kernel.org/lkml/b45d33d38a334aabbd52c83b0d6028af1f4c74c8.1682682753.git.quic_varada@quicinc.com/)
	since the tsens device is compatible with 8074's tsens
	and use 8074's compatible itself

	Rename clusterX nodes as cpussX

[v1]:
	Fix DT node names

[v0]:
	Initial patch introducing TSENS support

Praveenkumar I (1):
  dt-bindings: thermal: tsens: Add ipq9574 compatible

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

 .../devicetree/bindings/thermal/qcom-tsens.yaml    |   6 +
 arch/arm64/boot/dts/qcom/ipq9574.dtsi              | 218 +++++++++++++++++++++
 2 files changed, 224 insertions(+)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v5 1/3] dt-bindings: thermal: tsens: Add ipq9574 compatible
  2023-06-02 11:03 [PATCH v5 0/3] Enable IPQ9574 TSENS support Varadarajan Narayanan
@ 2023-06-02 11:03 ` Varadarajan Narayanan
  2023-06-03 10:25   ` Krzysztof Kozlowski
  2023-06-02 11:03 ` [PATCH v5 2/3] arm64: dts: qcom: ipq9574: add tsens node Varadarajan Narayanan
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Varadarajan Narayanan @ 2023-06-02 11:03 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, linux-arm-msm, linux-pm, devicetree, linux-kernel
  Cc: Praveenkumar I, Varadarajan Narayanan

From: Praveenkumar I <quic_ipkumar@quicinc.com>

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

Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
---
[v5]:
        Fix dt_binding_check & dtbs_check errors without removing existing entries
[v4]:
        Add description about IPQ9574 and remove unnecessary
        additions to the file
[v3]:
        Fix dt_binding_check & dtbs_check errors (Used
        Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tcon.yaml
        as reference/example)

        Drop 'Acked-by: Rob Herring' as suggested in review

[v2]:
        Thanks to Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
        for the tip to make qcom,ipq8074-tsens as fallback.
---
 Documentation/devicetree/bindings/thermal/qcom-tsens.yaml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
index d1ec963..e7d0341 100644
--- a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
+++ b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml
@@ -67,6 +67,12 @@ properties:
         enum:
           - qcom,ipq8074-tsens
 
+      - description: v2 of TSENS with combined interrupt
+        items:
+          - enum:
+              - qcom,ipq9574-tsens
+          - const: qcom,ipq8074-tsens
+
   reg:
     items:
       - description: TM registers
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v5 2/3] arm64: dts: qcom: ipq9574: add tsens node
  2023-06-02 11:03 [PATCH v5 0/3] Enable IPQ9574 TSENS support Varadarajan Narayanan
  2023-06-02 11:03 ` [PATCH v5 1/3] dt-bindings: thermal: tsens: Add ipq9574 compatible Varadarajan Narayanan
@ 2023-06-02 11:03 ` Varadarajan Narayanan
  2023-06-06 13:15   ` Konrad Dybcio
  2023-06-02 11:03 ` [PATCH v5 3/3] arm64: dts: qcom: ipq9574: add thermal zone nodes Varadarajan Narayanan
  2023-06-06 10:33 ` [PATCH v5 0/3] Enable IPQ9574 TSENS support Varadarajan Narayanan
  3 siblings, 1 reply; 7+ messages in thread
From: Varadarajan Narayanan @ 2023-06-02 11:03 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, linux-arm-msm, linux-pm, devicetree, linux-kernel
  Cc: Varadarajan Narayanan, Praveenkumar I

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

Co-developed-by: Praveenkumar I <quic_ipkumar@quicinc.com>
Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
---
[v5]:
	Incorporate review comments

[v2]:
	Add "qcom,ipq8074-tsens" as fallback compatible
---
 arch/arm64/boot/dts/qcom/ipq9574.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
index 0baeb10..cda3fd4 100644
--- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
@@ -206,6 +206,16 @@
 			#size-cells = <1>;
 		};
 
+		tsens: thermal-sensor@4a9000 {
+			compatible = "qcom,ipq9574-tsens", "qcom,ipq8074-tsens";
+			reg = <0x004a9000 0x1000>, /* TM */
+			      <0x004a8000 0x1000>; /* SROT */
+			interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "combined";
+			#qcom,sensors = <16>;
+			#thermal-sensor-cells = <1>;
+		};
+
 		tlmm: pinctrl@1000000 {
 			compatible = "qcom,ipq9574-tlmm";
 			reg = <0x01000000 0x300000>;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v5 3/3] arm64: dts: qcom: ipq9574: add thermal zone nodes
  2023-06-02 11:03 [PATCH v5 0/3] Enable IPQ9574 TSENS support Varadarajan Narayanan
  2023-06-02 11:03 ` [PATCH v5 1/3] dt-bindings: thermal: tsens: Add ipq9574 compatible Varadarajan Narayanan
  2023-06-02 11:03 ` [PATCH v5 2/3] arm64: dts: qcom: ipq9574: add tsens node Varadarajan Narayanan
@ 2023-06-02 11:03 ` Varadarajan Narayanan
  2023-06-06 10:33 ` [PATCH v5 0/3] Enable IPQ9574 TSENS support Varadarajan Narayanan
  3 siblings, 0 replies; 7+ messages in thread
From: Varadarajan Narayanan @ 2023-06-02 11:03 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, linux-arm-msm, linux-pm, devicetree, linux-kernel
  Cc: Varadarajan Narayanan, Praveenkumar I

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

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Co-developed-by: Praveenkumar I <quic_ipkumar@quicinc.com>
Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
---
[v2]:
	Rename clusterX nodes as cpussX nodes

[v1]:
	Fix node names
---
 arch/arm64/boot/dts/qcom/ipq9574.dtsi | 208 ++++++++++++++++++++++++++++++++++
 1 file changed, 208 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
index cda3fd4..392dbe5 100644
--- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
@@ -592,6 +592,214 @@
 		};
 	};
 
+	thermal-zones {
+		nss-top-thermal {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 3>;
+
+			trips {
+				nss-top-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		ubi-0-thermal {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 4>;
+
+			trips {
+				ubi_0-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		ubi-1-thermal {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 5>;
+
+			trips {
+				ubi_1-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		ubi-2-thermal {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 6>;
+
+			trips {
+				ubi_2-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		ubi-3-thermal {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 7>;
+
+			trips {
+				ubi_3-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		cpuss0-thermal {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 8>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		cpuss1-thermal {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 9>;
+
+			trips {
+				cpu-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		cpu0-thermal {
+			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";
+				};
+			};
+		};
+
+		cpu1-thermal {
+			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";
+				};
+			};
+		};
+
+		cpu2-thermal {
+			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";
+				};
+			};
+		};
+
+		cpu3-thermal {
+			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";
+				};
+			};
+		};
+
+		wcss-phyb-thermal {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 14>;
+
+			trips {
+				wcss_phyb-critical {
+					temperature = <125000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		top-glue-thermal {
+			polling-delay-passive = <0>;
+			polling-delay = <0>;
+			thermal-sensors = <&tsens 15>;
+
+			trips {
+				top_glue-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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 1/3] dt-bindings: thermal: tsens: Add ipq9574 compatible
  2023-06-02 11:03 ` [PATCH v5 1/3] dt-bindings: thermal: tsens: Add ipq9574 compatible Varadarajan Narayanan
@ 2023-06-03 10:25   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2023-06-03 10:25 UTC (permalink / raw)
  To: Varadarajan Narayanan, agross, andersson, konrad.dybcio, amitk,
	thara.gopinath, rafael, daniel.lezcano, rui.zhang, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, linux-arm-msm, linux-pm,
	devicetree, linux-kernel
  Cc: Praveenkumar I

On 02/06/2023 13:03, Varadarajan Narayanan wrote:
> From: Praveenkumar I <quic_ipkumar@quicinc.com>
> 
> Qualcomm IPQ9574 has tsens v2.3.1 block, which is similar to IPQ8074 tsens.
> 
> Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
> Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 0/3] Enable IPQ9574 TSENS support
  2023-06-02 11:03 [PATCH v5 0/3] Enable IPQ9574 TSENS support Varadarajan Narayanan
                   ` (2 preceding siblings ...)
  2023-06-02 11:03 ` [PATCH v5 3/3] arm64: dts: qcom: ipq9574: add thermal zone nodes Varadarajan Narayanan
@ 2023-06-06 10:33 ` Varadarajan Narayanan
  3 siblings, 0 replies; 7+ messages in thread
From: Varadarajan Narayanan @ 2023-06-06 10:33 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, amitk, thara.gopinath, rafael,
	daniel.lezcano, rui.zhang, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, linux-arm-msm, linux-pm, devicetree, linux-kernel

On Fri, Jun 02, 2023 at 04:33:49PM +0530, Varadarajan Narayanan wrote:
> This patch set enables tsens in IPQ9574
>
> Depends on
> 	https://lore.kernel.org/linux-arm-msm/20230406061314.10916-1-quic_devipriy@quicinc.com/
> [v5]:
> 	Fix make DT_CHECKER_FLAGS=-m dt_binding_check and make dtbs_check errors without removing existing entries
>
> [v4]:
> 	Drop the sm6375-tsens and qcm2290-tsens related bindings
> 	fix as it is already posted
>
> 	Remove unnecessary changes from previous version
>
> [v3]:
> 	Fix make DT_CHECKER_FLAGS=-m dt_binding_check and make dtbs_check errors
>
> [v2]:
> 	Drop the driver change (https://lore.kernel.org/lkml/b45d33d38a334aabbd52c83b0d6028af1f4c74c8.1682682753.git.quic_varada@quicinc.com/)
> 	since the tsens device is compatible with 8074's tsens
> 	and use 8074's compatible itself
>
> 	Rename clusterX nodes as cpussX
>
> [v1]:
> 	Fix DT node names
>
> [v0]:
> 	Initial patch introducing TSENS support
>
> Praveenkumar I (1):
>   dt-bindings: thermal: tsens: Add ipq9574 compatible
>
> Varadarajan Narayanan (2):
>   arm64: dts: qcom: ipq9574: add tsens node
>   arm64: dts: qcom: ipq9574: add thermal zone nodes
>
>  .../devicetree/bindings/thermal/qcom-tsens.yaml    |   6 +
>  arch/arm64/boot/dts/qcom/ipq9574.dtsi              | 218 +++++++++++++++++++++
>  2 files changed, 224 insertions(+)
>
> --
> 2.7.4
>

Bjorn,

Can this series be taken for 6.5?
All comments have been addressed.

Thanks
Varada

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v5 2/3] arm64: dts: qcom: ipq9574: add tsens node
  2023-06-02 11:03 ` [PATCH v5 2/3] arm64: dts: qcom: ipq9574: add tsens node Varadarajan Narayanan
@ 2023-06-06 13:15   ` Konrad Dybcio
  0 siblings, 0 replies; 7+ messages in thread
From: Konrad Dybcio @ 2023-06-06 13:15 UTC (permalink / raw)
  To: Varadarajan Narayanan, agross, andersson, amitk, thara.gopinath,
	rafael, daniel.lezcano, rui.zhang, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, linux-arm-msm, linux-pm,
	devicetree, linux-kernel
  Cc: Praveenkumar I



On 2.06.2023 13:03, Varadarajan Narayanan wrote:
> IPQ9574 has a tsens v2.3.1 peripheral which monitors temperatures
> around the various subsystems on the die.
> 
> Co-developed-by: Praveenkumar I <quic_ipkumar@quicinc.com>
> Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
> Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
> ---
> [v5]:
> 	Incorporate review comments
"fix bug" is too vague..

> 
> [v2]:
> 	Add "qcom,ipq8074-tsens" as fallback compatible
> ---
>  arch/arm64/boot/dts/qcom/ipq9574.dtsi | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> index 0baeb10..cda3fd4 100644
> --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> @@ -206,6 +206,16 @@
>  			#size-cells = <1>;
>  		};
>  
> +		tsens: thermal-sensor@4a9000 {
> +			compatible = "qcom,ipq9574-tsens", "qcom,ipq8074-tsens";
> +			reg = <0x004a9000 0x1000>, /* TM */
> +			      <0x004a8000 0x1000>; /* SROT */
The comments are unnecessary, we've been copypasting them from SoC to SoC
but it's time we stop.

With that:

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
> +			interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
> +			interrupt-names = "combined";
> +			#qcom,sensors = <16>;
> +			#thermal-sensor-cells = <1>;
> +		};
> +
>  		tlmm: pinctrl@1000000 {
>  			compatible = "qcom,ipq9574-tlmm";
>  			reg = <0x01000000 0x300000>;

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-06-06 13:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-02 11:03 [PATCH v5 0/3] Enable IPQ9574 TSENS support Varadarajan Narayanan
2023-06-02 11:03 ` [PATCH v5 1/3] dt-bindings: thermal: tsens: Add ipq9574 compatible Varadarajan Narayanan
2023-06-03 10:25   ` Krzysztof Kozlowski
2023-06-02 11:03 ` [PATCH v5 2/3] arm64: dts: qcom: ipq9574: add tsens node Varadarajan Narayanan
2023-06-06 13:15   ` Konrad Dybcio
2023-06-02 11:03 ` [PATCH v5 3/3] arm64: dts: qcom: ipq9574: add thermal zone nodes Varadarajan Narayanan
2023-06-06 10:33 ` [PATCH v5 0/3] Enable IPQ9574 TSENS support Varadarajan Narayanan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.