You are here: Digi Embedded Yocto > System development > Linux v3.14 Board Support Package > Devices and interfaces > Power management

Power management

The Linux kernel uses several power management strategies:

Dynamic Voltage Frequency Scaling

Dynamic Voltage Frequency Scaling is enabled by default, so the CPU frequency and voltages of a running system will adapt to the system's load. The DVFS subsystem is controlled through the /sys/devices/system/cpu/cpuN/cpufreq/ sysfs path, where N corresponds to the core number:

Sysfs attributes of CPU frequency scaling
# ls /sys/devices/system/cpu/cpu0/cpufreq/
affected_cpus                  related_cpus                   scaling_governor
cpuinfo_cur_freq               scaling_available_frequencies  scaling_max_freq
cpuinfo_max_freq               scaling_available_governors    scaling_min_freq
cpuinfo_min_freq               scaling_cur_freq               scaling_setspeed
cpuinfo_transition_latency     scaling_driver                 stats

The scaling_cur_freq file shows the current frequency of the core:

# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
396000

The available frequencies are shown in scaling_available_frequencies.

The DVFS subsystem can be configured with different governors that control its behavior. The available governors are listed in scaling_available_governors.

# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
conservative ondemand userspace powersave interactive performance

The current governor is shown in scaling_governor, and by default is set to the interactive governor.

Manual selection of a working CPU frequency
# echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
396000 792000 996000 1200000
# echo 792000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
792000

Suspend to memory

The Linux kernel can also perform a suspend to memory or suspend to RAM operation. When entering this low-power mode, the system state is kept in self-refreshing RAM while the system enters a low-power-consumption mode. The system resumes when a previously selected interrupt is received, restores the previous state, and continues running from where it left off. There is often a trade-off between the depth of the low-power mode and the speed at which the system can resume.

Entering suspend mode

To enter suspend mode, either:

Resume events

The system can resume from any interrupt generating event, including:

By default, the power key event will always be registered to resume a system from suspend. See Configuring wake up sources for additional details.

Power off

The Linux kernel can perform a power off operation that places the Power Management IC (PMIC) in power off mode, disabling all power sources that are not needed for wake up.

Entering power off

To enter power off mode you can do one of the following:

Wake up events

You can wake up the target from power off mode with an interrupt event to the PMIC, but not to the CPU as it will not be powered. These include:

The power key will always wake up the system.

Configuring wake up sources

GPIO resume

To program a GPIO N to generate a wake up interrupt when it changes status:

echo -n N > /sys/class/gpio/export
echo in > /sys/class/gpio/gpioN/direction
echo rising > /sys/class/gpio/gpioN/edge
echo enabled > /sys/class/gpio/gpioN/device/power/wakeup

RTC alarm resume

To enable the RTC wake alarm to trigger in 60 seconds:

echo enabled > /sys/class/rtc/rtc0/device/power/wakeup
echo +60 > /sys/class/rtc/rtc0/wakealarm

 

© 2017 Digi International Inc. All rights reserved.
Power management updated on 13 April 2017 10:31:16 PM