Skip to content

Commit fe448c4

Browse files
committed
ARM: dts: at91: sama7g5: add thermal zones node
Add thermal zones node with its associated trips and cooling-maps. It uses CPUFreq as cooling device for temperatures in the interval [90, 100) degrees Celsius and describe the temperature of 100 degrees Celsius as critical temperature. System will be is shutting down when reaching critical temperature. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20221026124114.985876-7-claudiu.beznea@microchip.com
1 parent 5b48b3b commit fe448c4

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

arch/arm/boot/dts/sama7g5.dtsi

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <dt-bindings/gpio/gpio.h>
1818
#include <dt-bindings/mfd/at91-usart.h>
1919
#include <dt-bindings/nvmem/microchip,sama7g5-otpc.h>
20+
#include <dt-bindings/thermal/thermal.h>
2021

2122
/ {
2223
model = "Microchip SAMA7G5 family SoC";
@@ -36,6 +37,7 @@
3637
clocks = <&pmc PMC_TYPE_CORE PMC_CPUPLL>;
3738
clock-names = "cpu";
3839
operating-points-v2 = <&cpu_opp_table>;
40+
#cooling-cells = <2>; /* min followed by max */
3941
};
4042
};
4143

@@ -74,6 +76,46 @@
7476
};
7577
};
7678

79+
thermal-zones {
80+
cpu_thermal: cpu-thermal {
81+
polling-delay-passive = <1000>;
82+
polling-delay = <5000>;
83+
thermal-sensors = <&thermal_sensor>;
84+
85+
trips {
86+
cpu_normal: cpu-alert0 {
87+
temperature = <90000>;
88+
hysteresis = <0>;
89+
type = "passive";
90+
};
91+
92+
cpu_hot: cpu-alert1 {
93+
temperature = <95000>;
94+
hysteresis = <0>;
95+
type = "passive";
96+
};
97+
98+
cpu_critical: cpu-critical {
99+
temperature = <100000>;
100+
hysteresis = <0>;
101+
type = "critical";
102+
};
103+
};
104+
105+
cooling-maps {
106+
map0 {
107+
trip = <&cpu_normal>;
108+
cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
109+
};
110+
111+
map1 {
112+
trip = <&cpu_hot>;
113+
cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
114+
};
115+
};
116+
};
117+
};
118+
77119
clocks {
78120
slow_xtal: slow_xtal {
79121
compatible = "fixed-clock";

0 commit comments

Comments
 (0)