当前位置: 首页 > article >正文

全志A133 android10 thermal温控策略配置调试

一,功能介绍

Thermal简称热控制系统,其功能是通过temperature sensor(温度传感器)测量当前CPU、GPU等设备的温度值,然后根据此温度值,影响CPU、GPU等设备的调频策略,对CPU、GPU等设备的最大频率进行限制,最终实现对CPU、GPU等设备温度的闭环控制,避免SOC温度过高。


二,DTS配置

源码位置:longan/kernel/linux-4.9/arch/arm64/boot/dts/sunxi/sun50iw10p1.dtsi

thermal-zones {
        cpu_thermal_zone {
                polling-delay-passive = <500>; //温度超过阈值,轮询温度周期(ms)
                polling-delay = <1000>; //温度未超过阈值,轮询温度周期(ms)
                thermal-sensors = <&ths 0>;
                sustainable-power = <1200>; //温度达到预设温度最大值,系统可分配的最大power
                k_po = <66>;
                k_pu = <132>;
                k_i = <0>;

                cpu_trips: trips {
                        cpu_threshold: trip-point@0 {
                                temperature = <70000>; //代表系统温控在70度左右开启
                                type = "passive";
                                hysteresis = <0>;
                        };
                        cpu_target: trip-point@1 {
                                temperature = <90000>; //代表系统最高温度是90度左右
                                type = "passive";
                                hysteresis = <0>;
                        };
                        cpu_crit: cpu_crit@0 {
                                temperature = <110000>; //代表系统到达110度就会过温关机
                                type = "critical";
                                hysteresis = <0>;
                        };
                };
				cooling-maps {
                           map0 {
                                   trip = <&cpu_target>;
                                   cooling-device = <&cpu0
                                   THERMAL_NO_LIMIT
                                   THERMAL_NO_LIMIT>;
                                   contribution = <1024>; //cpu分配功率权重,通过调整cooling device对应的contribution,可以调整降频顺序和降频尺度
                           };
                   /*      map1{
                                   trip = <&cpu_target>;
                                   cooling-device = <&gpu
                                   THERMAL_NO_LIMIT
                                   THERMAL_NO_LIMIT>;
                                   contribution = <1024>;
                           };      */
                   };
           };
           gpu_thermal_zone{
                   polling-delay-passive = <500>;
                   polling-delay = <1000>;
                   thermal-sensors = <&ths 1>;
                   sustainable-power = <1100>;
           };
           ddr_thermal_zone{
                   polling-delay-passive = <0>;
                   polling-delay = <0>;
                   thermal-sensors = <&ths 2>;
           };
   };

temperature: 可根据产品温控规格,适当调整。

  1. 提高该参数,会允许系统在高温情况下运行更快,性能更好。当然,也会让产品的温度更高,所以需要注意,修改该参数后能否满足产品温度要求和高温测试等。
  2. 降低该参数就会在一定程度上降低高温情况下的性能,可以让产品运行在较低的温度。

三,调试方法

1. 查看sensor温度

查看thermal_zone的类型

#cat sys/class/thermal/thermal_zone0/type
cpu_thermal_zon

查看thermal_zone温度

#cat sys/class/thermal/thermal_zone0/temp
36000

温度单位为mC,也就是36摄氏度。

2. 模拟温度

thermal有温度模拟功能,可以通过模拟温度校验温度策略是否符合预期。

设置thermal_zone0的模拟温度
#echo 80000 > /sys/class/thermal/thermal_zone0/emul_temp
关闭thermal_zone0的模拟温度功能
#echo 0 > /sys/class/thermal/thermal_zone0/emul_temp

3. 关闭温控

a. 通过调试节点关闭温控

确认cpu温控为thermal_zone0

#cat /sys/class/thermal/thermal_zone0/type
cpu_thermal_zone

关闭温控策略

#echo disabled > /sys/class/thermal/thermal_zone0/mode

接触所有cooling device的限制

#echo 0 > /sys/class/thermal/thermal_zone0/cdev*/cur_state
b. 通过修改dts节点关闭温控

以关闭cpu温控为例,删除cpu_thermal_zone下的其他节点和属性

cpu_thermal_zone{
	polling‑delay‑passive = <0>;
	polling‑delay = <0>;
	thermal‑sensors = <&ths 0>;
};

http://www.kler.cn/a/538147.html

相关文章:

  • 机器学习笔记
  • fps动作系统9:动画音频
  • 学习数据结构(8)双向链表
  • 使用PyCharm进行Django项目开发环境搭建
  • Java | RESTful 接口规范
  • Android性能优化
  • ML.NET库学习003:基于时间序列的共享单车需求预测项目解析
  • 即时通讯开源项目OpenIM配置离线推送全攻略
  • 练习题 - Django 4.x Session 会话使用示例和配置方法
  • 数据结构:算法复杂度
  • python - 封装moondream(备份)
  • html css网页制作成品——HTML+CSS茶百道的茶网页设计(6页)附源码
  • 数据结构--八大排序算法
  • C06S02-Docker网络和资源限制
  • 3D gpr仿真
  • 使用 SDKMAN! 在 Mac(包括 ARM 架构的 M1/M2 芯片)上安装 Java 8
  • 深度解析DeepSeek模型系列:从轻量级到超大规模(附DeepSeek硬件配置清单)
  • 【C++语法】【STL】“for ( auto c : str )”类型的循环
  • FreeRtos实时系统: 九.FreeRTOS的时间管理
  • 【学Rust写CAD】5 三维转换矩阵解析及应用示例
  • 【ARM】MDK烧录配置文件无权限访问
  • 12.13 LangChain 运行时引擎解析:AgentExecutor vs PlanAndExecute vs AutoGPT
  • 三天急速通关MyBatis
  • c语言样式主题 清爽风格 代码色彩 keil风格 适合单片机开发GD32 STM32等 cursor或者vscode 的settings.json文件
  • Python第三方库复制到另一台电脑保持安装环境一致
  • 【RK3588嵌入式图形编程】-SDL2-创建应用事件循环