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.
Temperature management
Thermal management is an essential aspect of ensuring optimal performance of the processor. Although the system has software mechanisms to manage temperature, a good thermal design can improve the dissipation of the heat generated by the processor. Here are some extra components that can be used for temperature management:
- Fan: Fans are used to improve airflow and dissipate heat. When using a fan, it's essential to ensure that it's the appropriate size and has sufficient airflow to remove heat effectively.
- Thermal Interface: Thermal interfaces are used to fill gaps between the processor and heat sink to improve thermal conductivity. There are many types, such as thermal paste, thermal pads, and thermal tapes.
- Heat Sink: A heat sink is an essential component in a thermal design. It typically consists of a plate that has good thermal conductivity with a large surface area that is in contact with the device that generates heat, for instance, the processor. The heat is then transferred from the device to the heatsink.
Variscite provides the heat sink on the accessories page:
DART-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_zone*/temp
Additionally, there are thermal trip points that can be configured to control the behavior of the CPU based on temperature changes:
The passive trip point, 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 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
DART-MX8M-PLUS device tree
Be very careful when changing the thermal trip points of your SoC manually. 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. 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"; }; }; }; };
This node will instruct the kernel to periodically poll this temperature sensor and to shut down the SoC once it has exceeded 95 degrees Celsius. And will reduce CPU frequency using DFS by cpufreq-dt driver at 85 degrees Celsius.
powertop package
In addition, to identify which processes are consuming more power, the powertop software package can be used. It is a Linux tool used to diagnose issues with power consumption and power management
To install powertop, add the following line to the conf/local.conf file in your Yocto build:
IMAGE_INSTALL_append = "powertop"