]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.177/arm-dts-exynos-do-not-ignore-real-world-fuse-values-for-thermal-zone-0-on-exynos5420.patch
Linux 3.18.137
[thirdparty/kernel/stable-queue.git] / releases / 4.4.177 / arm-dts-exynos-do-not-ignore-real-world-fuse-values-for-thermal-zone-0-on-exynos5420.patch
1 From 28928a3ce142b2e4e5a7a0f067cefb41a3d2c3f9 Mon Sep 17 00:00:00 2001
2 From: Krzysztof Kozlowski <krzk@kernel.org>
3 Date: Sat, 11 Feb 2017 22:14:56 +0200
4 Subject: ARM: dts: exynos: Do not ignore real-world fuse values for thermal zone 0 on Exynos5420
5
6 From: Krzysztof Kozlowski <krzk@kernel.org>
7
8 commit 28928a3ce142b2e4e5a7a0f067cefb41a3d2c3f9 upstream.
9
10 In Odroid XU3 Lite board, the temperature levels reported for thermal
11 zone 0 were weird. In warm room:
12 /sys/class/thermal/thermal_zone0/temp:32000
13 /sys/class/thermal/thermal_zone1/temp:51000
14 /sys/class/thermal/thermal_zone2/temp:55000
15 /sys/class/thermal/thermal_zone3/temp:54000
16 /sys/class/thermal/thermal_zone4/temp:51000
17
18 Sometimes after booting the value was even equal to ambient temperature
19 which is highly unlikely to be a real temperature of sensor in SoC.
20
21 The thermal sensor's calibration (trimming) is based on fused values.
22 In case of the board above, the fused values are: 35, 52, 43, 58 and 43
23 (corresponding to each TMU device). However driver defined a minimum value
24 for fused data as 40 and for smaller values it was using a hard-coded 55
25 instead. This lead to mapping data from sensor to wrong temperatures
26 for thermal zone 0.
27
28 Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
29 do not impose any limits on fused values. Since we do not have any
30 knowledge about these limits, use 0 as a minimum accepted fused value.
31 This should essentially allow accepting any reasonable fused value thus
32 behaving like vendor driver.
33
34 The exynos5420-tmu-sensor-conf.dtsi is copied directly from existing
35 exynos4412 with one change - the samsung,tmu_min_efuse_value.
36
37 Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
38 Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
39 Acked-by: Eduardo Valentin <edubezval@gmail.com>
40 Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
41 Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
42 Reviewed-by: Anand Moon <linux.amoon@gmail.com>
43 Tested-by: Anand Moon <linux.amoon@gmail.com>
44 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
45
46 ---
47 arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi | 25 ++++++++++++++++++++++
48 arch/arm/boot/dts/exynos5420.dtsi | 10 ++++----
49 2 files changed, 30 insertions(+), 5 deletions(-)
50
51 --- /dev/null
52 +++ b/arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi
53 @@ -0,0 +1,25 @@
54 +/*
55 + * Device tree sources for Exynos5420 TMU sensor configuration
56 + *
57 + * Copyright (c) 2014 Lukasz Majewski <l.majewski@samsung.com>
58 + * Copyright (c) 2017 Krzysztof Kozlowski <krzk@kernel.org>
59 + *
60 + * This program is free software; you can redistribute it and/or modify
61 + * it under the terms of the GNU General Public License version 2 as
62 + * published by the Free Software Foundation.
63 + *
64 + */
65 +
66 +#include <dt-bindings/thermal/thermal_exynos.h>
67 +
68 +#thermal-sensor-cells = <0>;
69 +samsung,tmu_gain = <8>;
70 +samsung,tmu_reference_voltage = <16>;
71 +samsung,tmu_noise_cancel_mode = <4>;
72 +samsung,tmu_efuse_value = <55>;
73 +samsung,tmu_min_efuse_value = <0>;
74 +samsung,tmu_max_efuse_value = <100>;
75 +samsung,tmu_first_point_trim = <25>;
76 +samsung,tmu_second_point_trim = <85>;
77 +samsung,tmu_default_temp_offset = <50>;
78 +samsung,tmu_cal_type = <TYPE_ONE_POINT_TRIMMING>;
79 --- a/arch/arm/boot/dts/exynos5420.dtsi
80 +++ b/arch/arm/boot/dts/exynos5420.dtsi
81 @@ -777,7 +777,7 @@
82 interrupts = <0 65 0>;
83 clocks = <&clock CLK_TMU>;
84 clock-names = "tmu_apbif";
85 - #include "exynos4412-tmu-sensor-conf.dtsi"
86 + #include "exynos5420-tmu-sensor-conf.dtsi"
87 };
88
89 tmu_cpu1: tmu@10064000 {
90 @@ -786,7 +786,7 @@
91 interrupts = <0 183 0>;
92 clocks = <&clock CLK_TMU>;
93 clock-names = "tmu_apbif";
94 - #include "exynos4412-tmu-sensor-conf.dtsi"
95 + #include "exynos5420-tmu-sensor-conf.dtsi"
96 };
97
98 tmu_cpu2: tmu@10068000 {
99 @@ -795,7 +795,7 @@
100 interrupts = <0 184 0>;
101 clocks = <&clock CLK_TMU>, <&clock CLK_TMU>;
102 clock-names = "tmu_apbif", "tmu_triminfo_apbif";
103 - #include "exynos4412-tmu-sensor-conf.dtsi"
104 + #include "exynos5420-tmu-sensor-conf.dtsi"
105 };
106
107 tmu_cpu3: tmu@1006c000 {
108 @@ -804,7 +804,7 @@
109 interrupts = <0 185 0>;
110 clocks = <&clock CLK_TMU>, <&clock CLK_TMU_GPU>;
111 clock-names = "tmu_apbif", "tmu_triminfo_apbif";
112 - #include "exynos4412-tmu-sensor-conf.dtsi"
113 + #include "exynos5420-tmu-sensor-conf.dtsi"
114 };
115
116 tmu_gpu: tmu@100a0000 {
117 @@ -813,7 +813,7 @@
118 interrupts = <0 215 0>;
119 clocks = <&clock CLK_TMU_GPU>, <&clock CLK_TMU>;
120 clock-names = "tmu_apbif", "tmu_triminfo_apbif";
121 - #include "exynos4412-tmu-sensor-conf.dtsi"
122 + #include "exynos5420-tmu-sensor-conf.dtsi"
123 };
124
125 thermal-zones {