RZ/G2L微处理器Linux内核热管理详解:TSU与温控策略
RZ/G2L微处理器配备Cortex-A55(1.2 GHz)CPU、16位DDR3L/DDR4接口、带Arm Mali-G31的3D图形加速引擎以及视频编解码器(H.264)。此外,这款微处理器还配备有大量接口,如摄像头输入、显示输出、USB2.0和千兆以太网,因此特别适用于入门级工业人机界面(HMI)和具有视频功能的嵌入式设备等应用,具备较好的能耗比。

随着计算设备性能的不断提升,处理器、GPU、NPU的功耗和发热量显著增加,如何有效管理系统温度成为计算机系统设计中的重要课题。
如果没有适当的热管理,过高的温度会对系统稳定性、性能和寿命造成严重影响。如高温会导致电子元件的物理特性发生变化,例如电阻增大、信号延迟增加,甚至可能引发数据传输错误。当温度超过芯片的安全阈值时,可能会出现系统崩溃(crash)、死机(hang)、自动关机(shutdown)等问题。
为了避免过热,现代CPU和GPU内部通常会集成动态温度调节机制(Thermal Throttling),当温度接近上限时,系统会主动降低频率(降频)或减少运行核心数,以减少功耗和发热量。
在Linux内核中,Thermal Framework(热管理框架)提供了一套完整的温度管理机制,允许操作系统监测温度变化,并在必要时采取相应的散热措施。该框架主要通过CPU内置的温度传感器模块监控设备温度,并结合散热设备(如风扇、散热膜、导热胶等)和温控策略(如动态电压调节、核心关闭、降频或负载均衡)来优化系统散热。
RZ/G2L工作温度

本篇概要介绍下瑞萨RZ/G2L thermal软件策略。
硬件上依赖芯片内部的TSU(热传感器单元)。
规格如下

软件框架如下

一般产品开发者只需要配置对应策略的参数即可,如内核设备树,具体驱动原厂已经适配。
如下详细介绍设备树参数
左右滑动查看完整内容
tsu: thermal@10059400{
compatible ="renesas,r9a07g044-tsu",
"renesas,rzg2l-tsu";
reg = ;
clocks = ;
resets = ;
power-domains = ;
#thermal-sensor-cells =;
};
thermal-zones {
emergency {
polling-delay = ; /* 每隔1000ms获取一次温度 */
on-temperature = ; /* 超过110度,关闭 cpu1 */
off-temperature = ; /* 低于95度,恢复 cpu1 */
target_cpus = ; /* 是否关闭 cpu1 */
status ="disabled";
};
cpu-thermal {
polling-delay-passive = ; /* 温度高于trip-point-0指定的值,每隔250ms获取一次温度 */
polling-delay = ; /* 温度低于trip-point-0指定的值,每隔1000ms获取一次温度 */
thermal-sensors = ; /* 通过tsu 通道0获取温度 */
sustainable-power = ; /* 温度等于trip-point-1指定的值时,系统分配给cooling device的能量 */
cooling-maps {
map0 {
trip = ; /* 表示在target trip下,该cooling device才起作用 */
cooling-device = ; /* cpufreq 的频点从最高到最小频点排序,从0开始标注,0对应最高频率*/
contribution = ; /* 1024 整数倍,用于调整降频顺序和尺度 */
};
};
trips {
sensor_crit: sensor-crit {
temperature = ; // 默认关机温度,具体动作由thermal_core.c 函数 handle_critical_trips决定。
hysteresis = ;
type ="critical";
};
target: trip-point {
temperature = ; /* 100 度发生温控,对应 trip_point_1_temp 文件 */hysteresis = ; /* 滞后温度,当下降到(100 – 5000/1000) = 95 度时解除温控,对应 trip_point_1_hyst 文件 */type ="passive"; /* ”passive”,表示当温控发生后由governor控制policy */};};};}; cpus {#address-cells =;#size-cells =; cpu-map {cluster0 {core0 {cpu =;};core1 {cpu =;};};}; cpu0: cpu@0 {compatible ="arm,cortex-a55";reg =;device_type ="cpu";#cooling-cells =;next-level-cache =;enable-method ="psci";clocks =;operating-points-v2 =;}; cpu1: cpu@100 {compatible ="arm,cortex-a55";reg =;device_type ="cpu";next-level-cache =;enable-method ="psci";clocks =;operating-points-v2 =;}; L3_CA55: cache-controller-0 {compatible ="cache";cache-unified;
cache-size = ;
};
};
cpu 频率
cluster0_opp: opp-table-0{
compatible ="operating-points-v2";
opp-shared;
opp-150000000{
opp-hz = /bits/64;
opp-microvolt = ;
clock-latency-ns = ;
};
opp-300000000{
opp-hz = /bits/64;
opp-microvolt = ;
clock-latency-ns = ;
};
opp-600000000{
opp-hz = /bits/64;
opp-microvolt = ;
clock-latency-ns = ;
};
opp-1200000000{
opp-hz = /bits/64;
opp-microvolt = ;
clock-latency-ns = ;
opp-suspend;
};
};
左右滑动查看完整内容
测试信息节点:
当前温度:cat/sys/class/thermal/thermal_zone0/temp
工作频率:cat/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
cat/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_cur_freq
cpu是否在线:cat/sys/devices/system/cpu/cpu*/online
可以通过热风枪或温箱设备模拟环境加热,如上配置参数的控制过程。
总结如下
左右滑动查看完整内容
cpu温度 超过100度,启动降频 1.2G ->0.6G -> 0.3G 超过110度,关闭cpu1,并降频至 0.15G 超过125度,关机;
Linux Thermal框架的核心价值在于平衡性能与温度,通过智能热管理提升系统稳定性、延长硬件寿命、优化功耗,并提供灵活的适配性,使其成为计算设备热管理的关键组件。
产品设计参考
rzg2l-thermal-management-guideline
https://www.renesas.cn/zh/document/apn/rzg2l-thermal-management-guideline?r=1467981
rzg2l-power-consumption-measurement
https://www.renesas.cn/zh/document/apn/power-consumption-measurement?r=1467981
如果需要如下详细功率计算表,请联系销售或于本公众号后台菜单栏点击“样片申请”联系相应合作商获取。

原文标题:瑞萨RZ/G2L Linux Thermal Framework软件热管理介绍
文章出处:【微信号:瑞萨嵌入式小百科,微信公众号:瑞萨嵌入式小百科】欢迎添加关注!文章转载请注明出处。



