linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ilialin@codeaurora.org (Ilia Lin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 10/10] DT: QCOM: Add thermal mitigation to msm8996
Date: Wed, 14 Feb 2018 15:59:52 +0200	[thread overview]
Message-ID: <1518616792-29028-11-git-send-email-ilialin@codeaurora.org> (raw)
In-Reply-To: <1518616792-29028-1-git-send-email-ilialin@codeaurora.org>

Add thermal mitigation configuration to msm8996.
With the cpufreq-dt OPP table the CPU frequency may be
scaled and therefore throttled by the thermal config.

Signed-off-by: Ilia Lin <ilialin@codeaurora.org>
---
 arch/arm64/boot/dts/qcom/msm8996.dtsi | 98 +++++++++++++++++++++++++++++++----
 1 file changed, 87 insertions(+), 11 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index 0359197..1df5b6f 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -14,6 +14,7 @@
 #include <dt-bindings/clock/qcom,gcc-msm8996.h>
 #include <dt-bindings/clock/qcom,mmcc-msm8996.h>
 #include <dt-bindings/clock/qcom,rpmcc.h>
+#include <dt-bindings/thermal/thermal.h>
 
 / {
 	model = "Qualcomm Technologies, Inc. MSM8996";
@@ -88,6 +89,10 @@
 			enable-method = "psci";
 			clocks = <&kryocc 0>;
 			operating-points-v2 = <&cluster0_opp>;
+			/* cooling options */
+			cooling-min-level = <0>;
+			cooling-max-level = <15>;
+			#cooling-cells = <2>;
 			next-level-cache = <&L2_0>;
 			L2_0: l2-cache {
 			      compatible = "cache";
@@ -102,6 +107,10 @@
 			enable-method = "psci";
 			clocks = <&kryocc 0>;
 			operating-points-v2 = <&cluster0_opp>;
+			/* cooling options */
+			cooling-min-level = <0>;
+			cooling-max-level = <15>;
+			#cooling-cells = <2>;
 			next-level-cache = <&L2_0>;
 		};
 
@@ -112,6 +121,10 @@
 			enable-method = "psci";
 			clocks = <&kryocc 1>;
 			operating-points-v2 = <&cluster1_opp>;
+			/* cooling options */
+			cooling-min-level = <0>;
+			cooling-max-level = <15>;
+			#cooling-cells = <2>;
 			next-level-cache = <&L2_1>;
 			L2_1: l2-cache {
 			      compatible = "cache";
@@ -126,6 +139,10 @@
 			enable-method = "psci";
 			clocks = <&kryocc 1>;
 			operating-points-v2 = <&cluster1_opp>;
+			/* cooling options */
+			cooling-min-level = <0>;
+			cooling-max-level = <15>;
+			#cooling-cells = <2>;
 			next-level-cache = <&L2_1>;
 		};
 
@@ -336,18 +353,33 @@
 			thermal-sensors = <&tsens0 3>;
 
 			trips {
-				cpu_alert0: trip0 {
+				cpu_alert0: cpu_alert0 {
 					temperature = <75000>;
 					hysteresis = <2000>;
+					type = "active";
+				};
+				cpu_warn0: cpu_warn0 {
+					temperature = <90000>;
+					hysteresis = <2000>;
 					type = "passive";
 				};
-
-				cpu_crit0: trip1 {
+				cpu_crit0: cpu_crit0 {
 					temperature = <110000>;
 					hysteresis = <2000>;
 					type = "critical";
 				};
 			};
+
+			cooling-maps {
+				map0 {
+					trip = <&cpu_alert0>;
+					cooling-device = <&CPU0 THERMAL_NO_LIMIT 7>;
+				};
+				map1 {
+					trip = <&cpu_warn0>;
+					cooling-device = <&CPU0 8 THERMAL_NO_LIMIT>;
+				};
+			};
 		};
 
 		cpu-thermal1 {
@@ -357,18 +389,33 @@
 			thermal-sensors = <&tsens0 5>;
 
 			trips {
-				cpu_alert1: trip0 {
+				cpu_alert1: cpu_alert1 {
 					temperature = <75000>;
 					hysteresis = <2000>;
+					type = "active";
+				};
+				cpu_warn1: cpu_warn1 {
+					temperature = <90000>;
+					hysteresis = <2000>;
 					type = "passive";
 				};
-
-				cpu_crit1: trip1 {
+				cpu_crit1: cpu_crit1 {
 					temperature = <110000>;
 					hysteresis = <2000>;
 					type = "critical";
 				};
 			};
+
+			cooling-maps {
+				map0 {
+					trip = <&cpu_alert1>;
+					cooling-device = <&CPU0 THERMAL_NO_LIMIT 7>;
+				};
+				map1 {
+					trip = <&cpu_warn1>;
+					cooling-device = <&CPU0 8 THERMAL_NO_LIMIT>;
+				};
+			};
 		};
 
 		cpu-thermal2 {
@@ -378,18 +425,32 @@
 			thermal-sensors = <&tsens0 8>;
 
 			trips {
-				cpu_alert2: trip0 {
+				cpu_alert2: cpu_alert2 {
 					temperature = <75000>;
 					hysteresis = <2000>;
+					type = "active";
+				};
+				cpu_warn2: cpu_warn2 {
+					temperature = <90000>;
+					hysteresis = <2000>;
 					type = "passive";
 				};
-
-				cpu_crit2: trip1 {
+				cpu_crit2: cpu_crit2 {
 					temperature = <110000>;
 					hysteresis = <2000>;
 					type = "critical";
 				};
 			};
+			cooling-maps {
+				map0 {
+					trip = <&cpu_alert2>;
+					cooling-device = <&CPU2 THERMAL_NO_LIMIT 7>;
+				};
+				map1 {
+					trip = <&cpu_warn2>;
+					cooling-device = <&CPU2 8 THERMAL_NO_LIMIT>;
+				};
+			};
 		};
 
 		cpu-thermal3 {
@@ -399,18 +460,33 @@
 			thermal-sensors = <&tsens0 10>;
 
 			trips {
-				cpu_alert3: trip0 {
+				cpu_alert3: cpu_alert3 {
 					temperature = <75000>;
 					hysteresis = <2000>;
+					type = "active";
+				};
+				cpu_warn3: cpu_warn3 {
+					temperature = <90000>;
+					hysteresis = <2000>;
 					type = "passive";
 				};
-
 				cpu_crit3: trip1 {
 					temperature = <110000>;
 					hysteresis = <2000>;
 					type = "critical";
 				};
 			};
+
+			cooling-maps {
+				map0 {
+					trip = <&cpu_alert3>;
+					cooling-device = <&CPU2 THERMAL_NO_LIMIT 7>;
+				};
+				map1 {
+					trip = <&cpu_warn3>;
+					cooling-device = <&CPU2 8 THERMAL_NO_LIMIT>;
+				};
+			};
 		};
 	};
 
-- 
1.9.1

      parent reply	other threads:[~2018-02-14 13:59 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14 13:59 [PATCH v3 00/10] clk: qcom: CPU clock driver for msm8996 Ilia Lin
2018-02-14 13:59 ` [PATCH v3 01/10] soc: qcom: Separate kryo l2 accessors from PMU driver Ilia Lin
2018-03-19 17:45   ` Stephen Boyd
2018-03-20 18:42     ` ilialin at codeaurora.org
2018-02-14 13:59 ` [PATCH v3 02/10] clk: qcom: Make clk_alpha_pll_configure available to modules Ilia Lin
2018-03-19 17:45   ` Stephen Boyd
2018-02-14 13:59 ` [PATCH v3 03/10] clk: qcom: Add CPU clock driver for msm8996 Ilia Lin
2018-03-19 17:36   ` Stephen Boyd
2018-03-20 14:18     ` ilialin at codeaurora.org
2018-03-20 20:01       ` Stephen Boyd
2018-03-22 10:47     ` ilialin at codeaurora.org
2018-04-06 18:18       ` Stephen Boyd
2018-02-14 13:59 ` [PATCH v3 04/10] clk: qcom: Add DT bindings for " Ilia Lin
2018-02-19  3:12   ` Rob Herring
2018-03-19 17:46   ` Stephen Boyd
2018-03-20 18:43     ` ilialin at codeaurora.org
2018-02-14 13:59 ` [PATCH v3 05/10] clk: qcom: cpu-8996: Add support to switch to alternate PLL Ilia Lin
2018-03-19 17:47   ` Stephen Boyd
2018-03-20 18:45     ` ilialin at codeaurora.org
2018-02-14 13:59 ` [PATCH v3 06/10] clk: qcom: cpu-8996: Add support to switch below 600Mhz Ilia Lin
2018-03-19 17:49   ` Stephen Boyd
2018-02-14 13:59 ` [PATCH v3 07/10] clk: qcom: clk-cpu-8996: Prepare PLLs on probe Ilia Lin
2018-03-19 16:50   ` Stephen Boyd
2018-03-20 13:53     ` ilialin at codeaurora.org
2018-03-20 20:03       ` Stephen Boyd
2018-02-14 13:59 ` [PATCH v3 08/10] clk: qcom: Add ACD path to CPU clock driver for msm8996 Ilia Lin
2018-03-19 16:57   ` Stephen Boyd
2018-03-19 18:16     ` Robin Murphy
2018-03-19 21:21       ` Stephen Boyd
2018-03-22 18:56         ` Robin Murphy
2018-03-20 14:04     ` ilialin at codeaurora.org
2018-03-20 20:04       ` Stephen Boyd
2018-02-14 13:59 ` [PATCH v3 09/10] DT: QCOM: Add cpufreq-dt to msm8996 Ilia Lin
2018-03-19 16:48   ` Stephen Boyd
2018-03-20 13:46     ` ilialin at codeaurora.org
2018-03-20 20:06       ` Stephen Boyd
2018-03-20 20:34         ` ilialin at codeaurora.org
2018-03-20 21:46           ` Stephen Boyd
2018-02-14 13:59 ` Ilia Lin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1518616792-29028-11-git-send-email-ilialin@codeaurora.org \
    --to=ilialin@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).