qualcommax: refresh kernel patches
[openwrt/staging/jow.git] / target / linux / qualcommax / patches-6.1 / 0141-arm64-dts-qcom-ipq6018-add-thermal-zones.patch
1 From 92c65f959ec2b8d1ab26efe246b29ed538b45c86 Mon Sep 17 00:00:00 2001
2 From: Mantas Pucka <mantas@8devices.com>
3 Date: Wed, 24 Jan 2024 15:10:43 +0200
4 Subject: [PATCH 3/3] arm64: dts: qcom: ipq6018: add thermal zones
5
6 Add thermal zones to make use of thermal sensors data. For CPU zone,
7 add cooling device that uses CPU frequency scaling.
8
9 Signed-off-by: Mantas Pucka <mantas@8devices.com>
10 ---
11 arch/arm64/boot/dts/qcom/ipq6018.dtsi | 121 ++++++++++++++++++++++++++++++++++
12 1 file changed, 121 insertions(+)
13
14 --- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
15 +++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
16 @@ -9,6 +9,7 @@
17 #include <dt-bindings/clock/qcom,gcc-ipq6018.h>
18 #include <dt-bindings/reset/qcom,gcc-ipq6018.h>
19 #include <dt-bindings/clock/qcom,apss-ipq.h>
20 +#include <dt-bindings/thermal/thermal.h>
21
22 / {
23 #address-cells = <2>;
24 @@ -43,6 +44,7 @@
25 clock-names = "cpu";
26 operating-points-v2 = <&cpu_opp_table>;
27 cpu-supply = <&ipq6018_s2>;
28 + #cooling-cells = <2>;
29 };
30
31 CPU1: cpu@1 {
32 @@ -55,6 +57,7 @@
33 clock-names = "cpu";
34 operating-points-v2 = <&cpu_opp_table>;
35 cpu-supply = <&ipq6018_s2>;
36 + #cooling-cells = <2>;
37 };
38
39 CPU2: cpu@2 {
40 @@ -67,6 +70,7 @@
41 clock-names = "cpu";
42 operating-points-v2 = <&cpu_opp_table>;
43 cpu-supply = <&ipq6018_s2>;
44 + #cooling-cells = <2>;
45 };
46
47 CPU3: cpu@3 {
48 @@ -79,6 +83,7 @@
49 clock-names = "cpu";
50 operating-points-v2 = <&cpu_opp_table>;
51 cpu-supply = <&ipq6018_s2>;
52 + #cooling-cells = <2>;
53 };
54
55 L2_0: l2-cache {
56 @@ -808,6 +813,122 @@
57 };
58 };
59 };
60 +
61 + thermal-zones {
62 + nss-top-thermal {
63 + polling-delay-passive = <250>;
64 + polling-delay = <1000>;
65 + thermal-sensors = <&tsens 4>;
66 +
67 + trips {
68 + nss-top-critical {
69 + temperature = <125000>;
70 + hysteresis = <1000>;
71 + type = "critical";
72 + };
73 + };
74 + };
75 +
76 + nss-thermal {
77 + polling-delay-passive = <250>;
78 + polling-delay = <1000>;
79 + thermal-sensors = <&tsens 5>;
80 +
81 + trips {
82 + nss-critical {
83 + temperature = <125000>;
84 + hysteresis = <1000>;
85 + type = "critical";
86 + };
87 + };
88 + };
89 +
90 + wcss-phya0-thermal {
91 + polling-delay-passive = <250>;
92 + polling-delay = <1000>;
93 + thermal-sensors = <&tsens 7>;
94 +
95 + trips {
96 + wcss-phya0-critical {
97 + temperature = <125000>;
98 + hysteresis = <1000>;
99 + type = "critical";
100 + };
101 + };
102 + };
103 +
104 + wcss-phya1-thermal {
105 + polling-delay-passive = <250>;
106 + polling-delay = <1000>;
107 + thermal-sensors = <&tsens 8>;
108 +
109 + trips {
110 + wcss-phya1-critical {
111 + temperature = <125000>;
112 + hysteresis = <1000>;
113 + type = "critical";
114 + };
115 + };
116 + };
117 +
118 + cpu-thermal {
119 + polling-delay-passive = <250>;
120 + polling-delay = <1000>;
121 + thermal-sensors = <&tsens 13>;
122 +
123 + trips {
124 + cpu-critical {
125 + temperature = <125000>;
126 + hysteresis = <1000>;
127 + type = "critical";
128 + };
129 +
130 + cpu_alert: cpu-passive {
131 + temperature = <110000>;
132 + hysteresis = <1000>;
133 + type = "passive";
134 + };
135 + };
136 +
137 + cooling-maps {
138 + map0 {
139 + trip = <&cpu_alert>;
140 + cooling-device = <&CPU0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
141 + <&CPU1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
142 + <&CPU2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
143 + <&CPU3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
144 + };
145 + };
146 + };
147 +
148 + lpass-thermal {
149 + polling-delay-passive = <250>;
150 + polling-delay = <1000>;
151 + thermal-sensors = <&tsens 14>;
152 +
153 + trips {
154 + lpass-critical {
155 + temperature = <125000>;
156 + hysteresis = <1000>;
157 + type = "critical";
158 + };
159 + };
160 + };
161 +
162 + ddrss-top-thermal {
163 + polling-delay-passive = <250>;
164 + polling-delay = <1000>;
165 + thermal-sensors = <&tsens 15>;
166 +
167 + trips {
168 + ddrss-top-critical {
169 + temperature = <125000>;
170 + hysteresis = <1000>;
171 + type = "critical";
172 + };
173 + };
174 + };
175 + };
176
177 wcss: wcss-smp2p {
178 compatible = "qcom,smp2p";