这里以UDX710为例介绍下展锐平台的温控策略,展锐其他平台也类似。
1. UDX710芯片内部有6颗 Thermal sensor,相关位置信息如表 1-1。
2. 温度读取:
在控制台下通过 cat命令获取每个sensor的温度,各个sensor路径如路径如表1-2。
例如下面命令获取apcpu0的温度,结果为 34.652℃。注意单位为 0.0001℃。
# cat /sys/class/thermal/thermal_zone1/temp
34652
Senosr name也可能通过命令确认,读取 sensor目录的type节点即可。
# cat /sys/class/thermal/thermal_zone1/type
apcpu0-thmzone
3. 虚拟sensor soc-thmzone
通过软件查看sensor的文件节点,会发现有一个 thermal_zone0,type是 soc-thmzone。soc-thmzone 是 IPA(Intelligent Power Allocation智能功率分配)通过 ap cpu的所有sensor计算出来的一个温度,用来做cpu温控的。
4. AP温控措施
AP侧的温控主要是控制cpu,软件上使用的是IPA策略,根据目标控制温度以PID(Proportional Integral Derivative比例积分微分)算法来降频拔核。
除此之外还有高温关机。 详细控制温度如表 2-1。
AP侧没有在xml中配置相关策略,而是直接使用dts中默认的配置。
以dts的如下配置为例,70度(soc_threshold下的temperature = <70000>)是ipa的switch_on_temp,
85度(soc_target下的temperature = <85000>)是control_temp。
soc_thmzone: soc-thmzone {
polling-delay-passive = <100>;
polling-delay = <1000>;
sustainable-power = <1000>;
thermal-sensors = <&soc_sensor 17>;
trips {
soc_threshold: trip-point@0 {
temperature = <70000>; //IPA开启温度
hysteresis = <1000>;
type = "passive";
};
soc_target: trip-point@1 {
temperature = <85000>; //IPA控制温度
hysteresis = <1000>;
type = "passive";