# Thermal zone

_Peios Kernel / Hardware and drivers / Device-tree binding reference / Thermal bindings_

> Device-tree binding reference for Thermal zone.

<!-- SPDX-License-Identifier: (GPL-2.0) -->


<a id="dt-root"></a>

**Schema identifier (<code>&#36;id</code>):** <span id="dt-09f478f44eb202ea573e"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;schemas&#47;thermal&#47;thermal&#45;zones&#46;yaml&#35;&#34;</code></span>

**Schema dialect (<code>&#36;schema</code>):** <span id="dt-dcb375baab6014763a68"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;meta&#45;schemas&#47;base&#46;yaml&#35;&#34;</code></span>

<a id="dt-e46b5a5dd81dbd751c9f"></a>

**Maintainers (<code>maintainers</code>):** <a id="dt-fbc39820abb8bb999095"></a> <span id="dt-fb78ddfc22abfc6fe56d"><code>&#34;Daniel Lezcano &#60;daniel&#46;lezcano&#64;linaro&#46;org&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">Thermal management is achieved in devicetree by describing the sensor hardware
and the software abstraction of cooling devices and thermal zones required to
take appropriate action to mitigate thermal overloads.</p>
<pre><code>The following node types are used to completely describe a thermal management
system in devicetree:
 - thermal-sensor: device that measures temperature, has SoC-specific bindings
 - cooling-device: device used to dissipate heat either passively or actively
 - thermal-zones: a container of the following node types used to describe all
   thermal data for the platform</code></pre>
<p style="white-space: pre-wrap">This binding describes the thermal-zones.</p>
<pre><code>The polling-delay properties of a thermal-zone are bound to the maximum dT/dt
(temperature derivative over time) in two situations for a thermal zone:
  1. when passive cooling is activated (polling-delay-passive)
  2. when the zone just needs to be monitored (polling-delay) or when
     active cooling is activated.</code></pre>
<p style="white-space: pre-wrap">The maximum dT/dt is highly bound to hardware power consumption and
dissipation capability. The delays should be chosen to account for said
max dT/dt, such that a device does not cross several trip boundaries
unexpectedly between polls. Choosing the right polling delays shall avoid
having the device in temperature ranges that may damage the silicon structures
and reduce silicon lifetime.</p>
</div>

<a id="dt-e1f655ed0ff4d595dadc"></a>

## Properties and child nodes (<code>properties</code>)

<a id="dt-5155525ecd924660ec0a"></a>

### <code>&#36;nodename</code> — not listed as required here

**Exact value (<code>const</code>):** <span id="dt-8cca737a574136d30da2"><code>&#34;thermal&#45;zones&#34;</code></span>

<div id="dt-a548345486641e38cbb3">
<p style="white-space: pre-wrap">A /thermal-zones node is required in order to use the thermal framework to manage input from the various thermal zones in the system in order to mitigate thermal overload conditions. It does not represent a real device in the system, but acts as a container to link a thermal sensor device, platform-data regarding temperature thresholds and the mitigation actions to take when the temperature crosses those thresholds.</p>
</div>

<a id="dt-e92215bd3c2f5373b164"></a>

## Properties matching a name pattern (<code>patternProperties</code>)

<a id="dt-aa7cbf94f5576b93796f"></a>

### <code>&#94;&#91;a&#45;zA&#45;Z&#93;&#91;a&#45;zA&#45;Z0&#45;9&#92;&#45;&#93;&#123;1&#44;10&#125;&#45;thermal&#36;</code> — name matches this regular expression

**Value type (<code>type</code>):** <span id="dt-ba55387a8749b539d1e5"><code>&#34;object&#34;</code></span>

<div id="dt-260ddac1ec339065d223">
<p style="white-space: pre-wrap">Each thermal zone node contains information about how frequently it must be checked, the sensor responsible for reporting temperature for this zone, one sub-node containing the various trip points for this zone and one sub-node containing all the zone cooling-maps.</p>
</div>

<a id="dt-176f4c490bde96702e84"></a>

#### Properties and child nodes (<code>properties</code>)

<a id="dt-0d4c527a82ad55d78052"></a>

**<code>polling&#45;delay</code> — not listed as required here**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-52c5fa00ab2d547bd06e">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>

<div id="dt-ff8889f57497e14b60f5">
<p style="white-space: pre-wrap">The maximum number of milliseconds to wait between polls when checking this thermal zone. Setting this to 0 disables the polling timers setup by the thermal framework and assumes that the thermal sensors in this zone support interrupts.</p>
</div>

<a id="dt-29809c9ac05293cbd78e"></a>

**<code>polling&#45;delay&#45;passive</code> — not listed as required here**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-20d90ea0d2c3ad86e404">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>

<div id="dt-f20e31f6e40936ce41f0">
<p style="white-space: pre-wrap">The maximum number of milliseconds to wait between polls when checking this thermal zone while doing passive cooling. Setting this to 0 disables the polling timers setup by the thermal framework and assumes that the thermal sensors in this zone support interrupts.</p>
</div>

<a id="dt-faea36c2af21c10cebdb"></a>

**<code>critical&#45;action</code> — not listed as required here**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-ac3bb860ff738733ae26">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;string</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-2c695d502852c3a1e1b7>)</span>

<div id="dt-a5459a7274f391138840">
<p style="white-space: pre-wrap">The action the OS should perform after the critical temperature is reached.
If the property is not set, it is up to the system to select the correct
action. The recommended and preferred default is shutdown.
Choose 'reboot' with care, as the hardware may be in thermal stress,
thus leading to infinite reboots that may cause damage to the hardware.
Make sure the firmware/bootloader will act as the last resort and take
over the thermal control.</p>
</div>

**Allowed values (<code>enum</code>):** <a id="dt-f080996451f0d8401bea"></a> <span id="dt-fec30355489b028e10e8"><code>&#34;shutdown&#34;</code></span>, <span id="dt-e0b1c1f4e09b115f5150"><code>&#34;reboot&#34;</code></span>

<a id="dt-eb84ac338678bbf672ef"></a>

**<code>thermal&#45;sensors</code> — required here**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-edfdb6d90d42ed14960b">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;phandle&#45;array</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-8f5710c4314b4caa4970>)</span>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-b74dabfa1153920fd4af"><code>1</code></span>

<div id="dt-284000f45c6c579fe975">
<p style="white-space: pre-wrap">The thermal sensor phandle and sensor specifier used to monitor this thermal zone.</p>
</div>

<a id="dt-097661da9f8befc6b58a"></a>

**<code>coefficients</code> — not listed as required here**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-1d093f4c393cfe4c3daa">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32&#45;array</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-03a03f95a666fe4b033c>)</span>

<div id="dt-801847a22314aa6253b5">
<p style="white-space: pre-wrap">An array of integers containing the coefficients of a linear equation that binds all the sensors listed in this thermal zone.
The linear equation used is as follows, z = c0 * x0 + c1 * x1 + ... + c(n-1) * x(n-1) + cn where c0, c1, .., cn are the coefficients.
Coefficients default to 1 in case this property is not specified. The coefficients are ordered and are matched with sensors by means of the sensor ID. Additional coefficients are interpreted as constant offset.</p>
</div>

<a id="dt-c33fc366b502caf33480"></a>

**<code>sustainable&#45;power</code> — not listed as required here**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-64e17d30a869a3b0a422">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>

<div id="dt-42676bf47e800ad4d9af">
<p style="white-space: pre-wrap">An estimate of the sustainable power (in mW) that this thermal zone can dissipate at the desired control temperature. For reference, the sustainable power of a 4-inch phone is typically 2000mW, while on a 10-inch tablet is around 4500mW.</p>
</div>

<a id="dt-f5a015970d61b393181f"></a>

**<code>trips</code> — not listed as required here**

**Value type (<code>type</code>):** <span id="dt-b433e5048dec8bfc0464"><code>&#34;object&#34;</code></span>

<div id="dt-0e8c6765222bd2868777">
<p style="white-space: pre-wrap">This node describes a set of points in the temperature domain at which the thermal framework needs to take action. The actions to be taken are defined in another node called cooling-maps.</p>
</div>

<a id="dt-cab9c783e4e039645576"></a>

**Properties matching a name pattern (<code>patternProperties</code>)**

<a id="dt-d6c6f0d4e9c2aee418d5"></a>

**<code>&#94;&#91;a&#45;zA&#45;Z&#93;&#91;a&#45;zA&#45;Z0&#45;9&#92;&#45;&#95;&#93;&#123;0&#44;63&#125;&#36;</code> — name matches this regular expression**

**Value type (<code>type</code>):** <span id="dt-83eb2f2b97ade9857829"><code>&#34;object&#34;</code></span>

<a id="dt-32647f26f04652a064f7"></a>

**Properties and child nodes (<code>properties</code>)**

<a id="dt-c872fc4f31319b5526d7"></a>

**<code>temperature</code> — required here**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-a4bd6d67db9569aef309">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;int32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-c78c9f973ad0b0b28e5c>)</span>

**Minimum value (<code>minimum</code>):** <span id="dt-1a0c1c86494d7d10077f"><code>&#45;273000</code></span>

**Maximum value (<code>maximum</code>):** <span id="dt-c58d91c7a860728cebd1"><code>200000</code></span>

<div id="dt-c93e42390cd0a8a6ff70">
<p style="white-space: pre-wrap">An integer expressing the trip temperature in millicelsius.</p>
</div>

<a id="dt-0a05f7ebaf44f6caac37"></a>

**<code>hysteresis</code> — required here**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-085a9fb15a2445a7a823">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>

<div id="dt-5bb737bb77039b57dca0">
<p style="white-space: pre-wrap">An unsigned integer expressing the hysteresis delta with respect to the trip temperature property above, also in millicelsius. Any cooling action initiated by the framework is maintained until the temperature falls below (trip temperature - hysteresis). This potentially prevents a situation where the trip gets constantly triggered soon after cooling action is removed.</p>
</div>

<a id="dt-4ad1e3d5ddfb6b0ac182"></a>

**<code>type</code> — required here**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-95e4c127e3826bde3045">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;string</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-2c695d502852c3a1e1b7>)</span>

**Allowed values (<code>enum</code>):** <a id="dt-f8fc5813a304eee107e1"></a> <span id="dt-bc6dbdcabe7979485c28"><code>&#34;active&#34;</code></span>, <span id="dt-94c11b65a81fb5912617"><code>&#34;passive&#34;</code></span>, <span id="dt-21c4fb20333eb3fbb1d7"><code>&#34;hot&#34;</code></span>, <span id="dt-d415de4426fe61741eb4"><code>&#34;critical&#34;</code></span>

<div id="dt-fefce6fe5379e915d271">
<p style="white-space: pre-wrap">There are four valid trip types: active, passive, hot,
critical.</p>
<p style="white-space: pre-wrap">The critical trip type is used to set the maximum
temperature threshold above which the HW becomes
unstable and underlying firmware might even trigger a
reboot. Hitting the critical threshold triggers a system
shutdown.</p>
<p style="white-space: pre-wrap">The hot trip type can be used to send a notification to
the thermal driver (if a .notify callback is registered).
The action to be taken is left to the driver.</p>
<p style="white-space: pre-wrap">The passive trip type can be used to slow down HW e.g. run
the CPU, GPU, bus at a lower frequency.</p>
<p style="white-space: pre-wrap">The active trip type can be used to control other HW to
help in cooling e.g. fans can be sped up or slowed down</p>
</div>

**Required in this object (<code>required</code>):** <a id="dt-2d24b21cb32692eb8d99"></a> <span id="dt-e3759c0d9327515db4ab"><code>&#34;temperature&#34;</code></span>, <span id="dt-62a269915918bf684e32"><code>&#34;hysteresis&#34;</code></span>, <span id="dt-96002155bfd9f25220bd"><code>&#34;type&#34;</code></span>

<a id="dt-db4201b880b38f98a20f"></a>

**Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)**

<code>false</code>

Not allowed by this rule.

<a id="dt-ae58f25acaed07e9fc17"></a>

**Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)**

<code>false</code>

Not allowed by this rule.

<a id="dt-869b07da55a64c247eb6"></a>

**<code>cooling&#45;maps</code> — not listed as required here**

**Value type (<code>type</code>):** <span id="dt-841059ebea10934c7b09"><code>&#34;object&#34;</code></span>

<a id="dt-3b20a4785c8ccd571527"></a>

**Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)**

<code>false</code>

Not allowed by this rule.

<div id="dt-1ae4df15953b5185598b">
<p style="white-space: pre-wrap">This node describes the action to be taken when a thermal zone crosses one of the temperature thresholds described in the trips node. The action takes the form of a mapping relation between a trip and the target cooling device state.</p>
</div>

<a id="dt-1c8ce3a6102a09f5c77d"></a>

**Properties matching a name pattern (<code>patternProperties</code>)**

<a id="dt-303659ac98cf53d019ec"></a>

**<code>&#94;map&#91;&#45;a&#45;zA&#45;Z0&#45;9&#93;&#42;&#36;</code> — name matches this regular expression**

**Value type (<code>type</code>):** <span id="dt-03cde81fa1c0cf2f852b"><code>&#34;object&#34;</code></span>

<a id="dt-168297874703e6b12c81"></a>

**Properties and child nodes (<code>properties</code>)**

<a id="dt-5e9cf19132333583d5cf"></a>

**<code>trip</code> — required here**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-16d238dd56eb379a8f4e">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;phandle</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-2533fa46618221e83225>)</span>

<div id="dt-51b379d8abc5c9ca47d1">
<p style="white-space: pre-wrap">A phandle of a trip point node within this thermal zone.</p>
</div>

<a id="dt-c849a5cce57ddc3d9e67"></a>

**<code>cooling&#45;device</code> — required here**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-6df9509edc4e309b3349">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;phandle&#45;array</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-8f5710c4314b4caa4970>)</span>

<div id="dt-264143e4baddd3a14dd7">
<p style="white-space: pre-wrap">A list of cooling device phandles along with the minimum and maximum cooling state specifiers for each cooling device. Using the THERMAL_NO_LIMIT (-1UL) constant in the cooling-device phandle limit specifier lets the framework use the minimum and maximum cooling state for that cooling device automatically.</p>
</div>

<a id="dt-83fddcea80d5c54bfe43"></a>

**<code>contribution</code> — not listed as required here**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-48c3d292ab3b51591c8a">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>

<div id="dt-0e6ac26259d4c80a6f37">
<p style="white-space: pre-wrap">The cooling contribution to the thermal zone of the referred cooling device at the referred trip point. The contribution is a ratio of the sum of all cooling contributions within a thermal zone.</p>
</div>

**Required in this object (<code>required</code>):** <a id="dt-25afd69f1ec8a21f7225"></a> <span id="dt-e3344dafd4354667a39d"><code>&#34;trip&#34;</code></span>, <span id="dt-5c9c6c5d648c9592889c"><code>&#34;cooling&#45;device&#34;</code></span>

<a id="dt-b708d71dfb9adfe65ec8"></a>

**Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)**

<code>false</code>

Not allowed by this rule.

**Required in this object (<code>required</code>):** <a id="dt-0ba11f97eb2f4649a865"></a> <span id="dt-becca232cfc19b269f15"><code>&#34;thermal&#45;sensors&#34;</code></span>

<a id="dt-ec01ebdb08252e5b7ad7"></a>

#### Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)

<code>false</code>

Not allowed by this rule.

<a id="dt-738c4b4f9e483441138b"></a>

## Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)

<code>false</code>

Not allowed by this rule.

<a id="dt-1a130cabaa8a47b058bf"></a>

## Examples (<code>examples</code>)

<pre id="dt-0bd6510295af0c95ff2d"><code class="language-dts">#include &lt;dt-bindings/interrupt-controller/arm-gic.h&gt;
#include &lt;dt-bindings/thermal/thermal.h&gt;

// Example 1: SDM845 TSENS
soc {
        #address-cells = &lt;2&gt;;
        #size-cells = &lt;2&gt;;

        /* ... */

        tsens0: thermal-sensor@c263000 {
                compatible = "qcom,sdm845-tsens", "qcom,tsens-v2";
                reg = &lt;0 0x0c263000 0 0x1ff&gt;, /* TM */
                      &lt;0 0x0c222000 0 0x1ff&gt;; /* SROT */
                #qcom,sensors = &lt;13&gt;;
                interrupts = &lt;GIC_SPI 506 IRQ_TYPE_LEVEL_HIGH&gt;,
                             &lt;GIC_SPI 508 IRQ_TYPE_LEVEL_HIGH&gt;;
                interrupt-names = "uplow", "critical";
                #thermal-sensor-cells = &lt;1&gt;;
        };

        tsens1: thermal-sensor@c265000 {
                compatible = "qcom,sdm845-tsens", "qcom,tsens-v2";
                reg = &lt;0 0x0c265000 0 0x1ff&gt;, /* TM */
                      &lt;0 0x0c223000 0 0x1ff&gt;; /* SROT */
                #qcom,sensors = &lt;8&gt;;
                interrupts = &lt;GIC_SPI 507 IRQ_TYPE_LEVEL_HIGH&gt;,
                             &lt;GIC_SPI 509 IRQ_TYPE_LEVEL_HIGH&gt;;
                interrupt-names = "uplow", "critical";
                #thermal-sensor-cells = &lt;1&gt;;
        };
};

/* ... */

thermal-zones {
        cpu0-thermal {
                polling-delay-passive = &lt;250&gt;;
                polling-delay = &lt;1000&gt;;

                thermal-sensors = &lt;&amp;tsens0 1&gt;;

                trips {
                        cpu0_alert0: trip-point0 {
                                temperature = &lt;90000&gt;;
                                hysteresis = &lt;2000&gt;;
                                type = "passive";
                        };

                        cpu0_alert1: trip-point1 {
                                temperature = &lt;95000&gt;;
                                hysteresis = &lt;2000&gt;;
                                type = "passive";
                        };

                        cpu0_crit: cpu_crit {
                                temperature = &lt;110000&gt;;
                                hysteresis = &lt;1000&gt;;
                                type = "critical";
                        };
                };

                cooling-maps {
                        map0 {
                                trip = &lt;&amp;cpu0_alert0&gt;;
                                /* Corresponds to 1400MHz in OPP table */
                                cooling-device = &lt;&amp;CPU0 3 3&gt;, &lt;&amp;CPU1 3 3&gt;,
                                                 &lt;&amp;CPU2 3 3&gt;, &lt;&amp;CPU3 3 3&gt;;
                        };

                        map1 {
                                trip = &lt;&amp;cpu0_alert1&gt;;
                                /* Corresponds to 1000MHz in OPP table */
                                cooling-device = &lt;&amp;CPU0 5 5&gt;, &lt;&amp;CPU1 5 5&gt;,
                                                 &lt;&amp;CPU2 5 5&gt;, &lt;&amp;CPU3 5 5&gt;;
                        };
                };
        };

        /* ... */

        cluster0-thermal {
                polling-delay-passive = &lt;250&gt;;
                polling-delay = &lt;1000&gt;;

                thermal-sensors = &lt;&amp;tsens0 5&gt;;

                trips {
                        cluster0_alert0: trip-point0 {
                                temperature = &lt;90000&gt;;
                                hysteresis = &lt;2000&gt;;
                                type = "hot";
                        };
                        cluster0_crit: cluster0_crit {
                                temperature = &lt;110000&gt;;
                                hysteresis = &lt;2000&gt;;
                                type = "critical";
                        };
                };
        };

        /* ... */

        gpu-top-thermal {
                polling-delay-passive = &lt;250&gt;;
                polling-delay = &lt;1000&gt;;

                thermal-sensors = &lt;&amp;tsens0 11&gt;;

                trips {
                        gpu1_alert0: trip-point0 {
                                temperature = &lt;90000&gt;;
                                hysteresis = &lt;2000&gt;;
                                type = "hot";
                        };
                };
        };
};
</code></pre>

## Source notes

<details>
<summary>Annotations retained from the schema source</summary>

<p id="dt-comment-0"><strong>Line 1:</strong> <span> SPDX-License-Identifier: (GPL-2.0)</span></p>

<p id="dt-comment-1"><strong>Line 2:</strong> <span> Copyright 2020 Linaro Ltd.</span></p>

<p id="dt-comment-2"><strong>Line 52:</strong> <span> Node name is limited in size due to Linux kernel requirements - 19</span></p>

<p id="dt-comment-3"><strong>Line 53:</strong> <span> characters in total (see THERMAL_NAME_LENGTH, including terminating NUL</span></p>

<p id="dt-comment-4"><strong>Line 54:</strong> <span> byte):</span></p>

<p id="dt-comment-5"><strong>Line 158:</strong> <span> enable active cooling e.g. fans</span></p>

<p id="dt-comment-6"><strong>Line 159:</strong> <span> enable passive cooling e.g. throttling cpu</span></p>

<p id="dt-comment-7"><strong>Line 160:</strong> <span> send notification to driver</span></p>

<p id="dt-comment-8"><strong>Line 161:</strong> <span> send notification to driver, trigger shutdown</span></p>

</details>
