3.2.3.17. Voltage & Thermal Management (VTM)

3.2.3.17.1. Introduction

VTM Driver Overview

The Voltage and Thermal Management (VTM) system provides the control, status and interrupt generation for the various independent temperature sensors located at different hotspots on the SoC. This allows the kernel to take actions based on thermal events configured via the kernel’s device tree.

3.2.3.17.2. Driver Features

Sysfs Monitoring

One of the most basic roles the VTM system can give the kernel is temperature readings (in milliCelcius) in the sysfs filesystem.

cat /sys/class/thermal/thermal_zone*/temp

Running this command on your SoC will print each temperature in milliCelcius for that region on the SoC.

Preset Thresholds & Triggers

We can also program up to 3 threshold temperatures, 2 for greater than thresholds and 1 for a less than threshold, to allow the VTM to alert the kernel to take action. For example when the 1st threshold is exceeded the kernel can be alerted to begin reducing the voltage and clocks speed of CPUs, allowing the SoC’s overall temperature to stabilize. If the SoC temperature continues to increase we can then use the 2nd threshold to take more aggressive action. For example we could issue a poweroff command to turn the device off completely once the 2nd threshold is exceeded.

Threshold temperatures can be set in the kernel with the values we define inside the device tree. For example to set a ‘critical’ temperature, where the kernel will poweroff the SoC, we can add a node like this:

example_thermal: ex-thermal {
      polling-delay-passive = <250>;  /* milliSeconds */
      polling-delay = <500>;          /* milliSeconds */
      thermal-sensors = <&wkup_vtm0 0>;

      trips {
              example_crit: ex-crit {
                      temperature = <125000>; /* milliCelsius */
                      hysteresis = <2000>;    /* milliCelsius */
                      type = "critical";
              };
      };
};

This example node will instruct the kernel to periodically poll this temperature sensor and to shutdown the SoC once it has exceeded 125 degrees Celsius.

3.2.3.17.3. Finding More Information

More information can be found for this VTM device inside the Technical Reference Manual for your device or the device tree binding documentation in the kernel’s source.