-From: George Moussalem <george.moussalem@outlook.com>
-Date: Fri, 28 Feb 2025 09:11:39 +0400
-Subject: [PATCH v9 6/6] arm64: dts: qcom: ipq5018: Add tsens node
-
+From 450a80623e3b8bb5dae59e0d56046fc3d0a88f3b Mon Sep 17 00:00:00 2001
From: Sricharan Ramabadhran <quic_srichara@quicinc.com>
+Date: Thu, 12 Jun 2025 10:46:14 +0400
+Subject: arm64: dts: qcom: ipq5018: Add tsens node
IPQ5018 has tsens V1.0 IP with 5 sensors, though 4 are in use.
There is no RPM, so tsens has to be manually enabled. Adding the tsens
-and nvmem nodes and adding 4 thermal sensors (zones). With the
-critical temperature being 120'C and action is to reboot.
+and nvmem nodes and adding 4 thermal sensors (zones). The critical trip
+temperature is set to 120'C with an action to reboot.
+
+In addition, adding a cooling device to the CPU thermal zone which uses
+CPU frequency scaling.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Sricharan Ramabadhran <quic_srichara@quicinc.com>
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
+Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
+[bjorn: Added tsens-v1 fallback compatible, per binding]
+Link: https://lore.kernel.org/r/20250612-ipq5018-tsens-v13-2-a210f3683240@outlook.com
---
- arch/arm64/boot/dts/qcom/ipq5018.dtsi | 169 ++++++++++++++++++++++++++
- 1 file changed, 169 insertions(+)
+ arch/arm64/boot/dts/qcom/ipq5018.dtsi | 178 ++++++++++++++++++++++++++++++++++
+ 1 file changed, 178 insertions(+)
+
+(limited to 'arch/arm64/boot/dts/qcom/ipq5018.dtsi')
--- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi
-@@ -182,6 +182,117 @@
+@@ -9,6 +9,7 @@
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/clock/qcom,gcc-ipq5018.h>
+ #include <dt-bindings/reset/qcom,gcc-ipq5018.h>
++#include <dt-bindings/thermal/thermal.h>
+
+ / {
+ interrupt-parent = <&intc>;
+@@ -39,6 +40,7 @@
+ next-level-cache = <&l2_0>;
+ clocks = <&apcs_glb APCS_ALIAS0_CORE_CLK>;
+ operating-points-v2 = <&cpu_opp_table>;
++ #cooling-cells = <2>;
+ };
+
+ cpu1: cpu@1 {
+@@ -49,6 +51,7 @@
+ next-level-cache = <&l2_0>;
+ clocks = <&apcs_glb APCS_ALIAS0_CORE_CLK>;
+ operating-points-v2 = <&cpu_opp_table>;
++ #cooling-cells = <2>;
+ };
+
+ l2_0: l2-cache {
+@@ -182,6 +185,117 @@
status = "disabled";
};
+ };
+
+ tsens: thermal-sensor@4a9000 {
-+ compatible = "qcom,ipq5018-tsens";
-+ reg = <0x004a9000 0x1000>, /* TM */
-+ <0x004a8000 0x1000>; /* SROT */
++ compatible = "qcom,ipq5018-tsens", "qcom,tsens-v1";
++ reg = <0x004a9000 0x1000>,
++ <0x004a8000 0x1000>;
+
+ nvmem-cells = <&tsens_mode>,
+ <&tsens_base1>,
tlmm: pinctrl@1000000 {
compatible = "qcom,ipq5018-tlmm";
reg = <0x01000000 0x300000>;
-@@ -630,6 +741,64 @@
+@@ -630,6 +744,70 @@
};
};
};
+
+ thermal-zones {
+ cpu-thermal {
-+ polling-delay-passive = <0>;
-+ polling-delay = <0>;
+ thermal-sensors = <&tsens 2>;
+
+ trips {
+ cpu-critical {
+ temperature = <120000>;
-+ hysteresis = <2>;
++ hysteresis = <1000>;
+ type = "critical";
+ };
++
++ cpu_alert: cpu-passive {
++ temperature = <100000>;
++ hysteresis = <1000>;
++ type = "passive";
++ };
++ };
++
++ cooling-maps {
++ map0 {
++ trip = <&cpu_alert>;
++ cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
++ <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
++ };
+ };
+ };
+
+ gephy-thermal {
-+ polling-delay-passive = <0>;
-+ polling-delay = <0>;
+ thermal-sensors = <&tsens 4>;
+
+ trips {
+ gephy-critical {
+ temperature = <120000>;
-+ hysteresis = <2>;
++ hysteresis = <1000>;
+ type = "critical";
+ };
+ };
+ };
+
+ top-glue-thermal {
-+ polling-delay-passive = <0>;
-+ polling-delay = <0>;
+ thermal-sensors = <&tsens 3>;
+
+ trips {
-+ top_glue-critical {
++ top-glue-critical {
+ temperature = <120000>;
-+ hysteresis = <2>;
++ hysteresis = <1000>;
+ type = "critical";
+ };
+ };
+ };
+
+ ubi32-thermal {
-+ polling-delay-passive = <0>;
-+ polling-delay = <0>;
+ thermal-sensors = <&tsens 1>;
+
+ trips {
+ ubi32-critical {
+ temperature = <120000>;
-+ hysteresis = <2>;
++ hysteresis = <1000>;
+ type = "critical";
+ };
+ };
--- /dev/null
+From patchwork Mon Aug 18 11:33:47 2025
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+X-Patchwork-Submitter: George Moussalem <george.moussalem@outlook.com>
+X-Patchwork-Id: 14192807
+Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org
+ [10.30.226.201])
+ (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
+ (No client certificate requested)
+ by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEFC62E22A9;
+ Mon, 18 Aug 2025 11:33:51 +0000 (UTC)
+Authentication-Results: smtp.subspace.kernel.org;
+ arc=none smtp.client-ip=10.30.226.201
+ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
+ t=1755516831; cv=none;
+ b=VqLETc4T2um7UBDoagDhE5FaVjJLNoLCW45q/LUrwXoemwWqIFZm7XVzEyPjuUDYlgOw9BuQEdRd7nWhXOVdv1pxkbIOt4gS7MPPVGBilyaXc/sWLyd8qk0KNcIXV1rGmEZ7Ywn0BdnngdNfSAQvSACHhpyMZpGXRodCNPE5cls=
+ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
+ s=arc-20240116; t=1755516831; c=relaxed/simple;
+ bh=ZZKBTpL6UHyciqnKATbtrkmYynWeMCWrFd/2xcp++ww=;
+ h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References:
+ In-Reply-To:To:Cc;
+ b=XU6nlgSFgahhOxRhNcFU7wdAqhbLs8Ra7XxTipYaqKQqtp7v39J0ju+HaZOu9YE8a+aN4qG3R/YMTtCxZWejrgk6wU7nT/KBLqhjd1G2f0bWq/4NipYk+S7xYZyfe2lpNpZ2SRUI/1h6BFPoUnMzTeeuH8VjX/qIM3oLVe2s968=
+ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
+ dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org
+ header.b=PKBRtdr/; arc=none smtp.client-ip=10.30.226.201
+Authentication-Results: smtp.subspace.kernel.org;
+ dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org
+ header.b="PKBRtdr/"
+Received: by smtp.kernel.org (Postfix) with ESMTPS id 7CDF3C4CEED;
+ Mon, 18 Aug 2025 11:33:51 +0000 (UTC)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
+ s=k20201202; t=1755516831;
+ bh=ZZKBTpL6UHyciqnKATbtrkmYynWeMCWrFd/2xcp++ww=;
+ h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From;
+ b=PKBRtdr/YTJTrl92zpHzzAovfqaynlZxJFZ667MTjd+V2zpPVbh/Qw2YkWFGl8Zeg
+ JIv0gaRa7PdagA1GA06EbVEy4GO0sNTdf6FR9uMTB8QJLoShXHrFGEgBkV0GrW6GR2
+ l8QjDRsmfKbIfV7udOOmrqR83UfsKpyVH4F39JlEvteIsWQni/6UESQxGlGkBryduS
+ E2cVKO6sKNLJP6QVQf3TJeZsf5Xb+y/3xsqurGnhx7LD7r26jt0UaWQouihdlLn4lj
+ AEw/X1Kg1G29aq65wiw0DT5mBXOiR0gDatBMXU/FSddyoCFlqbrMLijDrt/R6gGmcS
+ tgOzuwrEZQhrA==
+Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org
+ (localhost.localdomain [127.0.0.1])
+ by smtp.lore.kernel.org (Postfix) with ESMTP id 6E9D7CA0EE4;
+ Mon, 18 Aug 2025 11:33:51 +0000 (UTC)
+Date: Mon, 18 Aug 2025 15:33:47 +0400
+Subject: [PATCH 2/2] arm64: dts: qcom: ipq5018: Remove tsens v1 fallback
+ compatible
+Precedence: bulk
+X-Mailing-List: linux-arm-msm@vger.kernel.org
+List-Id: <linux-arm-msm.vger.kernel.org>
+List-Subscribe: <mailto:linux-arm-msm+subscribe@vger.kernel.org>
+List-Unsubscribe: <mailto:linux-arm-msm+unsubscribe@vger.kernel.org>
+MIME-Version: 1.0
+Message-Id: <20250818-ipq5018-tsens-fix-v1-2-0f08cf09182d@outlook.com>
+References: <20250818-ipq5018-tsens-fix-v1-0-0f08cf09182d@outlook.com>
+In-Reply-To: <20250818-ipq5018-tsens-fix-v1-0-0f08cf09182d@outlook.com>
+To: Amit Kucheria <amitk@kernel.org>,
+ Thara Gopinath <thara.gopinath@gmail.com>,
+ "Rafael J. Wysocki" <rafael@kernel.org>,
+ Daniel Lezcano <daniel.lezcano@linaro.org>, Zhang Rui <rui.zhang@intel.com>,
+ Lukasz Luba <lukasz.luba@arm.com>, Rob Herring <robh@kernel.org>,
+ Krzysztof Kozlowski <krzk+dt@kernel.org>,
+ Conor Dooley <conor+dt@kernel.org>,
+ Sricharan Ramabadhran <quic_srichara@quicinc.com>,
+ Bjorn Andersson <andersson@kernel.org>,
+ Konrad Dybcio <konradybcio@kernel.org>
+Cc: linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org,
+ devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
+ George Moussalem <george.moussalem@outlook.com>,
+ Dmitry Baryshkov <lumag@kernel.org>,
+ Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
+X-Mailer: b4 0.14.2
+X-Developer-Signature: v=1; a=ed25519-sha256; t=1755516829; l=972;
+ i=george.moussalem@outlook.com; s=20250321; h=from:subject:message-id;
+ bh=HJcOgtw7oiilIyh0aWOOzNZ2iln5P6lSb3GMC6Gave0=;
+ b=uR1EVwZAX79JKZzxxM9N7TA/hO1CtlDORhZ/FGhSsA68dLhwH953wdmIPFDj4vfeWpsTsB3Bh
+ 4W66WWUho9RBMALQ66he3JtRH90AzRDuzcypOj7GRnzE6ehzDO8Gl3R
+X-Developer-Key: i=george.moussalem@outlook.com; a=ed25519;
+ pk=/PuRTSI9iYiHwcc6Nrde8qF4ZDhJBlUgpHdhsIjnqIk=
+X-Endpoint-Received: by B4 Relay for george.moussalem@outlook.com/20250321
+ with auth_id=364
+X-Original-From: George Moussalem <george.moussalem@outlook.com>
+Reply-To: george.moussalem@outlook.com
+From: George Moussalem <george.moussalem@outlook.com>
+
+From: George Moussalem <george.moussalem@outlook.com>
+
+Remove qcom,tsens-v1 as fallback compatible since this IP has no RPM
+and, as such, must use its own init routine available in the driver.
+
+Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
+Signed-off-by: George Moussalem <george.moussalem@outlook.com>
+---
+ arch/arm64/boot/dts/qcom/ipq5018.dtsi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi
++++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi
+@@ -340,7 +340,7 @@
+ };
+
+ tsens: thermal-sensor@4a9000 {
+- compatible = "qcom,ipq5018-tsens", "qcom,tsens-v1";
++ compatible = "qcom,ipq5018-tsens";
+ reg = <0x004a9000 0x1000>,
+ <0x004a8000 0x1000>;
+