Re: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420

2017-03-05 Thread Anand Moon
Hi Krzysztof,

On 4 March 2017 at 13:31, Krzysztof Kozlowski  wrote:
> On Fri, Mar 03, 2017 at 06:50:06PM -0300, Javier Martinez Canillas wrote:
>> Hello Krzysztof,
>>
>> On 02/11/2017 05:14 PM, Krzysztof Kozlowski wrote:
>> > In Odroid XU3 Lite board, the temperature levels reported for thermal
>> > zone 0 were weird. In warm room:
>> > /sys/class/thermal/thermal_zone0/temp:32000
>> > /sys/class/thermal/thermal_zone1/temp:51000
>> > /sys/class/thermal/thermal_zone2/temp:55000
>> > /sys/class/thermal/thermal_zone3/temp:54000
>> > /sys/class/thermal/thermal_zone4/temp:51000
>> >
>> > Sometimes after booting the value was even equal to ambient temperature
>> > which is highly unlikely to be a real temperature of sensor in SoC.
>> >
>> > The thermal sensor's calibration (trimming) is based on fused values.
>> > In case of the board above, the fused values are: 35, 52, 43, 58 and 43
>> > (corresponding to each TMU device).  However driver defined a minimum value
>> > for fused data as 40 and for smaller values it was using a hard-coded 55
>> > instead.  This lead to mapping data from sensor to wrong temperatures
>> > for thermal zone 0.
>> >
>> > Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
>> > do not impose any limits on fused values.  Since we do not have any
>> > knowledge about these limits, use 0 as a minimum accepted fused value.
>> > This should essentially allow accepting any reasonable fused value thus
>> > behaving like vendor driver.
>> >
>> > The exynos5420-tmu-sensor-conf.dtsi is copied directly from existing
>> > exynso4412 with one change - the samsung,tmu_min_efuse_value.
>> >
>> > Signed-off-by: Krzysztof Kozlowski 
>> >
>> > ---
>> >
>> > Testing on other Exynos542x boards is much appreciated. Especially I
>> > wonder what efuse values are there.
>>
>> I tested on both Exynos5422 Odroid XU4 and Exynos5800 Peach Pi boards.
>>
>> The temperatures levels reported for these two boards on a warm room are:
>>
>> Odroid XU4
>>
>> # cat /sys/class/thermal/thermal_zone*/temp
>> 5
>> 5
>> 54000
>> 51000
>> 48000
>>
>> Peach Pi
>>
>> # cat /sys/class/thermal/thermal_zone*/temp
>> 42000
>> 44000
>> 27000 <-- weird value for thermal zone 2 like zone 0 in your XU3 lite
>> 45000
>> 45000
>>
>> And the efuse values for the TMU devices are:
>>
>> Odroid XU4
>>
>> TMU0 = 45
>> TMU1 = 44
>> TMU2 = 44
>> TMU3 = 46
>> TMU3 = 46
>>
>> Peach Pi
>>
>> TMU0 = 44
>> TMU1 = 46
>> TMU2 = 36
>> TMU3 = 53
>> TMU3 = 46
>>
>> The fused value for TMU2 is < 40 so that explains the weird temperature
>> level for thermal zone 2 in Peach. So after your patch, makes more sense:
>>
>> # cat /sys/class/thermal/thermal_zone*/temp
>> 41000
>> 42000
>> 45000
>> 43000
>> 43000
>
> Great! Thanks for testing!
>
>
>> I wonder though if 0 is the best value or if we should just lower more
>> to cover the used e-fuse values in Exynos5 boards. But as you said,
>> we have no knowledge about these limits...
>
> Yeah... we could set value of 10 or 20... but that would be blind shot.
>>
>> Reviewed-by: Javier Martinez Canillas 
>> Tested-by: Javier Martinez Canillas 
>>
>
> Thanks,
> Krzysztof

Reviewed-by: Anand Moon 
Tested-by: Anand Moon 

I have being trying to change the trips temperature in the dts to some
higher values
in order to improve the performance of the board.
Here are the results under idle state and stress state.

root@odroidxu4n:~# cat /sys/class/thermal/thermal_zone*/temp
58000
58000
61000
6
56000
root@odroidxu4n:~# stress --vm 16 --vm-bytes 128M --timeout 10s
stress: info: [2138] dispatching hogs: 0 cpu, 0 io, 16 vm, 0 hdd
stress: info: [2138] successful run completed in 10s
root@odroidxu4n:~# cat /sys/class/thermal/thermal_zone*/temp
58000
58000
61000
6
56000

Which is too high for in idle state.

Second part of my testcase is the pm-qa from linaro.

[1] git://git.linaro.org/tools/pm-qa.git

pm-qa# make -C thermal check

I have observer in the testcase that their is use moderate heating of heat_cpu
get started by the testcase but it dose not get signal to kill on
exiting of the testcase.
most of these testcase failed to Odroid XU4, but the same case pass on
Odroid U3.

I have also tested with different e-fuse values [10,20,30,40] but the
results are same.

Going through the source code for HK it seen to set exynos_tmu_control
set more trigger level

[2] 
https://github.com/hardkernel/linux/blob/odroidxu3-3.10.y/drivers/thermal/exynos_thermal.c#L1144

Best Regards
-Anand Moon


Re: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420

2017-03-05 Thread Anand Moon
Hi Krzysztof,

On 4 March 2017 at 13:31, Krzysztof Kozlowski  wrote:
> On Fri, Mar 03, 2017 at 06:50:06PM -0300, Javier Martinez Canillas wrote:
>> Hello Krzysztof,
>>
>> On 02/11/2017 05:14 PM, Krzysztof Kozlowski wrote:
>> > In Odroid XU3 Lite board, the temperature levels reported for thermal
>> > zone 0 were weird. In warm room:
>> > /sys/class/thermal/thermal_zone0/temp:32000
>> > /sys/class/thermal/thermal_zone1/temp:51000
>> > /sys/class/thermal/thermal_zone2/temp:55000
>> > /sys/class/thermal/thermal_zone3/temp:54000
>> > /sys/class/thermal/thermal_zone4/temp:51000
>> >
>> > Sometimes after booting the value was even equal to ambient temperature
>> > which is highly unlikely to be a real temperature of sensor in SoC.
>> >
>> > The thermal sensor's calibration (trimming) is based on fused values.
>> > In case of the board above, the fused values are: 35, 52, 43, 58 and 43
>> > (corresponding to each TMU device).  However driver defined a minimum value
>> > for fused data as 40 and for smaller values it was using a hard-coded 55
>> > instead.  This lead to mapping data from sensor to wrong temperatures
>> > for thermal zone 0.
>> >
>> > Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
>> > do not impose any limits on fused values.  Since we do not have any
>> > knowledge about these limits, use 0 as a minimum accepted fused value.
>> > This should essentially allow accepting any reasonable fused value thus
>> > behaving like vendor driver.
>> >
>> > The exynos5420-tmu-sensor-conf.dtsi is copied directly from existing
>> > exynso4412 with one change - the samsung,tmu_min_efuse_value.
>> >
>> > Signed-off-by: Krzysztof Kozlowski 
>> >
>> > ---
>> >
>> > Testing on other Exynos542x boards is much appreciated. Especially I
>> > wonder what efuse values are there.
>>
>> I tested on both Exynos5422 Odroid XU4 and Exynos5800 Peach Pi boards.
>>
>> The temperatures levels reported for these two boards on a warm room are:
>>
>> Odroid XU4
>>
>> # cat /sys/class/thermal/thermal_zone*/temp
>> 5
>> 5
>> 54000
>> 51000
>> 48000
>>
>> Peach Pi
>>
>> # cat /sys/class/thermal/thermal_zone*/temp
>> 42000
>> 44000
>> 27000 <-- weird value for thermal zone 2 like zone 0 in your XU3 lite
>> 45000
>> 45000
>>
>> And the efuse values for the TMU devices are:
>>
>> Odroid XU4
>>
>> TMU0 = 45
>> TMU1 = 44
>> TMU2 = 44
>> TMU3 = 46
>> TMU3 = 46
>>
>> Peach Pi
>>
>> TMU0 = 44
>> TMU1 = 46
>> TMU2 = 36
>> TMU3 = 53
>> TMU3 = 46
>>
>> The fused value for TMU2 is < 40 so that explains the weird temperature
>> level for thermal zone 2 in Peach. So after your patch, makes more sense:
>>
>> # cat /sys/class/thermal/thermal_zone*/temp
>> 41000
>> 42000
>> 45000
>> 43000
>> 43000
>
> Great! Thanks for testing!
>
>
>> I wonder though if 0 is the best value or if we should just lower more
>> to cover the used e-fuse values in Exynos5 boards. But as you said,
>> we have no knowledge about these limits...
>
> Yeah... we could set value of 10 or 20... but that would be blind shot.
>>
>> Reviewed-by: Javier Martinez Canillas 
>> Tested-by: Javier Martinez Canillas 
>>
>
> Thanks,
> Krzysztof

Reviewed-by: Anand Moon 
Tested-by: Anand Moon 

I have being trying to change the trips temperature in the dts to some
higher values
in order to improve the performance of the board.
Here are the results under idle state and stress state.

root@odroidxu4n:~# cat /sys/class/thermal/thermal_zone*/temp
58000
58000
61000
6
56000
root@odroidxu4n:~# stress --vm 16 --vm-bytes 128M --timeout 10s
stress: info: [2138] dispatching hogs: 0 cpu, 0 io, 16 vm, 0 hdd
stress: info: [2138] successful run completed in 10s
root@odroidxu4n:~# cat /sys/class/thermal/thermal_zone*/temp
58000
58000
61000
6
56000

Which is too high for in idle state.

Second part of my testcase is the pm-qa from linaro.

[1] git://git.linaro.org/tools/pm-qa.git

pm-qa# make -C thermal check

I have observer in the testcase that their is use moderate heating of heat_cpu
get started by the testcase but it dose not get signal to kill on
exiting of the testcase.
most of these testcase failed to Odroid XU4, but the same case pass on
Odroid U3.

I have also tested with different e-fuse values [10,20,30,40] but the
results are same.

Going through the source code for HK it seen to set exynos_tmu_control
set more trigger level

[2] 
https://github.com/hardkernel/linux/blob/odroidxu3-3.10.y/drivers/thermal/exynos_thermal.c#L1144

Best Regards
-Anand Moon


Re: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420

2017-03-04 Thread Krzysztof Kozlowski
On Fri, Mar 03, 2017 at 06:50:06PM -0300, Javier Martinez Canillas wrote:
> Hello Krzysztof,
> 
> On 02/11/2017 05:14 PM, Krzysztof Kozlowski wrote:
> > In Odroid XU3 Lite board, the temperature levels reported for thermal
> > zone 0 were weird. In warm room:
> > /sys/class/thermal/thermal_zone0/temp:32000
> > /sys/class/thermal/thermal_zone1/temp:51000
> > /sys/class/thermal/thermal_zone2/temp:55000
> > /sys/class/thermal/thermal_zone3/temp:54000
> > /sys/class/thermal/thermal_zone4/temp:51000
> > 
> > Sometimes after booting the value was even equal to ambient temperature
> > which is highly unlikely to be a real temperature of sensor in SoC.
> > 
> > The thermal sensor's calibration (trimming) is based on fused values.
> > In case of the board above, the fused values are: 35, 52, 43, 58 and 43
> > (corresponding to each TMU device).  However driver defined a minimum value
> > for fused data as 40 and for smaller values it was using a hard-coded 55
> > instead.  This lead to mapping data from sensor to wrong temperatures
> > for thermal zone 0.
> > 
> > Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
> > do not impose any limits on fused values.  Since we do not have any
> > knowledge about these limits, use 0 as a minimum accepted fused value.
> > This should essentially allow accepting any reasonable fused value thus
> > behaving like vendor driver.
> > 
> > The exynos5420-tmu-sensor-conf.dtsi is copied directly from existing
> > exynso4412 with one change - the samsung,tmu_min_efuse_value.
> > 
> > Signed-off-by: Krzysztof Kozlowski 
> > 
> > ---
> > 
> > Testing on other Exynos542x boards is much appreciated. Especially I
> > wonder what efuse values are there.
> 
> I tested on both Exynos5422 Odroid XU4 and Exynos5800 Peach Pi boards.
> 
> The temperatures levels reported for these two boards on a warm room are:
> 
> Odroid XU4
> 
> # cat /sys/class/thermal/thermal_zone*/temp
> 5
> 5
> 54000
> 51000
> 48000
> 
> Peach Pi
> 
> # cat /sys/class/thermal/thermal_zone*/temp
> 42000
> 44000
> 27000 <-- weird value for thermal zone 2 like zone 0 in your XU3 lite
> 45000
> 45000
> 
> And the efuse values for the TMU devices are:
> 
> Odroid XU4
> 
> TMU0 = 45
> TMU1 = 44
> TMU2 = 44
> TMU3 = 46
> TMU3 = 46
> 
> Peach Pi
> 
> TMU0 = 44
> TMU1 = 46
> TMU2 = 36
> TMU3 = 53
> TMU3 = 46
> 
> The fused value for TMU2 is < 40 so that explains the weird temperature
> level for thermal zone 2 in Peach. So after your patch, makes more sense:
> 
> # cat /sys/class/thermal/thermal_zone*/temp
> 41000
> 42000
> 45000
> 43000
> 43000

Great! Thanks for testing!


> I wonder though if 0 is the best value or if we should just lower more
> to cover the used e-fuse values in Exynos5 boards. But as you said,
> we have no knowledge about these limits...

Yeah... we could set value of 10 or 20... but that would be blind shot.
> 
> Reviewed-by: Javier Martinez Canillas 
> Tested-by: Javier Martinez Canillas 
> 

Thanks,
Krzysztof


Re: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420

2017-03-04 Thread Krzysztof Kozlowski
On Fri, Mar 03, 2017 at 06:50:06PM -0300, Javier Martinez Canillas wrote:
> Hello Krzysztof,
> 
> On 02/11/2017 05:14 PM, Krzysztof Kozlowski wrote:
> > In Odroid XU3 Lite board, the temperature levels reported for thermal
> > zone 0 were weird. In warm room:
> > /sys/class/thermal/thermal_zone0/temp:32000
> > /sys/class/thermal/thermal_zone1/temp:51000
> > /sys/class/thermal/thermal_zone2/temp:55000
> > /sys/class/thermal/thermal_zone3/temp:54000
> > /sys/class/thermal/thermal_zone4/temp:51000
> > 
> > Sometimes after booting the value was even equal to ambient temperature
> > which is highly unlikely to be a real temperature of sensor in SoC.
> > 
> > The thermal sensor's calibration (trimming) is based on fused values.
> > In case of the board above, the fused values are: 35, 52, 43, 58 and 43
> > (corresponding to each TMU device).  However driver defined a minimum value
> > for fused data as 40 and for smaller values it was using a hard-coded 55
> > instead.  This lead to mapping data from sensor to wrong temperatures
> > for thermal zone 0.
> > 
> > Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
> > do not impose any limits on fused values.  Since we do not have any
> > knowledge about these limits, use 0 as a minimum accepted fused value.
> > This should essentially allow accepting any reasonable fused value thus
> > behaving like vendor driver.
> > 
> > The exynos5420-tmu-sensor-conf.dtsi is copied directly from existing
> > exynso4412 with one change - the samsung,tmu_min_efuse_value.
> > 
> > Signed-off-by: Krzysztof Kozlowski 
> > 
> > ---
> > 
> > Testing on other Exynos542x boards is much appreciated. Especially I
> > wonder what efuse values are there.
> 
> I tested on both Exynos5422 Odroid XU4 and Exynos5800 Peach Pi boards.
> 
> The temperatures levels reported for these two boards on a warm room are:
> 
> Odroid XU4
> 
> # cat /sys/class/thermal/thermal_zone*/temp
> 5
> 5
> 54000
> 51000
> 48000
> 
> Peach Pi
> 
> # cat /sys/class/thermal/thermal_zone*/temp
> 42000
> 44000
> 27000 <-- weird value for thermal zone 2 like zone 0 in your XU3 lite
> 45000
> 45000
> 
> And the efuse values for the TMU devices are:
> 
> Odroid XU4
> 
> TMU0 = 45
> TMU1 = 44
> TMU2 = 44
> TMU3 = 46
> TMU3 = 46
> 
> Peach Pi
> 
> TMU0 = 44
> TMU1 = 46
> TMU2 = 36
> TMU3 = 53
> TMU3 = 46
> 
> The fused value for TMU2 is < 40 so that explains the weird temperature
> level for thermal zone 2 in Peach. So after your patch, makes more sense:
> 
> # cat /sys/class/thermal/thermal_zone*/temp
> 41000
> 42000
> 45000
> 43000
> 43000

Great! Thanks for testing!


> I wonder though if 0 is the best value or if we should just lower more
> to cover the used e-fuse values in Exynos5 boards. But as you said,
> we have no knowledge about these limits...

Yeah... we could set value of 10 or 20... but that would be blind shot.
> 
> Reviewed-by: Javier Martinez Canillas 
> Tested-by: Javier Martinez Canillas 
> 

Thanks,
Krzysztof


Re: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420

2017-03-03 Thread Javier Martinez Canillas
Hello Krzysztof,

On 02/11/2017 05:14 PM, Krzysztof Kozlowski wrote:
> In Odroid XU3 Lite board, the temperature levels reported for thermal
> zone 0 were weird. In warm room:
>   /sys/class/thermal/thermal_zone0/temp:32000
>   /sys/class/thermal/thermal_zone1/temp:51000
>   /sys/class/thermal/thermal_zone2/temp:55000
>   /sys/class/thermal/thermal_zone3/temp:54000
>   /sys/class/thermal/thermal_zone4/temp:51000
> 
> Sometimes after booting the value was even equal to ambient temperature
> which is highly unlikely to be a real temperature of sensor in SoC.
> 
> The thermal sensor's calibration (trimming) is based on fused values.
> In case of the board above, the fused values are: 35, 52, 43, 58 and 43
> (corresponding to each TMU device).  However driver defined a minimum value
> for fused data as 40 and for smaller values it was using a hard-coded 55
> instead.  This lead to mapping data from sensor to wrong temperatures
> for thermal zone 0.
> 
> Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
> do not impose any limits on fused values.  Since we do not have any
> knowledge about these limits, use 0 as a minimum accepted fused value.
> This should essentially allow accepting any reasonable fused value thus
> behaving like vendor driver.
> 
> The exynos5420-tmu-sensor-conf.dtsi is copied directly from existing
> exynso4412 with one change - the samsung,tmu_min_efuse_value.
> 
> Signed-off-by: Krzysztof Kozlowski 
> 
> ---
> 
> Testing on other Exynos542x boards is much appreciated. Especially I
> wonder what efuse values are there.

I tested on both Exynos5422 Odroid XU4 and Exynos5800 Peach Pi boards.

The temperatures levels reported for these two boards on a warm room are:

Odroid XU4

# cat /sys/class/thermal/thermal_zone*/temp
5
5
54000
51000
48000

Peach Pi

# cat /sys/class/thermal/thermal_zone*/temp
42000
44000
27000 <-- weird value for thermal zone 2 like zone 0 in your XU3 lite
45000
45000

And the efuse values for the TMU devices are:

Odroid XU4

TMU0 = 45
TMU1 = 44
TMU2 = 44
TMU3 = 46
TMU3 = 46

Peach Pi

TMU0 = 44
TMU1 = 46
TMU2 = 36
TMU3 = 53
TMU3 = 46

The fused value for TMU2 is < 40 so that explains the weird temperature
level for thermal zone 2 in Peach. So after your patch, makes more sense:

# cat /sys/class/thermal/thermal_zone*/temp
41000
42000
45000
43000
43000

I wonder though if 0 is the best value or if we should just lower more
to cover the used e-fuse values in Exynos5 boards. But as you said,
we have no knowledge about these limits...

Reviewed-by: Javier Martinez Canillas 
Tested-by: Javier Martinez Canillas 

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America


Re: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420

2017-03-03 Thread Javier Martinez Canillas
Hello Krzysztof,

On 02/11/2017 05:14 PM, Krzysztof Kozlowski wrote:
> In Odroid XU3 Lite board, the temperature levels reported for thermal
> zone 0 were weird. In warm room:
>   /sys/class/thermal/thermal_zone0/temp:32000
>   /sys/class/thermal/thermal_zone1/temp:51000
>   /sys/class/thermal/thermal_zone2/temp:55000
>   /sys/class/thermal/thermal_zone3/temp:54000
>   /sys/class/thermal/thermal_zone4/temp:51000
> 
> Sometimes after booting the value was even equal to ambient temperature
> which is highly unlikely to be a real temperature of sensor in SoC.
> 
> The thermal sensor's calibration (trimming) is based on fused values.
> In case of the board above, the fused values are: 35, 52, 43, 58 and 43
> (corresponding to each TMU device).  However driver defined a minimum value
> for fused data as 40 and for smaller values it was using a hard-coded 55
> instead.  This lead to mapping data from sensor to wrong temperatures
> for thermal zone 0.
> 
> Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
> do not impose any limits on fused values.  Since we do not have any
> knowledge about these limits, use 0 as a minimum accepted fused value.
> This should essentially allow accepting any reasonable fused value thus
> behaving like vendor driver.
> 
> The exynos5420-tmu-sensor-conf.dtsi is copied directly from existing
> exynso4412 with one change - the samsung,tmu_min_efuse_value.
> 
> Signed-off-by: Krzysztof Kozlowski 
> 
> ---
> 
> Testing on other Exynos542x boards is much appreciated. Especially I
> wonder what efuse values are there.

I tested on both Exynos5422 Odroid XU4 and Exynos5800 Peach Pi boards.

The temperatures levels reported for these two boards on a warm room are:

Odroid XU4

# cat /sys/class/thermal/thermal_zone*/temp
5
5
54000
51000
48000

Peach Pi

# cat /sys/class/thermal/thermal_zone*/temp
42000
44000
27000 <-- weird value for thermal zone 2 like zone 0 in your XU3 lite
45000
45000

And the efuse values for the TMU devices are:

Odroid XU4

TMU0 = 45
TMU1 = 44
TMU2 = 44
TMU3 = 46
TMU3 = 46

Peach Pi

TMU0 = 44
TMU1 = 46
TMU2 = 36
TMU3 = 53
TMU3 = 46

The fused value for TMU2 is < 40 so that explains the weird temperature
level for thermal zone 2 in Peach. So after your patch, makes more sense:

# cat /sys/class/thermal/thermal_zone*/temp
41000
42000
45000
43000
43000

I wonder though if 0 is the best value or if we should just lower more
to cover the used e-fuse values in Exynos5 boards. But as you said,
we have no knowledge about these limits...

Reviewed-by: Javier Martinez Canillas 
Tested-by: Javier Martinez Canillas 

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America


Re: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420

2017-02-18 Thread Eduardo Valentin
On Sat, Feb 11, 2017 at 10:14:56PM +0200, Krzysztof Kozlowski wrote:
> In Odroid XU3 Lite board, the temperature levels reported for thermal
> zone 0 were weird. In warm room:
>   /sys/class/thermal/thermal_zone0/temp:32000
>   /sys/class/thermal/thermal_zone1/temp:51000
>   /sys/class/thermal/thermal_zone2/temp:55000
>   /sys/class/thermal/thermal_zone3/temp:54000
>   /sys/class/thermal/thermal_zone4/temp:51000
> 
> Sometimes after booting the value was even equal to ambient temperature
> which is highly unlikely to be a real temperature of sensor in SoC.
> 
> The thermal sensor's calibration (trimming) is based on fused values.
> In case of the board above, the fused values are: 35, 52, 43, 58 and 43
> (corresponding to each TMU device).  However driver defined a minimum value
> for fused data as 40 and for smaller values it was using a hard-coded 55
> instead.  This lead to mapping data from sensor to wrong temperatures
> for thermal zone 0.
> 
> Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
> do not impose any limits on fused values.  Since we do not have any
> knowledge about these limits, use 0 as a minimum accepted fused value.
> This should essentially allow accepting any reasonable fused value thus
> behaving like vendor driver.
> 
> The exynos5420-tmu-sensor-conf.dtsi is copied directly from existing
> exynso4412 with one change - the samsung,tmu_min_efuse_value.
> 
> Signed-off-by: Krzysztof Kozlowski 

Acked-by: Eduardo Valentin 

> 
> ---
> 
> Testing on other Exynos542x boards is much appreciated. Especially I
> wonder what efuse values are there.
> ---
>  arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi | 25 
> +++
>  arch/arm/boot/dts/exynos5420.dtsi | 10 -
>  2 files changed, 30 insertions(+), 5 deletions(-)
>  create mode 100644 arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi
> 
> diff --git a/arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi 
> b/arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi
> new file mode 100644
> index ..c8771c660550
> --- /dev/null
> +++ b/arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi
> @@ -0,0 +1,25 @@
> +/*
> + * Device tree sources for Exynos5420 TMU sensor configuration
> + *
> + * Copyright (c) 2014 Lukasz Majewski 
> + * Copyright (c) 2017 Krzysztof Kozlowski 
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +
> +#include 
> +
> +#thermal-sensor-cells = <0>;
> +samsung,tmu_gain = <8>;
> +samsung,tmu_reference_voltage = <16>;
> +samsung,tmu_noise_cancel_mode = <4>;
> +samsung,tmu_efuse_value = <55>;
> +samsung,tmu_min_efuse_value = <0>;
> +samsung,tmu_max_efuse_value = <100>;
> +samsung,tmu_first_point_trim = <25>;
> +samsung,tmu_second_point_trim = <85>;
> +samsung,tmu_default_temp_offset = <50>;
> +samsung,tmu_cal_type = ;
> diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
> b/arch/arm/boot/dts/exynos5420.dtsi
> index 7dc9dc82afd8..83b3899d228d 100644
> --- a/arch/arm/boot/dts/exynos5420.dtsi
> +++ b/arch/arm/boot/dts/exynos5420.dtsi
> @@ -699,7 +699,7 @@
>   interrupts = <0 65 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = < CLK_TMU>;
>   clock-names = "tmu_apbif";
> - #include "exynos4412-tmu-sensor-conf.dtsi"
> + #include "exynos5420-tmu-sensor-conf.dtsi"
>   };
>  
>   tmu_cpu1: tmu@10064000 {
> @@ -708,7 +708,7 @@
>   interrupts = <0 183 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = < CLK_TMU>;
>   clock-names = "tmu_apbif";
> - #include "exynos4412-tmu-sensor-conf.dtsi"
> + #include "exynos5420-tmu-sensor-conf.dtsi"
>   };
>  
>   tmu_cpu2: tmu@10068000 {
> @@ -717,7 +717,7 @@
>   interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = < CLK_TMU>, < CLK_TMU>;
>   clock-names = "tmu_apbif", "tmu_triminfo_apbif";
> - #include "exynos4412-tmu-sensor-conf.dtsi"
> + #include "exynos5420-tmu-sensor-conf.dtsi"
>   };
>  
>   tmu_cpu3: tmu@1006c000 {
> @@ -726,7 +726,7 @@
>   interrupts = <0 185 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = < CLK_TMU>, < CLK_TMU_GPU>;
>   clock-names = "tmu_apbif", "tmu_triminfo_apbif";
> - #include "exynos4412-tmu-sensor-conf.dtsi"
> + #include "exynos5420-tmu-sensor-conf.dtsi"
>   };
>  
>   tmu_gpu: tmu@100a {
> @@ -735,7 +735,7 @@
>   interrupts = <0 215 IRQ_TYPE_LEVEL_HIGH>;
>

Re: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420

2017-02-18 Thread Eduardo Valentin
On Sat, Feb 11, 2017 at 10:14:56PM +0200, Krzysztof Kozlowski wrote:
> In Odroid XU3 Lite board, the temperature levels reported for thermal
> zone 0 were weird. In warm room:
>   /sys/class/thermal/thermal_zone0/temp:32000
>   /sys/class/thermal/thermal_zone1/temp:51000
>   /sys/class/thermal/thermal_zone2/temp:55000
>   /sys/class/thermal/thermal_zone3/temp:54000
>   /sys/class/thermal/thermal_zone4/temp:51000
> 
> Sometimes after booting the value was even equal to ambient temperature
> which is highly unlikely to be a real temperature of sensor in SoC.
> 
> The thermal sensor's calibration (trimming) is based on fused values.
> In case of the board above, the fused values are: 35, 52, 43, 58 and 43
> (corresponding to each TMU device).  However driver defined a minimum value
> for fused data as 40 and for smaller values it was using a hard-coded 55
> instead.  This lead to mapping data from sensor to wrong temperatures
> for thermal zone 0.
> 
> Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
> do not impose any limits on fused values.  Since we do not have any
> knowledge about these limits, use 0 as a minimum accepted fused value.
> This should essentially allow accepting any reasonable fused value thus
> behaving like vendor driver.
> 
> The exynos5420-tmu-sensor-conf.dtsi is copied directly from existing
> exynso4412 with one change - the samsung,tmu_min_efuse_value.
> 
> Signed-off-by: Krzysztof Kozlowski 

Acked-by: Eduardo Valentin 

> 
> ---
> 
> Testing on other Exynos542x boards is much appreciated. Especially I
> wonder what efuse values are there.
> ---
>  arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi | 25 
> +++
>  arch/arm/boot/dts/exynos5420.dtsi | 10 -
>  2 files changed, 30 insertions(+), 5 deletions(-)
>  create mode 100644 arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi
> 
> diff --git a/arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi 
> b/arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi
> new file mode 100644
> index ..c8771c660550
> --- /dev/null
> +++ b/arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi
> @@ -0,0 +1,25 @@
> +/*
> + * Device tree sources for Exynos5420 TMU sensor configuration
> + *
> + * Copyright (c) 2014 Lukasz Majewski 
> + * Copyright (c) 2017 Krzysztof Kozlowski 
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +
> +#include 
> +
> +#thermal-sensor-cells = <0>;
> +samsung,tmu_gain = <8>;
> +samsung,tmu_reference_voltage = <16>;
> +samsung,tmu_noise_cancel_mode = <4>;
> +samsung,tmu_efuse_value = <55>;
> +samsung,tmu_min_efuse_value = <0>;
> +samsung,tmu_max_efuse_value = <100>;
> +samsung,tmu_first_point_trim = <25>;
> +samsung,tmu_second_point_trim = <85>;
> +samsung,tmu_default_temp_offset = <50>;
> +samsung,tmu_cal_type = ;
> diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
> b/arch/arm/boot/dts/exynos5420.dtsi
> index 7dc9dc82afd8..83b3899d228d 100644
> --- a/arch/arm/boot/dts/exynos5420.dtsi
> +++ b/arch/arm/boot/dts/exynos5420.dtsi
> @@ -699,7 +699,7 @@
>   interrupts = <0 65 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = < CLK_TMU>;
>   clock-names = "tmu_apbif";
> - #include "exynos4412-tmu-sensor-conf.dtsi"
> + #include "exynos5420-tmu-sensor-conf.dtsi"
>   };
>  
>   tmu_cpu1: tmu@10064000 {
> @@ -708,7 +708,7 @@
>   interrupts = <0 183 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = < CLK_TMU>;
>   clock-names = "tmu_apbif";
> - #include "exynos4412-tmu-sensor-conf.dtsi"
> + #include "exynos5420-tmu-sensor-conf.dtsi"
>   };
>  
>   tmu_cpu2: tmu@10068000 {
> @@ -717,7 +717,7 @@
>   interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = < CLK_TMU>, < CLK_TMU>;
>   clock-names = "tmu_apbif", "tmu_triminfo_apbif";
> - #include "exynos4412-tmu-sensor-conf.dtsi"
> + #include "exynos5420-tmu-sensor-conf.dtsi"
>   };
>  
>   tmu_cpu3: tmu@1006c000 {
> @@ -726,7 +726,7 @@
>   interrupts = <0 185 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = < CLK_TMU>, < CLK_TMU_GPU>;
>   clock-names = "tmu_apbif", "tmu_triminfo_apbif";
> - #include "exynos4412-tmu-sensor-conf.dtsi"
> + #include "exynos5420-tmu-sensor-conf.dtsi"
>   };
>  
>   tmu_gpu: tmu@100a {
> @@ -735,7 +735,7 @@
>   interrupts = <0 215 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = < CLK_TMU_GPU>, < CLK_TMU>;
>   clock-names = 

Re: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420

2017-02-13 Thread Bartlomiej Zolnierkiewicz
On Saturday, February 11, 2017 10:14:56 PM Krzysztof Kozlowski wrote:
> In Odroid XU3 Lite board, the temperature levels reported for thermal
> zone 0 were weird. In warm room:
>   /sys/class/thermal/thermal_zone0/temp:32000
>   /sys/class/thermal/thermal_zone1/temp:51000
>   /sys/class/thermal/thermal_zone2/temp:55000
>   /sys/class/thermal/thermal_zone3/temp:54000
>   /sys/class/thermal/thermal_zone4/temp:51000
> 
> Sometimes after booting the value was even equal to ambient temperature
> which is highly unlikely to be a real temperature of sensor in SoC.
> 
> The thermal sensor's calibration (trimming) is based on fused values.
> In case of the board above, the fused values are: 35, 52, 43, 58 and 43
> (corresponding to each TMU device).  However driver defined a minimum value
> for fused data as 40 and for smaller values it was using a hard-coded 55
> instead.  This lead to mapping data from sensor to wrong temperatures
> for thermal zone 0.
> 
> Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
> do not impose any limits on fused values.  Since we do not have any
> knowledge about these limits, use 0 as a minimum accepted fused value.
> This should essentially allow accepting any reasonable fused value thus
> behaving like vendor driver.
> 
> The exynos5420-tmu-sensor-conf.dtsi is copied directly from existing
> exynso4412 with one change - the samsung,tmu_min_efuse_value.
> 
> Signed-off-by: Krzysztof Kozlowski 

Acked-by: Bartlomiej Zolnierkiewicz 

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R Institute Poland
Samsung Electronics

> ---
> 
> Testing on other Exynos542x boards is much appreciated. Especially I
> wonder what efuse values are there.
> ---
>  arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi | 25 
> +++
>  arch/arm/boot/dts/exynos5420.dtsi | 10 -
>  2 files changed, 30 insertions(+), 5 deletions(-)
>  create mode 100644 arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi
> 
> diff --git a/arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi 
> b/arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi
> new file mode 100644
> index ..c8771c660550
> --- /dev/null
> +++ b/arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi
> @@ -0,0 +1,25 @@
> +/*
> + * Device tree sources for Exynos5420 TMU sensor configuration
> + *
> + * Copyright (c) 2014 Lukasz Majewski 
> + * Copyright (c) 2017 Krzysztof Kozlowski 
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +
> +#include 
> +
> +#thermal-sensor-cells = <0>;
> +samsung,tmu_gain = <8>;
> +samsung,tmu_reference_voltage = <16>;
> +samsung,tmu_noise_cancel_mode = <4>;
> +samsung,tmu_efuse_value = <55>;
> +samsung,tmu_min_efuse_value = <0>;
> +samsung,tmu_max_efuse_value = <100>;
> +samsung,tmu_first_point_trim = <25>;
> +samsung,tmu_second_point_trim = <85>;
> +samsung,tmu_default_temp_offset = <50>;
> +samsung,tmu_cal_type = ;
> diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
> b/arch/arm/boot/dts/exynos5420.dtsi
> index 7dc9dc82afd8..83b3899d228d 100644
> --- a/arch/arm/boot/dts/exynos5420.dtsi
> +++ b/arch/arm/boot/dts/exynos5420.dtsi
> @@ -699,7 +699,7 @@
>   interrupts = <0 65 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = < CLK_TMU>;
>   clock-names = "tmu_apbif";
> - #include "exynos4412-tmu-sensor-conf.dtsi"
> + #include "exynos5420-tmu-sensor-conf.dtsi"
>   };
>  
>   tmu_cpu1: tmu@10064000 {
> @@ -708,7 +708,7 @@
>   interrupts = <0 183 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = < CLK_TMU>;
>   clock-names = "tmu_apbif";
> - #include "exynos4412-tmu-sensor-conf.dtsi"
> + #include "exynos5420-tmu-sensor-conf.dtsi"
>   };
>  
>   tmu_cpu2: tmu@10068000 {
> @@ -717,7 +717,7 @@
>   interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = < CLK_TMU>, < CLK_TMU>;
>   clock-names = "tmu_apbif", "tmu_triminfo_apbif";
> - #include "exynos4412-tmu-sensor-conf.dtsi"
> + #include "exynos5420-tmu-sensor-conf.dtsi"
>   };
>  
>   tmu_cpu3: tmu@1006c000 {
> @@ -726,7 +726,7 @@
>   interrupts = <0 185 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = < CLK_TMU>, < CLK_TMU_GPU>;
>   clock-names = "tmu_apbif", "tmu_triminfo_apbif";
> - #include "exynos4412-tmu-sensor-conf.dtsi"
> + #include "exynos5420-tmu-sensor-conf.dtsi"
>   };
>  
>   tmu_gpu: tmu@100a {
> @@ 

Re: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420

2017-02-13 Thread Bartlomiej Zolnierkiewicz
On Saturday, February 11, 2017 10:14:56 PM Krzysztof Kozlowski wrote:
> In Odroid XU3 Lite board, the temperature levels reported for thermal
> zone 0 were weird. In warm room:
>   /sys/class/thermal/thermal_zone0/temp:32000
>   /sys/class/thermal/thermal_zone1/temp:51000
>   /sys/class/thermal/thermal_zone2/temp:55000
>   /sys/class/thermal/thermal_zone3/temp:54000
>   /sys/class/thermal/thermal_zone4/temp:51000
> 
> Sometimes after booting the value was even equal to ambient temperature
> which is highly unlikely to be a real temperature of sensor in SoC.
> 
> The thermal sensor's calibration (trimming) is based on fused values.
> In case of the board above, the fused values are: 35, 52, 43, 58 and 43
> (corresponding to each TMU device).  However driver defined a minimum value
> for fused data as 40 and for smaller values it was using a hard-coded 55
> instead.  This lead to mapping data from sensor to wrong temperatures
> for thermal zone 0.
> 
> Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
> do not impose any limits on fused values.  Since we do not have any
> knowledge about these limits, use 0 as a minimum accepted fused value.
> This should essentially allow accepting any reasonable fused value thus
> behaving like vendor driver.
> 
> The exynos5420-tmu-sensor-conf.dtsi is copied directly from existing
> exynso4412 with one change - the samsung,tmu_min_efuse_value.
> 
> Signed-off-by: Krzysztof Kozlowski 

Acked-by: Bartlomiej Zolnierkiewicz 

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R Institute Poland
Samsung Electronics

> ---
> 
> Testing on other Exynos542x boards is much appreciated. Especially I
> wonder what efuse values are there.
> ---
>  arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi | 25 
> +++
>  arch/arm/boot/dts/exynos5420.dtsi | 10 -
>  2 files changed, 30 insertions(+), 5 deletions(-)
>  create mode 100644 arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi
> 
> diff --git a/arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi 
> b/arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi
> new file mode 100644
> index ..c8771c660550
> --- /dev/null
> +++ b/arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi
> @@ -0,0 +1,25 @@
> +/*
> + * Device tree sources for Exynos5420 TMU sensor configuration
> + *
> + * Copyright (c) 2014 Lukasz Majewski 
> + * Copyright (c) 2017 Krzysztof Kozlowski 
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +
> +#include 
> +
> +#thermal-sensor-cells = <0>;
> +samsung,tmu_gain = <8>;
> +samsung,tmu_reference_voltage = <16>;
> +samsung,tmu_noise_cancel_mode = <4>;
> +samsung,tmu_efuse_value = <55>;
> +samsung,tmu_min_efuse_value = <0>;
> +samsung,tmu_max_efuse_value = <100>;
> +samsung,tmu_first_point_trim = <25>;
> +samsung,tmu_second_point_trim = <85>;
> +samsung,tmu_default_temp_offset = <50>;
> +samsung,tmu_cal_type = ;
> diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
> b/arch/arm/boot/dts/exynos5420.dtsi
> index 7dc9dc82afd8..83b3899d228d 100644
> --- a/arch/arm/boot/dts/exynos5420.dtsi
> +++ b/arch/arm/boot/dts/exynos5420.dtsi
> @@ -699,7 +699,7 @@
>   interrupts = <0 65 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = < CLK_TMU>;
>   clock-names = "tmu_apbif";
> - #include "exynos4412-tmu-sensor-conf.dtsi"
> + #include "exynos5420-tmu-sensor-conf.dtsi"
>   };
>  
>   tmu_cpu1: tmu@10064000 {
> @@ -708,7 +708,7 @@
>   interrupts = <0 183 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = < CLK_TMU>;
>   clock-names = "tmu_apbif";
> - #include "exynos4412-tmu-sensor-conf.dtsi"
> + #include "exynos5420-tmu-sensor-conf.dtsi"
>   };
>  
>   tmu_cpu2: tmu@10068000 {
> @@ -717,7 +717,7 @@
>   interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = < CLK_TMU>, < CLK_TMU>;
>   clock-names = "tmu_apbif", "tmu_triminfo_apbif";
> - #include "exynos4412-tmu-sensor-conf.dtsi"
> + #include "exynos5420-tmu-sensor-conf.dtsi"
>   };
>  
>   tmu_cpu3: tmu@1006c000 {
> @@ -726,7 +726,7 @@
>   interrupts = <0 185 IRQ_TYPE_LEVEL_HIGH>;
>   clocks = < CLK_TMU>, < CLK_TMU_GPU>;
>   clock-names = "tmu_apbif", "tmu_triminfo_apbif";
> - #include "exynos4412-tmu-sensor-conf.dtsi"
> + #include "exynos5420-tmu-sensor-conf.dtsi"
>   };
>  
>   tmu_gpu: tmu@100a {
> @@ -735,7 +735,7 @@
>   interrupts = <0 215 IRQ_TYPE_LEVEL_HIGH>;
> 

Re: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420

2017-02-13 Thread Anand Moon
Hi Krzysztof,

On 13 February 2017 at 17:29, Krzysztof Kozlowski  wrote:
> On Mon, Feb 13, 2017 at 1:38 PM, Anand Moon  wrote:
>> Hi Krzysztof,
>>
>>
>>
>> On 12 February 2017 at 01:44, Krzysztof Kozlowski  wrote:
>>> In Odroid XU3 Lite board, the temperature levels reported for thermal
>>> zone 0 were weird. In warm room:
>>> /sys/class/thermal/thermal_zone0/temp:32000
>>> /sys/class/thermal/thermal_zone1/temp:51000
>>> /sys/class/thermal/thermal_zone2/temp:55000
>>> /sys/class/thermal/thermal_zone3/temp:54000
>>> /sys/class/thermal/thermal_zone4/temp:51000
>>>
>>> Sometimes after booting the value was even equal to ambient temperature
>>> which is highly unlikely to be a real temperature of sensor in SoC.
>>>
>>> The thermal sensor's calibration (trimming) is based on fused values.
>>> In case of the board above, the fused values are: 35, 52, 43, 58 and 43
>>> (corresponding to each TMU device).  However driver defined a minimum value
>>> for fused data as 40 and for smaller values it was using a hard-coded 55
>>> instead.  This lead to mapping data from sensor to wrong temperatures
>>> for thermal zone 0.
>>>
>>> Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
>>> do not impose any limits on fused values.  Since we do not have any
>>> knowledge about these limits, use 0 as a minimum accepted fused value.
>>> This should essentially allow accepting any reasonable fused value thus
>>> behaving like vendor driver.
>>>
>>
>> On HK following values are define in drivers/thermal/exynos_thermal.c
>>
>> #define EFUSE_MIN_VALUE 40
>> #define EFUSE_MAX_VALUE 100
>
> Are they being used?

Opps: sorry it's not used for Exynos5422 platform.

Best regards,
-Anand


Re: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420

2017-02-13 Thread Anand Moon
Hi Krzysztof,

On 13 February 2017 at 17:29, Krzysztof Kozlowski  wrote:
> On Mon, Feb 13, 2017 at 1:38 PM, Anand Moon  wrote:
>> Hi Krzysztof,
>>
>>
>>
>> On 12 February 2017 at 01:44, Krzysztof Kozlowski  wrote:
>>> In Odroid XU3 Lite board, the temperature levels reported for thermal
>>> zone 0 were weird. In warm room:
>>> /sys/class/thermal/thermal_zone0/temp:32000
>>> /sys/class/thermal/thermal_zone1/temp:51000
>>> /sys/class/thermal/thermal_zone2/temp:55000
>>> /sys/class/thermal/thermal_zone3/temp:54000
>>> /sys/class/thermal/thermal_zone4/temp:51000
>>>
>>> Sometimes after booting the value was even equal to ambient temperature
>>> which is highly unlikely to be a real temperature of sensor in SoC.
>>>
>>> The thermal sensor's calibration (trimming) is based on fused values.
>>> In case of the board above, the fused values are: 35, 52, 43, 58 and 43
>>> (corresponding to each TMU device).  However driver defined a minimum value
>>> for fused data as 40 and for smaller values it was using a hard-coded 55
>>> instead.  This lead to mapping data from sensor to wrong temperatures
>>> for thermal zone 0.
>>>
>>> Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
>>> do not impose any limits on fused values.  Since we do not have any
>>> knowledge about these limits, use 0 as a minimum accepted fused value.
>>> This should essentially allow accepting any reasonable fused value thus
>>> behaving like vendor driver.
>>>
>>
>> On HK following values are define in drivers/thermal/exynos_thermal.c
>>
>> #define EFUSE_MIN_VALUE 40
>> #define EFUSE_MAX_VALUE 100
>
> Are they being used?

Opps: sorry it's not used for Exynos5422 platform.

Best regards,
-Anand


Re: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420

2017-02-13 Thread Krzysztof Kozlowski
On Mon, Feb 13, 2017 at 1:38 PM, Anand Moon  wrote:
> Hi Krzysztof,
>
>
>
> On 12 February 2017 at 01:44, Krzysztof Kozlowski  wrote:
>> In Odroid XU3 Lite board, the temperature levels reported for thermal
>> zone 0 were weird. In warm room:
>> /sys/class/thermal/thermal_zone0/temp:32000
>> /sys/class/thermal/thermal_zone1/temp:51000
>> /sys/class/thermal/thermal_zone2/temp:55000
>> /sys/class/thermal/thermal_zone3/temp:54000
>> /sys/class/thermal/thermal_zone4/temp:51000
>>
>> Sometimes after booting the value was even equal to ambient temperature
>> which is highly unlikely to be a real temperature of sensor in SoC.
>>
>> The thermal sensor's calibration (trimming) is based on fused values.
>> In case of the board above, the fused values are: 35, 52, 43, 58 and 43
>> (corresponding to each TMU device).  However driver defined a minimum value
>> for fused data as 40 and for smaller values it was using a hard-coded 55
>> instead.  This lead to mapping data from sensor to wrong temperatures
>> for thermal zone 0.
>>
>> Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
>> do not impose any limits on fused values.  Since we do not have any
>> knowledge about these limits, use 0 as a minimum accepted fused value.
>> This should essentially allow accepting any reasonable fused value thus
>> behaving like vendor driver.
>>
>
> On HK following values are define in drivers/thermal/exynos_thermal.c
>
> #define EFUSE_MIN_VALUE 40
> #define EFUSE_MAX_VALUE 100

Are they being used?

Best regards,
Krzysztof


Re: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420

2017-02-13 Thread Krzysztof Kozlowski
On Mon, Feb 13, 2017 at 1:38 PM, Anand Moon  wrote:
> Hi Krzysztof,
>
>
>
> On 12 February 2017 at 01:44, Krzysztof Kozlowski  wrote:
>> In Odroid XU3 Lite board, the temperature levels reported for thermal
>> zone 0 were weird. In warm room:
>> /sys/class/thermal/thermal_zone0/temp:32000
>> /sys/class/thermal/thermal_zone1/temp:51000
>> /sys/class/thermal/thermal_zone2/temp:55000
>> /sys/class/thermal/thermal_zone3/temp:54000
>> /sys/class/thermal/thermal_zone4/temp:51000
>>
>> Sometimes after booting the value was even equal to ambient temperature
>> which is highly unlikely to be a real temperature of sensor in SoC.
>>
>> The thermal sensor's calibration (trimming) is based on fused values.
>> In case of the board above, the fused values are: 35, 52, 43, 58 and 43
>> (corresponding to each TMU device).  However driver defined a minimum value
>> for fused data as 40 and for smaller values it was using a hard-coded 55
>> instead.  This lead to mapping data from sensor to wrong temperatures
>> for thermal zone 0.
>>
>> Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
>> do not impose any limits on fused values.  Since we do not have any
>> knowledge about these limits, use 0 as a minimum accepted fused value.
>> This should essentially allow accepting any reasonable fused value thus
>> behaving like vendor driver.
>>
>
> On HK following values are define in drivers/thermal/exynos_thermal.c
>
> #define EFUSE_MIN_VALUE 40
> #define EFUSE_MAX_VALUE 100

Are they being used?

Best regards,
Krzysztof


Re: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420

2017-02-13 Thread Anand Moon
Hi Krzysztof,



On 12 February 2017 at 01:44, Krzysztof Kozlowski  wrote:
> In Odroid XU3 Lite board, the temperature levels reported for thermal
> zone 0 were weird. In warm room:
> /sys/class/thermal/thermal_zone0/temp:32000
> /sys/class/thermal/thermal_zone1/temp:51000
> /sys/class/thermal/thermal_zone2/temp:55000
> /sys/class/thermal/thermal_zone3/temp:54000
> /sys/class/thermal/thermal_zone4/temp:51000
>
> Sometimes after booting the value was even equal to ambient temperature
> which is highly unlikely to be a real temperature of sensor in SoC.
>
> The thermal sensor's calibration (trimming) is based on fused values.
> In case of the board above, the fused values are: 35, 52, 43, 58 and 43
> (corresponding to each TMU device).  However driver defined a minimum value
> for fused data as 40 and for smaller values it was using a hard-coded 55
> instead.  This lead to mapping data from sensor to wrong temperatures
> for thermal zone 0.
>
> Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
> do not impose any limits on fused values.  Since we do not have any
> knowledge about these limits, use 0 as a minimum accepted fused value.
> This should essentially allow accepting any reasonable fused value thus
> behaving like vendor driver.
>

On HK following values are define in drivers/thermal/exynos_thermal.c

#define EFUSE_MIN_VALUE 40
#define EFUSE_MAX_VALUE 100

> The exynos5420-tmu-sensor-conf.dtsi is copied directly from existing
> exynso4412 with one change - the samsung,tmu_min_efuse_value.
>
> Signed-off-by: Krzysztof Kozlowski 
>
> ---

Best Regards
-Anand


Re: [PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420

2017-02-13 Thread Anand Moon
Hi Krzysztof,



On 12 February 2017 at 01:44, Krzysztof Kozlowski  wrote:
> In Odroid XU3 Lite board, the temperature levels reported for thermal
> zone 0 were weird. In warm room:
> /sys/class/thermal/thermal_zone0/temp:32000
> /sys/class/thermal/thermal_zone1/temp:51000
> /sys/class/thermal/thermal_zone2/temp:55000
> /sys/class/thermal/thermal_zone3/temp:54000
> /sys/class/thermal/thermal_zone4/temp:51000
>
> Sometimes after booting the value was even equal to ambient temperature
> which is highly unlikely to be a real temperature of sensor in SoC.
>
> The thermal sensor's calibration (trimming) is based on fused values.
> In case of the board above, the fused values are: 35, 52, 43, 58 and 43
> (corresponding to each TMU device).  However driver defined a minimum value
> for fused data as 40 and for smaller values it was using a hard-coded 55
> instead.  This lead to mapping data from sensor to wrong temperatures
> for thermal zone 0.
>
> Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
> do not impose any limits on fused values.  Since we do not have any
> knowledge about these limits, use 0 as a minimum accepted fused value.
> This should essentially allow accepting any reasonable fused value thus
> behaving like vendor driver.
>

On HK following values are define in drivers/thermal/exynos_thermal.c

#define EFUSE_MIN_VALUE 40
#define EFUSE_MAX_VALUE 100

> The exynos5420-tmu-sensor-conf.dtsi is copied directly from existing
> exynso4412 with one change - the samsung,tmu_min_efuse_value.
>
> Signed-off-by: Krzysztof Kozlowski 
>
> ---

Best Regards
-Anand