Device Tree 温区、Trip 与 Cooling Map

Device Tree 温区、Trip 与 Cooling Map

1. 结构

1
2
3
4
5
6
7
8
9
10
thermal-zones {
zone-name {
polling-delay-passive = <...>;
polling-delay = <...>;
thermal-sensors = <&sensor index>;
sustainable-power = <...>;
trips { ... };
cooling-maps { ... };
};
};

2. Sensor provider

TSADC提供:

1
#thermal-sensor-cells = <1>

argument是 channel index。RK3588使用0~6。

3. Trips

1
2
3
4
5
trip {
temperature = <85000>;
hysteresis = <2000>;
type = "passive";
};

2°C hysteresis意味着上穿85°C激活,下降到约83°C以下才清除,具体状态由 Core的 trip crossed逻辑处理。

4. Cooling map

1
2
3
4
5
map {
trip = <&target>;
cooling-device = <&cpu_l0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
contribution = <1024>;
};

两个 cells为 lower/upper cooling state。NO_LIMIT由注册后设备最大状态替换/限制。

5. 解析

thermal_of.c

  1. 找到引用 sensor phandle/index的 zone;
  2. 解析 delays、sustainable power;
  3. 解析 trips;
  4. 注册 zone;
  5. cooling device出现时按 phandle匹配;
  6. 创建 instance。

probe顺序不同可后续绑定。

6. Writable trips

主配置启用 THERMAL_WRITABLE_TRIPS,但只有 zone注册 mask允许的 trip才可写;Kconfig只是允许能力,不代表所有 trip_point_*_temp 可写。

7. RK3588 soc zone

  • polling 1000ms;
  • passive polling 20ms;
  • sustainable power 2100mW;
  • 75°C passive threshold,无 cooling map;
  • 85°C passive target,绑定三组 CPU和 GPU;
  • 115°C critical。

在本版 power_allocator 中,第一个 passive trip作为 trip_switch_on,最后一个 passive trip作为 trip_max_desired_temperature。因此75°C是开启分配器的 switch-on温度,85°C是控制目标;75°C即使没有直接 cooling map也有明确作用。

8. 其它 zones

bigcore0/1、littlecore、center、GPU、NPU仅有115°C critical trip。它们提供局部热点安全监控,但公共 DTS没有各自降频 cooling map。

9. 常见错误

  • channel index错;
  • trip单位误写成°C而不是m°C;
  • cooling phandle无 #cooling-cells
  • lower > upper;
  • missing Energy Model/OPP;
  • zone node disabled;
  • sustainable power不符合板级散热;
  • hysteresis过小产生抖动。

文章互动

阅读 --

留言

0 条留言

正在加载留言…