Add basic power management support for DaVinci.

Changes in v1:

- Remove non-standard sleep_while_idle and switch to standard Linux standby logic [1]

Functionality:

It support two modes: Normal ARM idle (WaitForInterrupt, WFI) waking at every (timer etc.) interrupt and deeper sleep (suspend/standby) with SDRAM switched to self refresh waking only on selected (wake) interrupts.

Usage & testing:

The "normal" ARM idle ("mpu idle") is on by default. You can observe idle count using

# cat /sys/power/count_idle

You will see that it permanently counts up, showing that this state is entered quite often.

The sleep mode (standby) is entered only on request. You need a proper wake up source configured. For testing, I use a system without any network traffic, so I can use network (EMAC) as wake source. You can switch to standby with standard Linux power management command "echo standby > /sys/power/state" and observe standby count:

# cat /sys/power/count_standby
0
# echo standby > /sys/power/state
Stopping tasks ...done.
Suspending console(s)

-> System is at standby now, you are *not* able to enter anything. All interrupts except EMAC are switched off! On host PC do something with
network, e.g. ping target. Then system wakes up:

aic23 powering down
aic23 powering up
aic23_init_power() done
Restarting tasks ... done.
#
# cat /sys/power/count_standby
1
#

Above functionality is tested on DM6446 DVEVM.

Kernel config:

CONFIG_PM=y
# CONFIG_PM_LEGACY is not set
# CONFIG_PM_DEBUG is not set
CONFIG_PM_SLEEP=y
CONFIG_SUSPEND_UP_POSSIBLE=y
CONFIG_SUSPEND=y

Shortcomings:

Resume of DaVinci sound driver is broken. Make sure you *disable* sound while using this patch, else system oopses (silently cause console is off) while resume from standby and never returns.

ToDo:

- Before going to standby, check for still running DMAs
- In standby, we can save more power using PSC
- In standby, we can save more power gating input clocks of memory controller, see SPRUE22C, section 2.15
- Measure power consumption ;)
- Fix sound driver (??)

This patch replaces initial version [2].

Regards

Dirk

[1] http://source.mvista.com/git/?p=linux-davinci-2.6.git;a=blob_plain;f=Documentation/power/states.txt;hb=HEAD

[2] http://linux.omap.com/pipermail/davinci-linux-open-source/2007-December/004770.html

_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to