This patch set enables tsens in IPQ9574
Depends on
https://lore.kernel.org/linux-arm-msm/[email protected]/
[v1]:
Fix DT node names
[v0]:
Initial patch introducing TSENS support
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(+)
--
2.7.4
IPQ9574 has a tsens v2.3.1 peripheral which monitors temperatures
around the various subsystems on the die.
Co-developed-by: Praveenkumar I <[email protected]>
Signed-off-by: Praveenkumar I <[email protected]>
Signed-off-by: Varadarajan Narayanan <[email protected]>
---
arch/arm64/boot/dts/qcom/ipq9574.dtsi | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
index 93e3026..b22b999 100644
--- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
@@ -1056,6 +1056,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 {
--
2.7.4
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.
Signed-off-by: Praveenkumar I <[email protected]>
Signed-off-by: Varadarajan Narayanan <[email protected]>
---
drivers/thermal/qcom/tsens.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index d321812..e752b7d 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -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,
}, {
--
2.7.4
This patch adds thermal zone nodes for the various
sensors present in IPQ9574
Co-developed-by: Praveenkumar I <[email protected]>
Signed-off-by: Praveenkumar I <[email protected]>
Signed-off-by: Varadarajan Narayanan <[email protected]>
---
[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 b22b999..bc4d061 100644
--- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
@@ -1067,6 +1067,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";
+ };
+ };
+ };
+
+ cluster0-thermal {
+ polling-delay-passive = <0>;
+ polling-delay = <0>;
+ thermal-sensors = <&tsens 8>;
+
+ trips {
+ cpu-critical {
+ temperature = <125000>;
+ hysteresis = <1000>;
+ type = "critical";
+ };
+ };
+ };
+
+ cluster1-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
On 03/05/2023 06:46, Varadarajan Narayanan wrote:
> 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.
>
> Signed-off-by: Praveenkumar I <[email protected]>
> Signed-off-by: Varadarajan Narayanan <[email protected]>
> ---
> drivers/thermal/qcom/tsens.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
> index d321812..e752b7d 100644
> --- a/drivers/thermal/qcom/tsens.c
> +++ b/drivers/thermal/qcom/tsens.c
> @@ -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,
This is a friendly reminder during the review process.
It seems my previous comments were not fully addressed. Maybe my
feedback got lost between the quotes, maybe you just forgot to apply it.
Please go back to the previous discussion and either implement all
requested changes or keep discussing them.
Thank you.
Best regards,
Krzysztof
On 03/05/2023 07:46, Varadarajan Narayanan wrote:
> This patch adds thermal zone nodes for the various
> sensors present in IPQ9574
>
> Co-developed-by: Praveenkumar I <[email protected]>
> Signed-off-by: Praveenkumar I <[email protected]>
> Signed-off-by: Varadarajan Narayanan <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
one nit below.
> ---
> [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 b22b999..bc4d061 100644
> --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> @@ -1067,6 +1067,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";
> + };
> + };
> + };
> +
> + cluster0-thermal {
I think we were usually using cpussN instead of clusterN, but this is
really a minor issue, we don't have that standardized.
> + polling-delay-passive = <0>;
> + polling-delay = <0>;
> + thermal-sensors = <&tsens 8>;
> +
> + trips {
> + cpu-critical {
> + temperature = <125000>;
> + hysteresis = <1000>;
> + type = "critical";
> + };
> + };
> + };
> +
> + cluster1-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)>,
--
With best wishes
Dmitry