OMAP Power Management

PM branch
The PM branch is a developement branch of the linux-omap kernel for the purposes of developing and stabilizing the PM infrastructure for OMAP and submitting it upstream.

The maintainer of the PM branch is Kevin Hilman.

Features

 * full-chip retention in idle and suspend
 * full-chip OFF in idle and suspend
 * CPUidle
 * DVFS using CPUfreq
 * support for multiple OMAP3 boards

The latest, tested PM branch is available as a branch named 'pm' from the linux-omap-pm repository. This branch is also sync'd daily as the 'pm' branch of the main linux-omap repository.

Significant changes since previous version

 * rebased to omap/master (currently v2.6.31-rc5)
 * Using new omap_hwmod and omap_device infrastructure from Paul Walmsley
 * more reorg into groups of commits for easier submission upstream

Tested on the following platforms using omap3_pm_defconfig with busybox-based initramfs, and tested full-chip RET and OFF in idle and suspend:


 * 3430SDP
 * OMAP3EVM
 * Beagle
 * Overo (Water + Tobi)
 * RX51
 * Zoom2 (use 'pm-staging/zoom2' branch as well, which is the 'zoom2' branch of Vikram's omap3 repo rebased on top of PM branch with DEBUG_LL support and misc. fixes)

Known Problems

 * network drivers and off-mode
 * various hangs when using off-while-idle and NFS-mounted rootfs
 * network drivers likely need some context save/restore support
 * 3430SDP ES3.0
 * UART1 doesn't come back from off-while-idle (ok on es3.1 SDP)

Debug Features
First, mount the debug filesystem (debugfs)


 * 1) mount -t debugfs debugfs /debug

Show powerdomain state statistics and clockdomain active clocks


 * 1) cat /debug/pm_debug/count

Dump current PRCM registers


 * 1) cat /debug/pm_debug/registers/0

Dump PRCM registers at last suspend


 * 1) cat /debug/pm_debug/registers/1

Features
By default, the OMAP is configured to hit full-chip retention in suspend.

Trigger full suspend

 * 1) echo mem > /sys/power/state

Serial console activity or other configured wakeup sources (keypad, touchscreen) will trigger resume.

Upon resume, you can use the powerdomain state statistics to check whether all states hit the desired state.


 * 1) cat /debug/pm_debug/count

In addition, if any powerdomains did not hit the desired state, you will see a message on the console.

Enabling system for hitting retention during idle
By default, the kernel will not try to hit retention or off while idle. To enable idle path to attempt deeper sleep states:


 * 1) echo 1 > /sys/power/sleep_while_idle

Then, wait for any inactivity timers to expire (such as the 5 second UART timer) and check the powerdomain transition statistics to see that transitions are happening

# cat /debug/pm_debug/count

Enabling system for hitting OFF
By default, only retention is the deepest sleep state attempted. To enable powerdomain transitions to off mode


 * 1) echo 1 > /sys/power/enable_off_mode

In addition, to enable VDD1 and VDD2 to hit 0V


 * 1) echo 1 > /sys/power/voltage_off_while_idle

Once again, after a suspend or after some idle time, use the powerdomain transition stats to check that transitions to off-mode are happening

# cat /debug/pm_debug/count

DVFS: Dynamic Voltage and Frequency Scaling
By default, no DVFS transitions will occur because the CPUfreq 'userspace' governor is the default governor. This means that any DVFS transitions must be manually triggered by a userspace application, or by using the CPUfreq sysfs interface.

OnDemand governor
The OnDemand governor enables DVFS transitions based on CPU load. To enable:


 * 1) echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Misc. options (needs editing/cleanup)
Request an OPP (where = [1|2|3|4|5])


 * 1) echo > /sys/power/vdd1_opp
 * 2) echo > /sys/power/vdd2_opp

Show the current OPPs


 * 1) cat /sys/power/vdd1_opp
 * 2) cat /sys/power/vdd2_opp

Lock at given OPP


 * 1) echo > /sys/power/vdd1_lock
 * 2) echo > /sys/power/vdd2_lock

Enables SmartReflex autocompensation on VDD1 (Note: This feature can only be tested on a ES3.1 silicon) Disables SmartReflex? autocompensation on VDD1
 * 1) echo 1 > /sys/power/sr_vdd1_autocomp
 * 1) echo 0 > /sys/power/sr_vdd1_autocomp

Enables SmartReflex autocompensation on VDD2 (Note: This feature can only be tested on a ES3.1 silicon) Disables SmartReflex? autocompensation on VDD2
 * 1) echo 1 > /sys/power/sr_vdd2_autocomp
 * 1) echo 0 > /sys/power/sr_vdd2_autocomp