]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
0271fb46a280675a7a12de02260f0e538cd8632a
[thirdparty/kernel/stable-queue.git] /
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 ---
48 arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi | 25 ++++++++++++++++++++++
49 arch/arm/boot/dts/exynos5420.dtsi | 10 ++++----
50 2 files changed, 30 insertions(+), 5 deletions(-)
51
52 --- /dev/null
53 +++ b/arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi
54 @@ -0,0 +1,25 @@
55 +/*
56 + * Device tree sources for Exynos5420 TMU sensor configuration
57 + *
58 + * Copyright (c) 2014 Lukasz Majewski <l.majewski@samsung.com>
59 + * Copyright (c) 2017 Krzysztof Kozlowski <krzk@kernel.org>
60 + *
61 + * This program is free software; you can redistribute it and/or modify
62 + * it under the terms of the GNU General Public License version 2 as
63 + * published by the Free Software Foundation.
64 + *
65 + */
66 +
67 +#include <dt-bindings/thermal/thermal_exynos.h>
68 +
69 +#thermal-sensor-cells = <0>;
70 +samsung,tmu_gain = <8>;
71 +samsung,tmu_reference_voltage = <16>;
72 +samsung,tmu_noise_cancel_mode = <4>;
73 +samsung,tmu_efuse_value = <55>;
74 +samsung,tmu_min_efuse_value = <0>;
75 +samsung,tmu_max_efuse_value = <100>;
76 +samsung,tmu_first_point_trim = <25>;
77 +samsung,tmu_second_point_trim = <85>;
78 +samsung,tmu_default_temp_offset = <50>;
79 +samsung,tmu_cal_type = <TYPE_ONE_POINT_TRIMMING>;
80 --- a/arch/arm/boot/dts/exynos5420.dtsi
81 +++ b/arch/arm/boot/dts/exynos5420.dtsi
82 @@ -694,7 +694,7 @@
83 interrupts = <0 65 0>;
84 clocks = <&clock CLK_TMU>;
85 clock-names = "tmu_apbif";
86 - #include "exynos4412-tmu-sensor-conf.dtsi"
87 + #include "exynos5420-tmu-sensor-conf.dtsi"
88 };
89
90 tmu_cpu1: tmu@10064000 {
91 @@ -703,7 +703,7 @@
92 interrupts = <0 183 0>;
93 clocks = <&clock CLK_TMU>;
94 clock-names = "tmu_apbif";
95 - #include "exynos4412-tmu-sensor-conf.dtsi"
96 + #include "exynos5420-tmu-sensor-conf.dtsi"
97 };
98
99 tmu_cpu2: tmu@10068000 {
100 @@ -712,7 +712,7 @@
101 interrupts = <0 184 0>;
102 clocks = <&clock CLK_TMU>, <&clock CLK_TMU>;
103 clock-names = "tmu_apbif", "tmu_triminfo_apbif";
104 - #include "exynos4412-tmu-sensor-conf.dtsi"
105 + #include "exynos5420-tmu-sensor-conf.dtsi"
106 };
107
108 tmu_cpu3: tmu@1006c000 {
109 @@ -721,7 +721,7 @@
110 interrupts = <0 185 0>;
111 clocks = <&clock CLK_TMU>, <&clock CLK_TMU_GPU>;
112 clock-names = "tmu_apbif", "tmu_triminfo_apbif";
113 - #include "exynos4412-tmu-sensor-conf.dtsi"
114 + #include "exynos5420-tmu-sensor-conf.dtsi"
115 };
116
117 tmu_gpu: tmu@100a0000 {
118 @@ -730,7 +730,7 @@
119 interrupts = <0 215 0>;
120 clocks = <&clock CLK_TMU_GPU>, <&clock CLK_TMU>;
121 clock-names = "tmu_apbif", "tmu_triminfo_apbif";
122 - #include "exynos4412-tmu-sensor-conf.dtsi"
123 + #include "exynos5420-tmu-sensor-conf.dtsi"
124 };
125
126 sysmmu_g2dr: sysmmu@0x10A60000 {