MSM8994 thermal管理

来源:互联网 发布:淘宝一千零一夜报名 编辑:程序博客网 时间:2024/06/06 16:53

点击打开链接

1MSM8994 Power Thermal Management Overview文档摘要

本文档为80-NM328-12_A_MSM8994_LA_Power_Thermal_Mgmt_Overview.pdf的学习笔记。

Thermal Mitigation Software Concept Architecture

Thermal Mitigation软件架构:

 

Graphic core temp:GPU温度

physical layout:物理布局

throttle:调节

Temperature Sensors – Placement and Increased Coverage

温度传感器的位置和增加的覆盖

1、温度传感器被放置在硅芯片的热点附近。

MSM8660上首次使用片上温度传感器(On-die sensors),有1On-die sensors;

MSM8960有5个on-die sensors;

MSM8930 有10个on-die sensors;

APQ8084, MSM8974, and APQ8064有11个on-die sensors;

MSM8994有16个on-die sensors。大大提高了识别和定位热问题的能力。

2、增加温度传感器(thermistors) 是PWB需要,放在功率放大器附近。

3、由于采用新的硬件架构,片上温度传感器(On-die sensor)的精度和采样率大大提高。

MSM8994的精度:<1.5

采用率达到3.5msthermal actions响应更灵敏

在SBL1阶段,如果温度超过high/low阈值,基于硬件设计的tsens_reset将触发温度保护以保护设备。

Placement of MSM8994 On-Die Temperature Sensors

MSM8994片上温度传感器的位置。

MSM8994上一共有16个片上温度传感器。

如下图所示,片上温度传感器的位置及sensor ID由绿点表示。

 

Thermal Management Software Overview

Thermal管理软件概述。

1thermal管理软件

§ 管理内存情形下的温度,上限为85℃。

   管理外设表面温度,金属上限为55℃,OEM /载体通常为45°C

2Sensors

§ MSM芯片上的传感器

§ 板上热敏电阻 – PMIC, PA, XO, etc.

3、设备管理

§ 通过降低性能实现被动式散热

§ OEM可以通过设置配置文件来设置阈值。

 

 

Boot Thermal Management (BTM) Algorithms

开机热管理(BTM)算法

限制启动电压

§ 在设备启动之前确保温度是在有效工作范围。

§ 温度阈值、延时时间、最大尝试次数,这些值在boot loader build中设置

 

BTM Configuration Hardcoded

BTM配置硬编码。

§ .nLowerThresholdDegC默认设置为150℃,BTM几乎是禁用的。 is set to 150蚓 by default and BTM is virtually disabled.

§ 如果OEM.nLowerThresholdDegC定义了适当的温度阈值,当前温度高于阈值时候,开机可以延期并多次尝试。但尝试次多超过规定值时候,开机将失败。

boot_images/core/hwengines/tsens/config/8994/BootTempCheckBsp.c

 

 

Kernel Thermal Monitor (KTM)

1Bootup降温

KTM是一个kernel driver,该驱动在开机时候很早就被初始化,这样可以保证该驱动正确运行并保护设备不会因为过热损坏。

一旦该驱动初始化完毕,它将开始轮询温度,并当温度超过阈值时候采取降温措施。

在Bootup时候,KTM可以做的温度mitigations/monitoring包括:

§ CPU frequency mitigation,CPU频率减缓

§ CPU core control,CPU核心控制

§ Thermal reset,热复位

§ Vdd restriction,Vdd限制

§ CX phase selection voting,

§ GFX phase selection voting,

§ PMIC Auto/PWM mode switch,PMIC Auto/PWM模式切换

§ VDD MX voting,

§ Optimum current request,

§ 在开机阶段的后期,KTM切换到中断模式。在转换到中断模式之前,bootup阶段所有的降温措施将不再起作用。

2Post-bootup降温

在系统进入初始化后期阶段之后,KTM将清除掉当前所有的mitigation/monitoring并转换到中断模式。在该阶段,thermal-sys framework被初始化,thermal使用framework设置阈值及接收通知。转换到中断模式不需要依赖thermal engine。

在post-bootup时候,KTM可以做的温度mitigations/monitoring包括:

§ Emergency frequency mitigation,紧急频率减缓

§ Emergency hotplug,紧急热插拔

§ Thermal reset,热复位

§ Vdd restriction,Vdd限制

§ CX phase selection voting

§ GFX phase selection voting

§ VDD MX voting

§ Optimum current request

§ 以上KTM特性与thermal engine一起更好的保护设备。

KTM Configuration Kernel Device Tree

KTM内核设备树配置。

qcom,msm-thermal {

              compatible = "qcom,msm-thermal";

              qcom,sensor-id = <5>;

              qcom,poll-ms = <250>;

              qcom,limit-temp = <60>;

              qcom,temp-hysteresis = <10>;

              qcom,freq-step = <2>;

              qcom,freq-control-mask = <0xf>;

              qcom,core-limit-temp = <80>;

              qcom,core-temp-hysteresis = <10>;

              qcom,core-control-mask = <0xe>;

              qcom,hotplug-temp = <110>;

              qcom,hotplug-temp-hysteresis = <20>;

              qcom,cpu-sensors = "tsens_tz_sensor6", "tsens_tz_sensor13",

                                   "tsens_tz_sensor14", "tsens_tz_sensor15";

              qcom,vdd-restriction-temp = <5>;

              qcom,vdd-restriction-temp-hysteresis = <10>;

              qcom,pmic-sw-mode-temp = <85>;

              qcom,pmic-sw-mode-temp-hysteresis = <75>;

              qcom,pmic-sw-mode-regs = "vdd-dig";

              qcom,vdd-dig-rstr{

                              qcom,vdd-rstr-reg = "vdd-dig";

                              qcom,levels = <5 7 7>; /* Nominal, Super Turbo, Super Turbo */

                              qcom,min-level = <1>; /* No Request */

              };

              qcom,vdd-gfx-rstr{

                              qcom,vdd-rstr-reg = "vdd-gfx";

                              qcom,levels = <5 7 7>; /* Nominal, Super Turbo, Super Turbo */

                              qcom,min-level = <1>; /* No Request */

              };

              qcom,vdd-apps-rstr{

                              qcom,vdd-rstr-reg = "vdd-apps";

                              qcom,levels = <1881600 1958400 2265600>;

                              qcom,freq-req;

              };

}

KTM Mitigation Thresholds Examples

 

 

User Space Thermal Engine

1Thermal daemon从MSM8660平台开始使用。

2Thermal engine在thermal daemon基础上实现了多个温度传感器的集中管理并支持多个算法

Thermal engine支持thermal daemon和高级动态算法并联运行。OEM可以通过修改thermal engine配置文件来选择算法。

虚拟传感器(Virtual sensor):使用2个以上传感器,按权重计算温度,使得得到的温度值更精准。

Override mode:修改setpoint,以提高性能

Thermal engine参数举例:

 

Thermal Mitigation Algorithms

热缓解算法。

1、在thermal配置文件中可以使用两种算法。

§ Dynamic Thermal Management (DTM) – algo_type_ss,动态热管理

§ Monitor – algo_type monitor

2DTM

§ Configuration – algo_type ss

§ OEM决定维持的温度,算法动态执行OEM制定的措施,比如调节CPU频率。

   用来控制表面温度和片上温度。要求调整的措施比monitor少,温度限制执行更严格。

§ 仅对CPUCPU进行操作,比如降低最大频率。

§ 通过修改thermal-engine.conf文件中的set_point和set_point_clr来修改阈值。

3Monitor algorithm for LCD, modem, camcorder, battery

§ Configuration – algo_type monitor

§ OEM定制一组温度阈值以及与各温度对应的温度措施。

§ Monitor算法用于LCD, modem, camcorder, and battery mitigation。不推荐CPU and GPU mitigation,因为CPU and GPU mitigation要求广泛的调整以维持setpoint

§ 通过修改thermal-engine.conf文件中的set_point和set_point_clr来修改阈值。

对于CPU and GPU mitigation,强烈推荐使用DTM,而不是monitor,因为DTM可以大大减轻调整的工作,提高性能,更能严格保持在OEM设定的温度点setpoint。

  

 

Threshold Algorithm

阈值算法。

检测温度超过阈值,相应的降温措施将启动。比如当传感器温度达到70℃,GPU频率将从500降到333MHz

最终传感器温度保持的温度点是85℃。

 

 

Dynamic Algorithm Example (Estimated Response)

动态算法的例子(估计响应)。

当温度超过setpoint75℃),降低设备性能直到温度稳定。轮询模式启用,采样率为定义的数值。 

当温度温度超过setpoint以及温度降到setpoint75℃)以下,设备性能均会降低。

最大允许频率可以呈递增、递减变化。

如果温度50℃以下,中断模式将再次启用。

仅用来控制CPU/GPU。

 

 

Default Thermal Configuration

Thermal默认配置。

1QTI在代码中提供了一套默认的thermal配置。该套配置参数需要根据OEM的需要进行调整。调整方法可以参考文档:Thermal Tuning Procedure (80-N9649-1)。

2使用adb命令可以查看当前的thermal配置:thermal-engine -o

§ 该命令将打印出当前的thermal规则,包括QTIOEM设置的。

3默认的配置参数

(1)关键温度结点的管理规则 (默认85℃)

§ Label examples – [SS-CPU0], [SS-CPU1], [SS-CPU2], [SS-CPU3], [SS-CPU4-5-6-7]

§ 这些规则不应该增加它们的默认值。

§ 源程序:

§ /vendor/qcom/proprietary/thermal-engine/ss-data.c

§ /vendor/qcom/proprietary/thermal-engine/thermal_monitor-data.c

(2)表面温度管理规则

§ OEMthermal-engine.conf中添加,然后放到手机路径/system/etc/thermal-engine.conf

(3)其他默认规则不要修改 e.g., VDD_RSTR_MONITORTSENSX

Adding Custom Thermal Configuration to Device

添加自定义热配置到设备。

1、不需重新编译代码,自定义的thermal配置可以添加到设备里面。

2、先基于老的thermal-engine.conf修改,然后使用adb命令推送到手机里面。

§ adb push <location_of_thermal-engine.conf> /system/etc/thermal-engine.conf

3、比如,为GPU添加一条规则。在thermal-engine.conf中添加:

[SS-GPU]

algo_type ss

sampling 65

sensor tsens_tz_sensor12

device gpu

set_point 60000

set_point_clr 57000

time_constant 0

上面例子为thermal配置添加了一个名叫[SS-GPU]的规则,将修改后的thermal-engine.conf推送到手机,然后重启手机,新thermal配置将生效。

4同样,不添加新规则,修改原来的规则也可以按照上面方法来操作。

5、禁用一个规则

例如禁用规则[SS-POPMEM]:

[SS-POPMEM]

disable 1

  

 

Overall AP Thermal Management Mechanism

整体AP热管理机制

有三种不同的TMS

§ SBL temperature check

§ Kernel thermal monitor

§ Full thermal engine with KTM post-boot feature enabled

 

Thermal Software Features/Management Devices

Feature 

Description

CPU TM

调整最大允许操作频率。

GPU TM

调整最大允许操作频率。

CPU Core

关闭安全机制以确保在关键温度点之前CPU核心关闭

Modem TM

调整峰值数据速率、最大发射功率、数据呼叫终止。

Camcorder TM

调整编码帧率、关闭解码功能

WLAN TM

调整峰值数据速率

LCD Backlight TM

调整最大背光亮度

Battery Charging TM

调整最大允许充电率

Battery Current Limiting

限制充电电流

Speaker Coil Calibration

扬声器线圈的校准。扬声器线圈电阻与温度的自动校准,防止温度过高或者输出功率过高损坏扬声器线圈。

Voltage Restriction

Voltage restriction enables low operating voltage above 0°C by adjusting the required minimum voltage at temperature extremes

Kernel TM

Adjustment of maximum allowed operating frequency during kernel initialization and post-boot device protection

Override Mode

Overrides thermal setpoint to allow higher performance for benchmarks or thermally aware applications

Dynamic Parameter Update

Important parameter sets can be updated at runtime for better OEM-specific dynamic thermal management

 


2、References

180-NM328-12_C_MSM8994_MSM8992_LA_Power_Thermal_Mgmt_Overview.pdf

280-NM328-12_A_MSM8994_LA_Power_Thermal_Mgmt_Overview.pdf

 

文中图片和表格可以联系本人。



0 0
原创粉丝点击