NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
Startup shutdown and power management
For an embedded system like a DaVinci based system, proper and fast system startup and shutdown is more important than for an standard desktop PC based system. Same for power management. For most of these standard Linux mechanisms or at least special embedded techniques can be used. Most of them are not DaVinci specific. So this article will mainly list general resources regarding system startup, shutdown and power management usable on DaVinci based systems as well.
Contents
Startup time[edit]
- Boot Time Optimization
- Bootup Time Resources of CE Linux Forum
- Parallelize applications for faster Linux booting
- Methods to Improve Bootup Time in Linux
- Suspend to disk for ARM, see as well Linux Symposium 2006 Proceedings, Volume 2, Improving Linux Startup Time Using Software Resume (and other techniques), by Hiroki Kaminaga, page 17ff.
General optimization[edit]
DaVinci DSP turn on example[edit]
CCS gel file example how to turn on DSP posted to mailing list.
DaVinci ARM Linux power management[edit]
For DaVinci ARM git kernel power management support is currently not part of the kernel, but a patch is available.
Power management patch[edit]
- Git kernel power management support
- To fix an issue in audio driver at standby wakeup, you additionally want to apply a audio driver patch
Kernel options[edit]
Once applied above patches, enable power management in kernel:
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
At kernel startup you then should get
... Power Management for DaVinci initializing ...
in boot message output.
Features[edit]
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. The "normal" ARM idle ("mpu idle") is on by default. The sleep mode (standby) is entered only on request. You need a proper wake up source configured. For testing, the patch assumes used on a system without any network traffic (e.g. no NFS), so it can use network (EMAC) as wake source.
Usage[edit]
The two DaVinci power management modes can be controlled and observed by the /sys/power interface. You can get the supported power management states by reading /sys/power/state:
# cat /sys/power/state standby #
ARM idle[edit]
ARM idle mode is on by default, you don't have to configure anything. How often it is entered you can observe by reading /sys/power/count_idle:
# cat /sys/power/count_idle 18788 #
Standby[edit]
Standby mode is only entered on request. If using above power management patch, make sure
- You can use ethernet as wake up source, so nothing else uses it (e.g. no NFS) while standby is entered.
- If sound driver is enabled (configured and compiled into kernel) make sure you apply above audio patch to be able to wake from standby.
You can observe standby count by reading /sys/power/count_standby and entering standby by writing string standby to /sys/power/state:
# 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 #
Note: Regarding /sys/power interface of Linux kernel see kernel documentation.
ToDo[edit]
The power management functionality (patch) described here provides the basic power management functionality for DaVinci. Regarding save as much power as possible it isn't perfect. Additional features/code can be added to save even more power and make it more robust. This is:
- Power saving: In standby, we can save more power using PSC and switch off/on all unneeded peripherals
- Power saving: In standby, we can save more power gating input clocks of memory controller. See SPRUE22C, section 2.15
- Robustness: Before going to standby, check for still running DMAs