2023年12月9日發(作者:舊書不厭百回讀的下一句)
展銳平臺的溫控策略介紹
這里以UDX710為例介紹下展銳平臺的溫控策略,展銳其他平臺也類似。
1. UDX710芯片內部有6顆 Thermal nsor,相關位置信息如表 1-1。 2. 溫度讀取: 在控制臺下通過 cat命令獲取每個的溫度,各個
nsor路徑如路徑如表1-2。 例如下面命令獲取apcpu0的溫度,結果為 34.652℃。注意單位為 0.0001℃。
1
2
# cat /sys/class/thermal/thermal_zone1/temp
34652
Senosr name也可能通過命令確認,讀取 nsor目錄的type節點即可。
1
2
# cat /sys/class/thermal/thermal_zone1/type
apcpu0-thmzone
3. 虛擬nsor soc-thmzone 通過軟件查看nsor的文件節點,會發現有一個 thermal_zone0,type是 soc-thmzone。soc-thmzone
是 IPA(Intelligent Power Allocation智能功率分配)通過 ap cpu的所有nsor計算出來的一個溫度,用來做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。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
soc_thmzone: soc-thmzone {
polling-delay-passive = <100>;
polling-delay = <1000>;
sustainable-power = <1000>;
thermal-nsors = <&soc_nsor 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";
};
soc_crit: soc_crit {
temperature = <113000>; //
重啟溫度適當提高
--> 113
hysteresis = <2000>;
type = "critical";
};
};
……
}
驗證在85°C以上會降頻的:
temp: cpu0-89430 nrcp-91570 cpu1-88811
freq: cpu0-1352000 1-1352000
Time : -----Wed Mar 9 18:45:56 CST 2022-----
temp: cpu0-90710 nrcp-92865 cpu1-90106
freq: cpu0-768000 1-768000
Time : -----Wed Mar 9 18:45:59 CST 2022-----
temp: cpu0-90710 nrcp-92347 cpu1-90106
freq: cpu0-768000 1-768000
Time : -----Wed Mar 9 18:46:02 CST 側降溫措施 5.1 4G功率回退 5.2 5G功率回退 5.3 5G降速 配置文件在代碼中的路徑: layers/meta-
unisoc/recipes-core/thermal/files/udx710-module/ 在設備中的路徑:
/etc/ 調試時可以直接修改這個文件。由于/etc為只讀文件系統,不能直接替換該文件進行調試。可以把配置
文件push到 /home/root/ 目錄下,需要重啟thermal進程,并且設備重新開機后失效,要重新啟動thermald。命令如下:
adb push D: /home/root/
root@udx710-module:/ # /etc/init.d/ restart
文件如下:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
溫度上升過程中的執行策略( Action):1. 在同一個 Level 里,如果這次的溫度大于等于這個 Level 的溫度,則跳到該 Level 里的下一個 Trip。
2. 如果當前 Trip 已經是該 Level 的最后一個 Trip,并且溫度小于下一個 Level 的溫度,則沒有變化。
3. 如果當前 Trip 已經是該 Level 的最后一個 Trip,并且溫度大于等于下一個 Level 的溫度,則跳到下一個Level 的第一個Trip。
溫度下降過程中的執行策略( Action):
1. 在同一個 Level 里,如果這次的溫度小于這個 Level 的溫度,則跳到該 Level 里的前一個 Trip。
2. 如果當前 Trip 已經是該 Level 的第一個 Trip,并且溫度小于該 Level 的溫度,則跳到前一個 Level 的 最后一個 Trip。
CP側策略用到的nsor type是pa-thmzone,pa5g-thmzone。需要在設備樹中添加:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
&thm_zone {
pa_thmzone: pa-thmzone {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-nsors = <&pa_thermistor>;
};
pa5g_thmzone: pa5g-thmzone {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-nsors = <&pa5g_thermistor>;
};
bd_thmzone: board-thmzone {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-nsors = <&board_thermistor>;
};
};
在控制臺下可以讀到這幾個nsor的名字以及溫度:
cat /sys/class/thermal/thermal_zone7/type
pa-thmzone
cat /sys/class/thermal/thermal_zone8/type
pa5g-thmzone
cat /sys/class/thermal/thermal_zone9/type
board-thmzone
cat /sys/class/thermal/thermal_zone7/temp
30126
驗證cp側溫控策略可以用風槍給模塊加熱,讓其溫度達到xml中設置的溫度,導出:
adb pull /mnt/data/ d:
檢查log中應該有類似如下功率回退的命令:
Mar 9 18:14:55.985 (none) thermald[4100]: do,===>powerback, mArg:AT+SPTPPB=2, mFileNode: 就表示CP側的
策略生效了。
本文發布于:2023-12-09 21:25:33,感謝您對本站的認可!
本文鏈接:http://www.newhan.cn/zhishi/a/88/40379.html
版權聲明:本站內容均來自互聯網,僅供演示用,請勿用于商業和其他非法用途。如果侵犯了您的權益請與我們聯系,我們將在24小時內刪除。
本文word下載地址:展銳平臺的溫控策略介紹.doc
本文 PDF 下載地址:展銳平臺的溫控策略介紹.pdf
| 留言與評論(共有 0 條評論) |