The STM STM32MP15 SOC temperature monitor module features alarm functions that can trigger independent interrupt signals if the temperature rises above a high-temperature threshold or falls below a low-temperature threshhold. The temperature threshold is programmable through the device tree.

Kernel configuration

You can manage the thermal support through the kernel configuration option:

  • Temperature sensor STMicroelectronics STM32 support (CONFIG_STM32_THERMAL)

This option is enabled as built-in on the default ConnectCore MP15 kernel configuration file.

Kernel driver

File Description

drivers/thermal/st/stm_thermal.c

STM32 Thermal driver

Device tree bindings and customization

The STM32MP15 thermal device tree binding is documented at Documentation/devicetree/bindings/thermal/st,stm32-thermal.yaml

Definition of the thermal monitor unit

STM32MP15 device tree
	dts: thermal@50028000 {
		compatible = "st,stm32-thermal";
		reg = <0x50028000 0x100>;
		interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&rcc TMPSENS>;
		clock-names = "pclk";
		#thermal-sensor-cells = <0>;
		status = "disabled";
	};

Usage

CPU temperature

To check the current temperature of the CPU:

# cat /sys/class/thermal/thermal_zone0/temp
49801

The command returns the temperature in millicelsius.

Trip points

A trip point describes a point in the temperature domain at which the system takes an action. This node describes just the point, not the action.

The Linux thermal subsystem establishes several types of trip points:

  • passive: a trip point to enable passive cooling (such as decreasing clock frequency).

  • active: a trip point to enable active cooling (such as activating fans).

  • hot: a trip point to indicate that an emergency temperature threshold has been reached.

  • critical: a trip point where hardware is at risk.

The STM32MP15 thermal driver defines one trip point at a given threshold below the maximum temperature supported by the SOC:

Trip point type Temperature

Critical

<max> - 5 °C

where <max>, the maximum temperature supported by the chip, depends on the thermal grade of the SOC:

  • Industrial: 120 °C

Critical trip point

When the SOC temperature reaches the critical trip point temperature, the SOC generates an interrupt and the driver resets the system to prevent damage to the silicon.

To read the critical trip point parameters:

# cat /sys/class/thermal/thermal_zone0/trip_point_0_type
critical
# cat /sys/class/thermal/thermal_zone0/trip_point_0_temp
120000