MSM8225 thermal设计
點擊打開鏈接
1、概述
1.1、Thermal綜述
籠統的講,thermal是指移動終端電路板上的溫度。Thermal的數值應當維持在合理的溫度范圍之內,過高的溫度會影響用戶的使用體驗,更高的溫度甚至會損壞設備。通過實際應用,發現了thermal一些潛在的問題,提高了thermal管理的必要性:
市場對功能豐富的設備的需求提高了對溫度的敏感度;
豐富的多媒體功能,例如MiFi、多核GHz的處理器、圖形處理器、高清視頻等,增加了散熱;
更小更薄的PCB設計,集中了功率密度;
小外形設備里面的功率放大器溫度容易達到很高;
啟用數據傳輸速率更高的UL,往往會造成較高的發射功率,導致更多的散熱;
觸摸設備的外殼溫度可能會引起客戶的關注;
芯片級的溫度必須保持低于指定的限制;
印刷電路板上面的嵌入式設備暴露在較高的環境溫度和受限制的冷卻設施,形成了一個更嚴重的熱環境。
熱設計(thermal?design)的目標是為了提高產品的可靠性。良好的硬件熱設計和基于軟件的thermal管理方案可以使手機溫度保持在可被用戶接受的水平。
1.2、Thermal設計的物理設計和布局
為了限制thermal對設備的不良影響,采用下面的物理設計和布局技術很有必要:
在產品設計和開發階段進行熱分析;
研究設備功率和熱預算從而定位發熱點;
在設備的機械結構中采用高效的thermal管理方法;
確保功率放大器放在熱量容易消散的位置;
隨著印刷電路板內的熱路徑廣泛使用熱通孔是必要的;
確保在確保在MSM/MDM附近以及電路板的對面沒有其他大型電源散熱組件。
強烈建議在工業設計中使用散熱技術。
1.3、Thermal設計的目標
Thermal設計的目標是:
保護元件免于超過熱設計極限,如果超出限制,設備性能將會降低,甚至會損壞器件;
確保體驗者在使用或者攜帶時候觸摸溫度不會太高;
電源限制約束的風險降到最低;
管理并發操作時候的熱風險;
允許有限的客戶自定義溫度閾值和降低功耗的方法。
?
1.4、Thermal設計的先決條件
為了妥善管理設備的thermal情景,必須從不同的熱活性點測量溫度。它是通過已經存在于該芯片組傳感器和將熱敏電阻放置在熱活性點來實現。
首選的傳感器位置如下所列。每個傳感器可以被高通芯片內的ADC(HKADC)讀取。
1、靠近功率放大器的熱敏電阻器。功率放大器是導致設備溫度上升的主要器件。
2、MSMs/MDMs中的熱敏電阻或者內部傳感器。較大處理器(AP?或者modem處理器)的使用趨向于增加此類組件產生的熱量。
3、獨立的第三方組件。如果使用外部的發熱元件,比如使用第三方AP的設計,應該放置熱敏電阻。
4、TCXO熱敏電阻。在極端熱環境下,TCXO往往最容易受到加熱,這可能會導致丟失呼叫和較差的性能。感知這種情況,將有助于調用thermal算法。
5、其他位置,比如battery、PMIC等。
高通公司建議將熱敏電阻放置在溫度活躍器件附近。
?
?
?
?
2、Thermal管理算法
Thermal管理算法(Thermal?Management?Algorithm)提供一個安全策略,防止用戶的移動設備損壞。要做到這一點,有必要降低功耗以使溫度保持在可接受的水平。該算法仔細檢測設備的關鍵溫度并在modem和AP層設置合適的處理措施。
| 關鍵因素 | 熱影響 | 描述 | 開發階段 | 責任人 | |
| 研發 | QCT | ||||
| 機械散熱設計 | ~70% | 散熱的機械設計是必需的。 | 概念/模擬階段 | Yes | No | 
| 增加散熱材料 | ~20% | 添加散熱材料 | 模擬/驗證階段 | Yes | No | 
| 軟件管理 | ~10% | 需要保持熱限制 | 驗證階段 | Yes | No | 
表格1?Thermal管理的關鍵因素
Thermal管理算法包括三種狀態:
a)?正常狀態:被動的溫度監控;
b)?緩解狀態:降低性能(應用處理器將運行在較低的時鐘速率);
c)?應急狀態:強制關閉手機,以防止損壞。
該算法根據設備的溫度判斷設備屬于何種狀態。Thermal管理算法的工作方式如下:
a)?如果測量溫度<閾值溫度,在正常狀態下運行;
b)?如果測得的溫度>閾值溫度,進入緩解狀態;
c)?如果溫度恢復到滯后閾值(threshold-hysteresis)以下,恢復到正常狀態;
d)?如果溫度>緊急閾值,關閉設備。
設計thermal管理算法需要符合以下條件:
a)?采用溫度傳感器獲取thermal溫度數據;
b)?在thermald.conf文件中設置閾值值。
閾值數據應該由手機的溫度曲線決定,不同的閾值,系統的動作如下:
| ? | 正常 | 較高 | 嚴重 | 危急 | 
| CPU頻率 | 整個頻率范圍 | 性能最高的頻率除外 | 中高性能的頻率除外 | 最高實用頻率上限 | 
| 顯示強度 | 默認強度 | 上限為90% | 上限為75% | 上限為50% | 
| 電池充電 | 完整充電 | 涓流充電 | 不充電 | 不充電 | 
表格?2系統的動作
?
3、電路設計
MSM8x25采用如圖1所示硬件設計。MSM8x25添加了一個板上熱敏電阻,通過ADC驅動從該熱敏電阻讀取電路板溫度數據,然后傳遞給thermal算法(thermal?algorithm)。
?
圖表?1?MSM_THERM?schematic
?
?
圖表?2?I380W?MSM_THERM?schematic
?
?
?
4、Thermal軟件設計
如圖3所示,Thermal管理軟件包括3個主要模塊:thermal?daemon、傳感器輸入(sensor?inputs)以及thermal管理設備(thermal?management?devices)。此外,在boot和kernel初始化中采用算法管理thermal性能。
?
?
圖表?3?LA?thermal?software?architecture
Thermal?daemon是一個運行在Linux?Android用戶層的超級用戶程序,是thermal軟件的控制核心。傳感器輸入(Sensor?input)用來作為讀取的溫度,數據來自PMIC_THERM或者MSM_THERM,這些數據從DALRPC或者從ONCRPC接口讀取,ONCRPC接口與ADC驅動通信。Thermal管理設備(thermal?management?devices)是監聽thermal?daemon的軟件組件。當系統過熱時,thermal?daemon發送event到thermal管理設備以設置設備性能到一個預先設定的水平。
?
4.1?ThermalD
Thermal?Daemon?(ThermalD)主要用來完成兩項功能:監測溫度和管理控制設備。
該daemon監測thermal/temperature的傳感器數據,并根據thermald.conf配置文件(默認是?/etc/thermald.conf)執行動作。在初始化階段,ThermalD讀取一個包含所有傳感器和閾值數據的配置文件。如果超過溫度閾值,ThermalD發送event到thermal管理設備??傮w而言,設備管理接口劃分為幾個管理等級。典型地,將設備設置為4級,比如Level?0是正常操作;Level?1是管理的第一級。
(1)ThermalD生成
ThermalD?對應的可執行文件是thermald,由vendor/qcom/proprietary/thermal/下的代碼編譯生成,存放在設備路徑system/bin/thermald。
(2)ThermalD執行過程
圖表?4定義ThermalD?service
?
圖表?5啟動ThermalD程序
?
圖表?6?ThermalD處理流程
?
4.2?Thermal?sensors
MSM8x25提供兩種讀取溫度數據的方法供選擇:HKADC從PMIC片上熱敏電阻讀取和通過ADC讀取外部熱敏電阻來檢測MSM的運行溫度。HKADC是PM8029芯片內部的一個硬件模塊,提供讀到的模擬數據。
軟件設計上,MSM8x25相應有兩個thermal緩解解決方案,這兩種解決方案是互斥的:
a)?PMIC熱敏電阻:使用DALRPC。
b)?MSM熱敏電阻:外部熱敏電阻,使用ONCRPC。
可以通過檢查adc_null來查看ONCRPC是否可用,如果ONCRPC可用,則檢查MSM熱敏電阻是否工作,并最終從ONCRPC讀取thermal溫度;如果ONCRPC不可用,則從PMIC獲取thermal溫度數據。
?
4.2.1?HKADC
HKADC是PM8029芯片內部的一個硬件模塊,用來讀取PMIC模擬輸入。如圖所示,在MSM8x25參考設計中有一個片上PMIC熱敏電阻。從該熱敏電阻讀取的數據通過HKADC驅動傳遞到thermal算法(thermal?algorithm),HKADC驅動采用PMIC_THERM?DALRPC。
?
圖表?7?MSM8x25?PMIC_THERM?schematic
?
4.2.2?MSM_THERM
如圖所示的邏輯電路必須添加一個板上熱敏電阻(on-board?thermistor)來實現。從該熱敏電阻讀取的數據通過ADC驅動傳遞給thermal算法(thermal?algorithm),ADC驅動采用PMIC_THERM?ONCRPC。
?
?
圖表?8?MSM_THERM?schematic
4.3?TMD
Thermal管理設備(Thermal?Management?Devices,TMD)是軟件實體,用來降低系統硬件模塊的整體功耗,從而降低熱負荷。
?
4.4?Thermal配置文件
Thermal配置文件配置了thermal管理軟件的操作參數。每一部分作為一個thermal域定義(thermal?zone?definition),與一個溫度傳感器關聯。在第一個thermal域定義的前面,thermal配置文件有一行默認采樣率。該默認值用于為thermal域定義里面沒有指定采樣率的傳感器配置采樣率。此外,在默認采樣率之前,如果插入單詞debug將使能ThermalD的debug信息輸出。
4.4.1?Thermal域定義?
如表所示,一個thermal域的配置包括以下參數:
表格?3?Thermal域
| Field?name? | Values? | Units? | Notes? | 
| temp?sensor?name? | See?Table?4? | ? | ? | 
| sampling? | 1000?to?65535? | ms? | sampling?rate?in?ms | 
| thresholds? | -273?to?273? | °C? | Threshold?to?activate? | 
| thresholds_clr? | -273?to?273? | °C? | Threshold?to?clear? | 
| actions? | See?Table?5 | ? | Action?to?act?upon?at?thresholds;?multiple?entries?allowed?are?separated?by?+?with?no?spaces;?this?should?be?same?for?all?threshold?levels | 
| action_info? | See?Table?6? | ? | Information?used?by?action;?multiple?entries?allowed?are?separated?by?+?with?no?spaces? | 
| ? | ? | ? | ? | 
Sampling是ThermalD與配置閾值比對溫度的速度。Thresholds、thresholds_clr、actions和actions_info構成閾值組合。在一個區可能有多個閾值組合。每個閾值組合分別定義thresholds、thresholds_clr、actions和actions_info。
?
表格?4?Sensor?names
| Name? | Notes? | 
| pmic_therm? | Remote?HKADC?driver?using?DALRPC? | 
| msm_therm? | Remote?ADC?driver?using?remote?ONCRPC? | 
?
表格?5?Sensor?actions?and?action?information
| Item | Action | Action?Info | Notes | 
| none? | Do?nothing | Set?to?0;?not?used?but?needed?for?parser?to?work?properly | Do?nothing.?This?mitigation?step?is?disabled.?If?a?threshold?is?crossed,?no?action?is?taken. | 
| report | Report?threshold?crossing?to?UI | Set?to?0;?not?used?but?needed?for?parser?to?work?properly | The?threshold?crossing?information?is?sent?across?an?abstract?local?socket?THERMALD_UI?in?a?new?line-separated?string?format.?Parameters?are?sent?in?the?following?order:? § sensorname?–?Name?of?sensor?reporting? § temperature?–?Current?temperature? § current_threshold_level?–?Current?threshold?level?triggered?or?cleared? § is_trigger?–?TRUE?on?level?trigger,?FALSE?on?level?clearing | 
| cpu | CPU?frequency?scaling | Max?CPU?frequency?in?KHz | Sets?the?max?allowable?frequency?for?CPUs,?0?to?1200000?kHz | 
| lcd | LCD?brightness?throttling | 0-255?value?for?max?LCD?brightness | Sets?the?backlight?intensity;?will?not?adjust?the?max?value?over?the?currently?configured?brightness?set?by?the?user. 0?to?255? § 0?–?Backlight?off? § 255?–?Maximum?brightness | 
| modem | Request?throttling?of?modem?functionality | 0-3?throttling?level?for?modem?mitigation | MSM8x25不支持。 | 
| fusion | Request?throttling?of?fusion?modem?functionality | 0-3?throttling?level?for?fusion?modem?mitigation | MSM8x25不支持。 | 
| battery | Battery?charging?current?throttling | 0-3?throttling?level?for?battery?charging?current | MSM8x25不支持。僅MSM8960支持 | 
| gpu | GPU?frequency?scaling | Max?GPU?frequency?in?Hz | ? | 
| wlan | WLAN?throttling | 0-3?throttling?level?for?WLAN?mitigation | MSM8x25不支持。僅MSM8960支持 | 
| shutdown | Shutdown?target | Shutdown?delay?in?ms | Sends?a?shutdown?request?to?the?kernel?with?a?delay?to?power?down?the?phone | 
?
?
4.4.2?配置文件的要求?
配置文件必須有一個pmic_therm或msm_therm?thermal域定義以用作第一個入口。
注意,在thermald.conf文件的結尾應該有一個返回字符。
Actions參數標明了每個閾值對應的動作。在一個閾值組合里面的actions和actions_info必須用“+”隔開,并且不允許出現空格。
每個閾值必須對應一個明確的action。
每個action必須有一個對應的action_info。
?
4.4.3?配置文件舉例
The?example?configuration?file?below?turns?on?verbose?debug?output?(line?1)?and?default?polling?rate?to?5?sec?(line?2).The?thermal?zone?definition?is?named?pmic_therm?or?msm_therm?based?on?the?hardware?configuration.?The?thermal?zone?definition?sets?a?sampling?rate?for?this?sensor?at?1?sec,?which?overrides?the?default?5?sec?rate.?The?first?threshold?group?in?the?pmic_therm/msm_therm?thermal?zone?definition?configures?an?activation?threshold?at?65°C,?an?action?for?the?CPU?to?mitigate?to?a?maximum?frequency?of?756?MHz,?a?second?action?for?the?LCD?to?mitigate?to?brightness?level?200?out?of?255;?the?threshold?will?clear?at?60°C.?The?second?threshold?group?configures?an?activation?threshold?at?75°C,?an?action?for?the?CPU?to?mitigate?to?a?max?frequency?of?540?MHz,?a?second?action?for?the?LCD?to?mitigate?to?brightness?level?100?out?of?255;?the?threshold?will?clear?at?70°C.??CPU?and?LCD?management?devices?are?reset?to?their?default?setting?upon?clearing?the?lowest?threshold?at?60oC.?
?
debug?
sampling?5000?
[pmic_therm]?
sampling?1000?
thresholds?65?75?
thresholds_clr?60?70?
actions?cpu+lcd?cpu+lcd?
action_info?756000+200?540000+100
?
4.4.4?編輯配置文件?
當通過USB將手機連接到電腦后,執行下面的命令可以編輯配置文件:
adb?pull?/etc/thermald.conf?
adb?remount?
<edit>?
adb?push?thermald.conf?/etc/
?
4.4.5?編譯配置文件
Thermal配置文件的存放路徑是/system/etc/thermald.conf。在源代碼中的存放路徑是vendor/qcom/proprietary/thermal/,使用ls?-l命令查看,顯示信息如下:
可見,在源代碼中是沒有命名為/thermald.conf的文件的。
之所以能夠在/system/etc/下看到thermald.conf,是因為在文件device/qcom/msm7627a/init.qcom.thermald_conf.sh中,做了鏈接:
所以,使用adb命令可以查詢到如下信息:
?
?
4.4.6?ThermalD?logging
在配置文件第一行加入“debug“可以使ThermalD工作在Debug?mode,否則ThermalD的log會非常少。
adb?shell?stop?thermald?
adb?shell?
#?thermald?--debug?&?
?
下面的命令將會使ThermalD?log信息顯示在命令行窗口。
adb?logcat?-s?ThermalDaemon?
?
顯示時間:?
adb?logcat?-v?time?-s?ThermalDaemon??
?
4.5?Modem?thermal?mitigation
MSM8x25在modem沒有熱緩解(thermal?mitigation)設計。
?
?
5、References
1、80-NA385-1_B_MSM8x25_Android_Pwr_Mgmt_Overview.pdf
2、80-N8633-5_A_MSM8x25_Thermal_Mgmt_Algorithm
文中圖片、表格數據可聯系本人索取。
總結
以上是生活随笔為你收集整理的MSM8225 thermal设计的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: 高通thermal-engine配置文件
- 下一篇: msm8909相关事宜
