Skip to content

Commit f2b539a

Browse files
hal-fengConchuOD
authored andcommitted
riscv: dts: starfive: jh7110: Add temperature sensor node and thermal-zones
Add temperature sensor and thermal-zones support for the StarFive JH7110 SoC. CPUFreq cooling is supported in thermal-zones. Co-developed-by: Emil Renner Berthing <[email protected]> Signed-off-by: Emil Renner Berthing <[email protected]> Signed-off-by: Hal Feng <[email protected]> Signed-off-by: Conor Dooley <[email protected]>
1 parent 65e4a0f commit f2b539a

File tree

1 file changed

+53
-1
lines changed

1 file changed

+53
-1
lines changed

arch/riscv/boot/dts/starfive/jh7110.dtsi

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <dt-bindings/clock/starfive,jh7110-crg.h>
99
#include <dt-bindings/power/starfive,jh7110-pmu.h>
1010
#include <dt-bindings/reset/starfive,jh7110-crg.h>
11+
#include <dt-bindings/thermal/thermal.h>
1112

1213
/ {
1314
compatible = "starfive,jh7110";
@@ -57,6 +58,7 @@
5758
operating-points-v2 = <&cpu_opp>;
5859
clocks = <&syscrg JH7110_SYSCLK_CPU_CORE>;
5960
clock-names = "cpu";
61+
#cooling-cells = <2>;
6062

6163
cpu1_intc: interrupt-controller {
6264
compatible = "riscv,cpu-intc";
@@ -86,6 +88,7 @@
8688
operating-points-v2 = <&cpu_opp>;
8789
clocks = <&syscrg JH7110_SYSCLK_CPU_CORE>;
8890
clock-names = "cpu";
91+
#cooling-cells = <2>;
8992

9093
cpu2_intc: interrupt-controller {
9194
compatible = "riscv,cpu-intc";
@@ -115,6 +118,7 @@
115118
operating-points-v2 = <&cpu_opp>;
116119
clocks = <&syscrg JH7110_SYSCLK_CPU_CORE>;
117120
clock-names = "cpu";
121+
#cooling-cells = <2>;
118122

119123
cpu3_intc: interrupt-controller {
120124
compatible = "riscv,cpu-intc";
@@ -144,6 +148,7 @@
144148
operating-points-v2 = <&cpu_opp>;
145149
clocks = <&syscrg JH7110_SYSCLK_CPU_CORE>;
146150
clock-names = "cpu";
151+
#cooling-cells = <2>;
147152

148153
cpu4_intc: interrupt-controller {
149154
compatible = "riscv,cpu-intc";
@@ -198,12 +203,47 @@
198203
};
199204
};
200205

206+
thermal-zones {
207+
cpu-thermal {
208+
polling-delay-passive = <250>;
209+
polling-delay = <15000>;
210+
211+
thermal-sensors = <&sfctemp>;
212+
213+
cooling-maps {
214+
map0 {
215+
trip = <&cpu_alert0>;
216+
cooling-device =
217+
<&U74_1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
218+
<&U74_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
219+
<&U74_3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
220+
<&U74_4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
221+
};
222+
};
223+
224+
trips {
225+
cpu_alert0: cpu_alert0 {
226+
/* milliCelsius */
227+
temperature = <85000>;
228+
hysteresis = <2000>;
229+
type = "passive";
230+
};
231+
232+
cpu_crit {
233+
/* milliCelsius */
234+
temperature = <100000>;
235+
hysteresis = <2000>;
236+
type = "critical";
237+
};
238+
};
239+
};
240+
};
241+
201242
dvp_clk: dvp-clock {
202243
compatible = "fixed-clock";
203244
clock-output-names = "dvp_clk";
204245
#clock-cells = <0>;
205246
};
206-
207247
gmac0_rgmii_rxin: gmac0-rgmii-rxin-clock {
208248
compatible = "fixed-clock";
209249
clock-output-names = "gmac0_rgmii_rxin";
@@ -517,6 +557,18 @@
517557
status = "disabled";
518558
};
519559

560+
sfctemp: temperature-sensor@120e0000 {
561+
compatible = "starfive,jh7110-temp";
562+
reg = <0x0 0x120e0000 0x0 0x10000>;
563+
clocks = <&syscrg JH7110_SYSCLK_TEMP_CORE>,
564+
<&syscrg JH7110_SYSCLK_TEMP_APB>;
565+
clock-names = "sense", "bus";
566+
resets = <&syscrg JH7110_SYSRST_TEMP_CORE>,
567+
<&syscrg JH7110_SYSRST_TEMP_APB>;
568+
reset-names = "sense", "bus";
569+
#thermal-sensor-cells = <0>;
570+
};
571+
520572
syscrg: clock-controller@13020000 {
521573
compatible = "starfive,jh7110-syscrg";
522574
reg = <0x0 0x13020000 0x0 0x10000>;

0 commit comments

Comments
 (0)