dts文件中的内核热区是什么意思?

时间:2018-11-01 03:21:28

标签: linux-kernel dts heat

在我内核的dts文件中,我有:

thermal-zones {
    cpu0_thermal: cpu0-thermal {
        thermal-sensors = <&tmuctrl_0>;
        polling-delay-passive = <1000>;
        polling-delay = <1000>;
        trips {
            cpu_alert0: cpu-alert-0 {
                temperature = <100000>;
                hysteresis = <1000>;
                type = "active";
            };
            cpu_alert1: cpu-alert-1 {
                temperature = <110000>;
                hysteresis = <1000>;
                type = "passive";
            };
            cpu_alert2: cpu-alert-2 {
                temperature = <120000>;
                hysteresis = <1000>;
                type = "passive";
            };
            cpu-crit-0 {
                temperature = <130000>;
                hysteresis = <1000>;
                type = "critical";
            };
        };

        cooling-maps {
            map0 {
                trip = <&cpu_alert0>;
                cooling-device = <&cpu0 1 1>;
            };
            map1 {
                trip = <&cpu_alert1>;
                cooling-device = <&cpu0 4 4>;
            };
            map2 {
                trip = <&cpu_alert2>;
                cooling-device = <&cpu0 10 10>;
            };
        };
    };
};

似乎被动表示仅使用CPU,主动表示使用任何FAN冷却设备。

我的问题:这两个数字在CPU的冷却设备中代表什么?

https://www.kernel.org/doc/Documentation/devicetree/bindings/thermal/thermal.txt说:“冷却状态由单个无符号整数表示,数字越大表示散热量越大。”

但是1、4和10是什么?仅当cpufreq为ondemand时才适用吗?如何计算“冷却”频率? DTS的另一部分是否链接到这些值?

2 个答案:

答案 0 :(得分:0)

我不能完全确定它是通用的还是特定于我的ARM设备的,但是我通过阅读提交注释得出结论,数字(1、4、10)仅对应于按需模式下的CPU节流。在我的特定情况下,这些数字表示100MHz时的油门量度。因此,10表示CPU在比其最大频率小1GHz的速度下节流。

答案 1 :(得分:0)

DTS冷却设备中的

= <&cpu0 1 1>用于表示与热区跳变点绑定的冷却设备的状态。在您的情况下,冷却设备是cpu,这意味着您的热区跳变点与cpu绑定,dts中的1 1表示节流状态。所有这些都可以从sysfs界面也可以从用户空间读取。通过以下链接获取详细信息: https://www.lookup2learn.com/post/thermal-management-in-linux