Thermal overview

Revision as of 12:00, 17 August 2022 by Registered User
Under construction.png This article is under construction and will be available end of 2022



1. Framework purpose[edit source]

The purpose of this article is to introduce the Thermal framework.

Thermal framework is a subsystem made for handling thermal sensors and cooling devices, it is made of 3 subsystems:

  • thermal zone
  • cooling device
  • thermal-sensor via hwmon API or thermal API

2. System Overview[edit source]

Alternate text
Thermal Framework

2.1. Component description[edit source]

  • thermal-zone is a container used to describe all thermal data for the platform
  • thermal framework offers an API to read temperature, and to handle thresholds with interrupts.
  • hwmon framework offers an API to read temperature for polling usage, a sysfs but, no threshold.
  • cooling-device device is used to dissipate heat either
    • actively for example with a FAN controlled by GPIOs
    • passively via OPP by forcing a lower CPU voltage or frequencies as a cooling state.

2.2. thermal-zone details[edit source]

The thermal zone is also responsible for

  • driving cooling devices depending on thermal sensor information,
  • handling a critical trip point that consist of calling shutdown,
  • polling thermal sensors that does not handle trips points with IRQs (that are implemented under hwmon framework).

A system may contains several thermal zones. For example one for CPU, one for GPU. Each zone is made of:

  • a thermal sensor with some polling periods descriptions,
  • some active or passive trip points with a temperature and hysteresis for each,
  • a cooling map that describe the action for each trip point.

2.3. API description[edit source]

The Thermal API is not documented in the Linux Kernel documentation.

3. Configuration[edit source]

3.1. Kernal configuration[edit source]

The Thermal API is activated by default in ST deliveries. Nevertheless, if a specific configuration is required, you can use Linux Menuconfig tool: Menuconfig or how to configure kernel and select:


[*] Device Drivers -->
    [*]   Thermal drivers (THERMAL [=y]) -->
        [*]   STMicroelectronics thermal drivers
    [*]   Hardware Monitoring support (HWMON [=y])

3.2. Devicetree configuration[edit source]

The thermal zone is represented by the Thermal zone binding[1]

The thermal sensor is represented by the Thermal sensor binding[2]

The thermal cooling device is represented by the Thermal cooling device binding[3]

4. How to use the Thermal framework[edit source]

5. Use cases[edit source]

A typical use case is passive power dissipation, consisting in limiting CPU frequency when the temperature of the CPU is too high.

6. How to trace and debug the framework[edit source]

6.1. How to monitor[edit source]

6.2. How to trace[edit source]

There are no specific traces for this framework.

6.3. How to debug[edit source]

There are no specific debug means for this framework.


7. Generic source code location[edit source]

8. References[edit source]