Changes between Initial Version and Version 1 of ventana/thermal


Ignore:
Timestamp:
10/22/2017 05:28:45 AM (7 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ventana/thermal

    v1 v1  
     1{{{#!html
     2          <div id="wikipage" class="trac-content"><p>
     3</p><div class="wiki-toc">
     4<ol>
     5  <li>
     6    <a href="#VentanaThermalInformation">Ventana Thermal Information</a>
     7    <ol>
     8      <li>
     9        <a href="#GateworksSystemControllerGSC">Gateworks System Controller (GSC)</a>
     10      </li>
     11      <li>
     12        <a href="#IMX6SoC">IMX6 SoC</a>
     13        <ol>
     14          <li>
     15            <a href="#LinuxKernelSupport">Linux Kernel Support</a>
     16          </li>
     17          <li>
     18            <a href="#U-BootSupport">U-Boot Support</a>
     19          </li>
     20        </ol>
     21      </li>
     22      <li>
     23        <a href="#VivanteGPUthermalmanagement">Vivante GPU thermal management</a>
     24      </li>
     25    </ol>
     26  </li>
     27</ol>
     28</div><p>
     29</p>
     30<h1 id="VentanaThermalInformation">Ventana Thermal Information</h1>
     31<p>
     32See also:
     33</p>
     34<ul><li><a class="wiki" href="/wiki/ventana/thermal_management">Very Resourceful Thermal Management Page</a>
     35</li><li><a class="wiki" href="/wiki/DVFS">Dynamic Voltage and Frequency Scaling of the Processor</a>
     36</li><li><a class="wiki" href="/wiki/ventana/power">Ventana Power Consumption</a>
     37</li><li><a class="wiki" href="/wiki/faq#WhyarecertainareasontheboardwarmwithregardstotemperatureWhyismyboardhot">FAQ - Why is my board running hot?</a>
     38</li></ul><p>
     39<span class="wikianchor" id="gsc-thermal"></span>
     40</p>
     41<h2 id="GateworksSystemControllerGSC">Gateworks System Controller (GSC)</h2>
     42<p>
     43The Gateworks System Controller has a temperature sensor that measures board temperature as well as a fan controller on some models.
     44</p>
     45<p>
     46For more information:
     47</p>
     48<ul><li><a class="wiki" href="/wiki/gsc#hwmon">GSC Thermal sensor</a>
     49</li><li><a class="wiki" href="/wiki/gsc#fan">GSC Fan Controller</a> - Only available on GW54xx
     50</li></ul><p>
     51<span class="wikianchor" id="imx-thermal"></span>
     52</p>
     53<h2 id="IMX6SoC">IMX6 SoC</h2>
     54<p>
     55The IMX6 System On Chip has an internal die temperature sensor.
     56</p>
     57<p>
     58There are several temperature grades of IMX6 SoC's that are used across various Gateworks products:
     59</p>
     60<ul><li>IMX6Q Automotive: -40C to 125C
     61</li><li>IMX6DL Industrial: -40C to 105C
     62</li><li>IMX6S Industrial: -40C to 105C
     63</li></ul><h3 id="LinuxKernelSupport">Linux Kernel Support</h3>
     64<p>
     65The Linux IMX6 cpufreq cooling driver (drivers/thermal/imx_thermal.c) provides several functions:
     66</p>
     67<ul><li>display the thermal grade of CPU and min/max temperature
     68</li><li>thermal sensing of the IMX6 chip
     69</li><li>automatic CPU frequency throttling based on temperature feedback
     70</li></ul><p>
     71There is a Linux sysfs API for accessing this information:
     72</p>
     73<ul><li>Note in first line, hwmon1 may be hwmon2
     74<pre class="wiki">cat /sys/class/hwmon/hwmon1/temp1_input # current IMX temp in milicelcius
     75cat /sys/class/thermal/thermal_zone0/trip_point_0_temp # current passive temp in milicelcius
     76cat /sys/class/thermal/thermal_zone0/trip_point_1_temp # current critical temp in milicelcius
     77# set passive/crit to 105C/125C for automotive CPU
     78echo 105000 &gt; /sys/class/thermal/thermal_zone0/trip_point_0_temp
     79echo 125000 &gt; /sys/class/thermal/thermal_zone0/trip_point_1_temp
     80</pre></li></ul><p>
     81Notes:
     82</p>
     83<ul><li>the imx_thermal_zone temp currently starts scaling ARM cpufreq at 85C (until it lowers to 75C) and has a critical temp of 100C. This is really too conservative for the typical IMX6 temperature grades that Gateworks uses
     84</li><li>there is a 10C hysteresis such that the temperature needs to lower by 10C before the alarm is cancelled
     85</li><li>the <strong>passive</strong> trip point is a preventative measure before reaching critical that does things to lower temperature such as reducing cpu/gpu frequencies
     86</li><li>the <strong>critical</strong> trip point should not be exceeded to avoid damaging the CPU and as such when this trip point is reached the Linux shutdown function is called to attempt to gracefully shut down the OS. The default implementation will end up simply resetting the board but before that occurs a usermode helper will exec /sbin/poweroff which the user could implement to do whatever they choose (ie, sync filesystems, use GSC sleep for 'x' seconds, etc).
     87</li><li>the thresholds for the driver can be adjusted in userspace (see above)
     88</li><li>Gateworks has <a class="ext-link" href="http://thread.gmane.org/gmane.linux.ports.arm.kernel/409671/focus=411988"><span class="icon">​</span>an upstream Linux patch pending approval</a> that will set the initial setpoints according to the temperature grade of the CPU determined via eFUSE registers. This patch will eventually be rolled into our various kernel support.
     89</li></ul><h3 id="U-BootSupport">U-Boot Support</h3>
     90<p>
     91The Gateworks Ventana Bootloader driver (drivers/thermal/imx_thermal.c) provides several functions:
     92</p>
     93<ul><li>display the thermal grade of CPU and min/max temperature
     94</li><li>display current temperature of IMX6
     95</li><li>busyloop if over IMX6 temperature is greater or equal to max temp - 5C
     96</li></ul><p>
     97<span class="wikianchor" id="gpu-thermal"></span>
     98</p>
     99<h2 id="VivanteGPUthermalmanagement">Vivante GPU thermal management</h2>
     100<p>
     101The Vivante GPU has some frequency scaling based on temperature which enabled by default in the [drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.c Vivante driver]. If enabled the driver will scale the GPU frequency down by a specified divisor. By default this is 3/64 for the Gateworks Yocto and Android BSP's.
     102</p>
     103<p>
     104The GPU frequency scaling is triggered by the IMX thermal zone <strong>passive</strong> trip point (see <a class="wiki" href="/wiki/ventana/thermal#imx-thermal">above</a>). Note that because the temperature is triggered by the IMX thermal zone, the ARM cpu frequency will be reduced at the same time.
     105</p>
     106<p>
     107The minimum devisor used to reduce GPU frequency by default is 1 (meaning 1/64th frequency scaling which is the maximum amount of frequency reduction possible) you can use the drivers sysfs interface:
     108</p>
     109<ul><li>On Yocto v1.8 (3.14.x):
     110<pre class="wiki">echo 3 &gt; /sys/bus/platform/drivers/galcore/gpu3DMinClock # set GPU freq reduction to 3/64
     111</pre></li><li>On Yocto v1.6/v1.7 (3.10.17):
     112<pre class="wiki">echo 3 &gt; /sys/module/galcore/parameters/gpu3DMinClock # set GPU freq reduction to 3/64
     113</pre></li><li>On Linux 3.10.53 (Yocto master / Android kk)
     114<pre class="wiki">echo 3 &gt; /sys/bus/platform/drivers/galcore/gpu3DMinClock # set GPU freq reduction to 3/64
     115</pre></li></ul><p>
     116You can change this value from 1 to 64, where 1 is 1/64 frequency (maximum reduction) and 64 is no reduction. Note that depending on what the GPU is being used for, you may want to increase this value. We have found that a value of 3 for example offers adequate cooling without sacrificing significant performance.
     117</p>
     118}}}