AM37x Power Management User Guide

From Texas Instruments Wiki
Jump to: navigation, search

Content is no longer maintained and is being kept for reference only!

Return to the Sitara Linux Software Developer's Guide



This article provides a description of the example applications under the Power page of the Matrix application that comes with the Sitara SDK.  This page is labled "Power" in the top-level Matrix GUI. The location of the Power icon on the main Matrix app list may be different than shown here, depending on screen size. Screen shot is from SDK 06.00.


Power Examples

Several power examples exist to provide users the ability to dynamically switch the CPU clock frequency. The frequencies shown are those available for your system. Upon making a selection, you will be presented a confirmation page. The readout number "BogoMIPS" will confirm the new clock frequency. Please note that the frequency will read out with a slight margin compare to the intended frequency. For example, if you select 1GHz, you may see a number like 998.84 (in MHz). This is normal. After reviewing the confirmation page, press the Close button to return to normal Matrix operation.

Other power examples are provided which may be useful for power management developers and power users. These have been included in Matrix in part to make users aware that these valuable debugging tools exist, in addition to the convenience of executing each application from the GUI. In depth descriptions for each application follow. Similar descriptions are also given via description pages in Matrix, which will be displayed when clicking the button. Where appropriate, the documentation will point out the corresponding command line operation.

The Suspend/Resume button demonstrates the ability to put the machine into a suspended state. See below for complete documentation of this feature.

Please note that the order of applications which appear on your screen may differ from the picture below, due to devices with different screen sizes, and differences between different versions of Matrix. Screen shot is from SDK 06.00.


PRCM Snapshot (post-resume)

 (command line equivalent) 
mount -t debugfs debugfs /debug
cat /debug/pm_debug/registers/2 

This program allows the user a simple method to quickly display a snapshot of the state of the PRCM registers that was taken just after resume. Used to debug suspend/resume problems.

PRCM Register Dump

 (command line equivalent) 
mount -t debugfs debugfs /debug
cat /debug/pm_debug/registers/current 

This program allows the user a simple method to quickly display the current state of the the PRCM registers via an exhaustive dump.

Set Frequency

This command opens up another screen from which you choose the frequency based on the available frequencies on the board. Here is a picture of the screen you will see (screen shot is from SDK 06.00.):


The following are the Linux command line equivalents for selecting the operating frequency. Please note that changing the frequency also changes the MPU voltage accordingly. The commands are part of the "cpufreq" kernel interface for selecting the OPP (operating performance point). Cpufreq provides an opportunity to save power by adjusting/scaling voltage and frequency based on the current cpu load.

 (command line equivalent)
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
(view options, select one for next step)
echo <selected frequency, in KHz> > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
cat /proc/cpuinfo 

PRCM Snapshot (pre-suspend)

 (command line equivalent) 
mount -t debugfs debugfs /debug
cat /debug/pm_debug/registers/1 

This program allows the user a simple method to quickly display a snapshot of the state of the PRCM registers that was taken just prior to suspend. The snapshot is taken before the jump occurs into SRAM idle code. Used to debug suspend/resume problems.

Power Stats and Active Clocks

 (command line equivalent) 
mount -t debugfs debugfs /debug
cat /debug/pm_debug/count 

The first set of information that is displayed in the dump gives the state statistics for each power domain. Each power domain state is shown with an associated off-mode counter in parenthesis. The RET_LOGIC_OFF counter refers to the logic off counter, and the RET_MEMBANKN_OFF counter refers to the per-bank memory off counter.
Following that, each of the clock domain active clocks is displayed along with the associated use count. The use count refers to the number of enabled downstream clocks from this clock domain. Once the count reaches 0, the clock domain can be put to sleep.


 (command line equivalent)
mkdir /debug
mount -t debugfs debugfs /debug
echo 1 > /debug/pm_debug/sleep_while_idle
echo 1 > /debug/pm_debug/enable_off_mode
echo mem > /sys/power/state 

This program will put the platform into suspend mode.

Sleep_while_idle enables the kernel to attempt to reach the retention or off state while idle. Enable_off_mode enables the kernel to transition to off mode (deeper sleep state than retention). The final command initiates the suspend.
IMPORTANT NOTE: When running this from Matrix, the system will only properly resume if the user sends a keypress to the UART. If the user presses the touchscreen or a button on the EVM, resume will not complete normally. This issue will be fixed in a future release. If you run these commands from the terminal - all of the normal wakeup events (UART keypress, touchscreen press, EVM keypad press) will operate correctly.


SmartReflex is an active power management technique which optimizes voltage based on silicon process ("hot" vs. "cold" silicon), temperature, and silicon degradation effects. In most cases, SmartReflex provides significant power savings by lowering operating voltage.

On AM37x, SmartReflex is generally disabled by default. To enable SmartReflex, type the following commands at the target terminal:

mkdir /debug
mount -t debugfs debugfs /debug
cd /debug/voltage/vdd_core/smartreflex
echo 1 > autocomp
cd /debug/voltage/vdd_mpu/smartreflex
echo 1 > autocomp
(Note the "echo 0 > autocomp" would be used to disable SmartReflex)

On AM37x, to compile SmartReflex support out of the kernel, follow this procedure to modify the kernel configuration:

cd <kernel source directory>
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
<the menuconfig interface should appear>
Select "System Type"
Select "TI OMAP Common Features"
Deselect "SmartReflex Support"
Select "Exit" until you are prompted to save the configuration changes, and save them.
Rebuild the kernel.

Power Management Reference

(AM/DM37x) Refer to this page for discussion of cpuidle framework architecture, C-states, Dynamic Tick Suppression, Suspend/Resume, Linux kernel configuration for PM, idle state transition, cpufreq, and SmartReflex.

(AM/DM37x) This page builds upon the previous page, and adds VDD1 measurements performed against certain identified scenarios.

Discusses how to reach the lowest possible power, including measured results on AM37X for comparison purposes.

Advanced information on power consumption modeling, featuring a downloadable spreadsheet.