sunxi-dev Fix wrong temperature readings

Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
This commit is contained in:
Igor Pecovnik 2019-07-04 21:41:41 +02:00
parent 70bbbe3aea
commit 76ac54aae3
No known key found for this signature in database
GPG Key ID: 93D6889F9F0E78D5

View File

@ -1,32 +1,29 @@
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
index 55b95569..422589b3 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi
@@ -41,6 +41,7 @@
*/
#include <arm/sunxi-h3-h5.dtsi>
+#include <dt-bindings/thermal/thermal.h>
/ {
cpus {
@@ -98,6 +99,80 @@
method = "smc";
diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
index 8da95c0df..70e55fe32 100644
--- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi
+++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
@@ -1030,28 +1030,74 @@
};
+ thermal-zones {
thermal-zones {
- cpu_thermal: cpu-thermal {
- polling-delay-passive = <330>;
+ cpu-thermal {
+ /* milliseconds */
+ polling-delay-passive = <250>;
+ polling-delay = <1000>;
polling-delay = <1000>;
- thermal-sensors = <&ths 0>;
+ thermal-sensors = <&ths>;
+
+ trips {
trips {
- cpu_hot_trip: cpu-warm {
- temperature = <65000>;
+ cpu_warm: cpu_warm {
+ temperature = <75000>;
+ hysteresis = <2000>;
+ type = "passive";
+ };
hysteresis = <2000>;
type = "passive";
};
- cpu_very_hot_trip: cpu-very-hot {
+
+ cpu_hot_pre: cpu_hot_pre {
+ temperature = <80000>;
@ -41,8 +38,8 @@ index 55b95569..422589b3 100644
+ };
+
+ cpu_very_hot_pre: cpu_very_hot_pre {
+ temperature = <90000>;
+ hysteresis = <2000>;
temperature = <90000>;
hysteresis = <2000>;
+ type = "passive";
+ };
+
@ -55,11 +52,14 @@ index 55b95569..422589b3 100644
+ cpu_crit: cpu_crit {
+ temperature = <105000>;
+ hysteresis = <2000>;
+ type = "critical";
+ };
+ };
+
+ cooling-maps {
type = "critical";
};
};
cooling-maps {
- cpu-warm-limit {
- trip = <&cpu_hot_trip>;
- cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+ cpu_warm_limit_cpu {
+ trip = <&cpu_warm>;
+ cooling-device = <&cpu0 THERMAL_NO_LIMIT 2>;
@ -76,18 +76,13 @@ index 55b95569..422589b3 100644
+ };
+
+ cpu_very_hot_pre_limit_cpu {
+ trip = <&cpu_very_hot>;
+ trip = <&cpu_very_hot_pre>;
+ cooling-device = <&cpu0 5 6>;
+ };
+
+ cpu_very_hot_limit_cpu {
+ trip = <&cpu_very_hot>;
+ cooling-device = <&cpu0 7 THERMAL_NO_LIMIT>;
+ };
+ };
+ };
+ };
+
timer {
compatible = "arm,armv8-timer";
interrupts = <GIC_PPI 13
};
};
};