The NXP {cpu-family} SOC temperature monitor module features alarm functions that can trigger independent interrupt signals if the temperature rises above two high-temperature thresholds or falls below one low-temperature threshold. These temperature thresholds are programmable and designated as low, high, and panic temperature.

Kernel configuration

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

  • Temperature sensor driver for Freescale i.MX SoCs (CONFIG_IMX_THERMAL)

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

Kernel driver

File Description

drivers/thermal/imx_thermal.c

Thermal driver

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.

Device tree bindings and customization

The {cpu-family} thermal device tree binding is documented at Documentation/devicetree/bindings/thermal/imx-thermal.txt

Definition of the thermal monitor unit

{cpu-family} device tree
	tempmon: tempmon {
		compatible = "fsl,imx6q-tempmon";
		interrupt-parent = <&gpc>;
		interrupts = <0 49 IRQ_TYPE_LEVEL_HIGH>;
		fsl,tempmon = <&anatop>;
		fsl,tempmon-data = <&ocotp>;
		clocks = <&clks IMX6QDL_CLK_PLL3_USB_OTG>;
		#thermal-sensor-cells = <0>;
	};

Usage

CPU temperature

To check the current temperature of the CPU:

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

The command returns the temperature in millicelsius.

Trip points

The {cpu-family} thermal driver defines two trip points at given thresholds below the maximum temperature supported by the SOC:

Trip point type Temperature

Passive

<max> - 20 °C

Critical

<max> - 5 °C

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

  • Commercial: 95 °C

  • Extended commercial: 105 °C

  • Industrial: 105 °C

  • Automotive: 125 °C

Check the thermal grade of your SOC on the U-Boot banner during boot.

Passive trip point

When the temperature in the SOC reaches the passive trip point temperature, the SOC generates an interrupt and the driver sends a notification. Other drivers may subscribe to such notifications in order to trigger cooling actions, such as reducing their clock frequency.

On the current BSP, the GPU driver subscribes to the temperature monitor to lower the GPU frequency when the passive trip point is reached. Expect a performance impact on graphical applications when this happens.

Besides subscriptions, devices declared on the device tree as cooling devices and linked to this trip point will take passive actions. This is the case of the Cortex-A9 cores, which reduce their frequency when they reach the passive trip point.

The passive trip point has a hysteresis of 10 °C. This means that only when the die temperature has gone 10 °C below the passive trip point, the system is considered within normal parameters and the cooling actions can be cancelled.

To read the passive trip point parameters:

# cat /sys/class/thermal/thermal_zone0/trip_point_0_type
passive
# cat /sys/class/thermal/thermal_zone0/trip_point_0_temp
85000

To set a different temperature for the passive trip point, write the new temperature (in millicelsius) to the trip point temperature descriptor:

# echo 65000 > /sys/class/thermal/thermal_zone0/trip_point_0_temp
Changes to the trip points done through the sysfs are not persistent across reboots. To make permanent changes, modify the trip points temperature on the device tree.

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_1_type
critical
# cat /sys/class/thermal/thermal_zone0/trip_point_1_temp
100000

To set a different temperature for the critical trip point, write the new temperature (in millicelsius) to the trip point temperature descriptor:

# echo 90000 > /sys/class/thermal/thermal_zone0/trip_point_1_temp
Changes to the trip points done through the sysfs are not persistent across reboots. To make permanent changes, modify the trip points temperature on the device tree.