SOC THERMAL DRAFT
This page is using the default release mx8mp-yocto-hardknott-5.10.72_2.2.1-v1.0.
To view this page for a specific Variscite SoM and software release, please follow these steps:
- Visit variwiki.com
- Select your SoM
- Select the software release
Introduction
The CPU temperature plays a crucial role in the optimal functioning and reliability of a computer system. As the CPU is the primary processing unit of a computer, it generates a significant amount of heat while executing tasks.
The temperature of the CPU must be within a safe range to ensure that the system
operates correctly, without any performance degradation or hardware damage. Therefore, monitoring and managing the CPU temperature is essential to maintaining a stable and efficient computer system.
If there are heat problems, using a heat plate or sink can be considered as an option to manage the temperature of the CPU. Variscite provides the heat sink on the accessories page:
DART-MX8M-PLUS Heatsink
VAR-SOM-MX8M-PLUS Heatsink
U-Boot
The imx_thermal driver is an essential component for ensuring the proper operation of i.MX SoCs, particularly in environments where high temperatures are a concern.
In U-Boot, the CPU temperature is monitored, and if it exceeds the critical temperature, the system waits until the temperature drops below the critical trip point before continuing with the boot process.
Starting from imx_v2017.03_4.9.11_1.0.0_ga_var01, the critical temperature is set automatically and set to the same values as in the more recent Linux kernel releases. The feature was introduced in the following commit:
Linux Kernel
In the User space, the current CPU's temperature sensor can be read as the following:
root@imx8mp-var-dart:~# cat /sys/devices/virtual/thermal/thermal_zone0/temp
Additionally, there are two thermal trip points that can be configured to control the behavior of the CPU based on temperature changes:
The first trip point, also known as the passive trip point, is set/read in:
root@imx8mp-var-dart:~# cat /sys/devices/virtual/thermal/thermal_zone0/trip_point_0_temp
The passive trip point refers to the temperature at which the kernel starts to reduce the performance of the SoC to prevent it from overheating.
This is done by lowering the CPU frequency and voltage to reduce the heat generated by the processor.
Once the temperature drops 10 °C below the passive trip point, the CPU frequency returns to its normal value.
The second trip point, the critical trip point, is read/set in:
root@imx8mp-var-dart:~# cat /sys/devices/virtual/thermal/thermal_zone0/trip_point_1_temp
The critical trip point is the temperature threshold at which the kernel will initiate an emergency shutdown to prevent damage to the processor due to overheating. This is a last-resort mechanism to protect the system from damaging itself.
Defining the default trip points values via Linux kernel device tree
Starting from kernel imx_4.9.11_1.0.0_ga-var01, the temperature grade of the CPU is detected automatically, and the trip points are set accordingly.
- For Commercial CPUs, the operational temperature ranges from 0 to 95 °C.
- For Extended Commercial CPUs, the operational temperature ranges from -20 to 105 °C.
- For Industrial CPUs, the operational temperature ranges from -40 to 105 °C.
The critical trip point is set to 5 °C below the maximum temperature, while the passive trip point is set to 10 °C below the maximum temperature.
In older releases, the temperature grade may not be detected automatically, and the trip points must be set manually. However, it is essential to be careful not to set the trip points of a higher-grade CPU on a lower-grade CPU to avoid damage. To manually set the trip points, the appropriate SYSFS file can be written to, but the default value of the passive trip point can not be exceeded without modifying the kernel source code.
To identify which processes are consuming more power, the powertop software package can be used.
DART-MX8M-PLUS device tree
Be very careful when changing the thermal trip points of your SoC manually. Note that changing the thermal trip points can have serious consequences if not done properly. It is important to understand the thermal characteristics of your device and to make careful modifications to the trip points to avoid causing damage or instability.
The imx8mp-var-dart temperature trip points can be changed by adding the following to its device tree:
&thermal-zones { cpu-thermal { trips { cpu_alert0: trip0 { temperature = <85000>; /* Sets passive trip point temperature, in millidegree Celsius */ hysteresis = <2000>; type = "passive"; }; cpu_crit0: trip1 { temperature = <95000>; /* Sets the critical trip point temperature, in millidegree Celsius */ hysteresis = <2000>; type = "critical"; }; }; }; };