Power management: Difference between revisions
mNo edit summary |
(→Links) |
||
(17 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
==APF9328== | |||
===APF9328 alone=== | |||
Power consumption measurements have been done on an APF9328 board. | Power consumption measurements have been done on an APF9328 board. | ||
The results are available in the [[APF9328]] datasheet. | The results are available in the [[APF9328]] datasheet. | ||
<br> | |||
===APF9328 connected to a DevLight board=== | |||
{| border="1" cellpadding="5" cellspacing="0" summary="How to reduce chips power consumption" | |||
|- style="background:#efefef;" | |||
! '''Functionnality''' || ''' power needed @ 5V''' || '''how to reduce it''' | |||
|---------------- | |||
| FPGA || xxxmA || don't configure it | |||
|---------------- | |||
| Ethernet || || ifconfig eth0 down | |||
|---------------- | |||
| i.MXL (proc + SDRAM + Flash) || || | |||
|---------------- | |||
| LCD || || | |||
|---------------- | |||
| || || | |||
|---------------- | |||
|} | |||
==APF27/APF28/APF51== | |||
===Linux configuration=== | |||
{{Note| now done by default in latest apf kernel configs}} | |||
<pre class="config"> | |||
[*] Power management options ---> | |||
[*] Power Management support | |||
[*] Power Management Debug Support | |||
[*] Verbose Power Management debugging | |||
[*] Suspend to RAM and standby | |||
[ ] Test suspend/resume and wakealarm during bootup | |||
< > Advanced Power Management Emulation | |||
[ ] Use D14 LED of the APF27Dev for suspend signaling | |||
[ ] Use S1 switch of the APF27Dev to resume after a suspend | |||
</pre> | |||
For the apf27, power management handling is done in ''arch/arm/mach-mx2/pm_imx27.c'' | |||
* if you put the APF27 in suspend mode, it could be interesting to be able to wake it with the "User button": | |||
<pre class="host"> | |||
$ make linux-menuconfig | |||
</pre> | |||
<pre class="config"> | |||
[*] Power management options ---> | |||
[*] Power Management support | |||
[*] Power Management Debug Support | |||
[*] Verbose Power Management debugging | |||
[*] Suspend to RAM and standby | |||
[ ] Test suspend/resume and wakealarm during bootup | |||
< > Advanced Power Management Emulation | |||
[ ] Use D14 LED of the APF27Dev for suspend signaling | |||
[*] Use S1 switch of the APF27Dev to resume after a suspend | |||
</pre> | |||
* if you put the [[APF28]] in suspend mode, you can use the power button to wake up the board. | |||
===To know if driver is launched=== | |||
<pre class="apf"> | |||
# dmesg | grep Power | |||
Power Management for Freescale i.MX2x | |||
</pre> | |||
==Ethernet== | |||
for the [[APF27]] the ''fec_old'' driver currently do not implement CONFIG_PM stuff... | |||
===Power-up=== | |||
<pre class="apf"> | |||
# ifconfig eth0 up | |||
</pre> | |||
===Power-down=== | |||
<pre class="apf"> | |||
# ifconfig eth0 down -->> ~ -400 mW | |||
</pre> | |||
==Other devices== | |||
Should comply to suspend/resume device drive mechanism. | |||
===List available suspend modes=== | |||
<pre class="apf"> | |||
# cat /sys/power/state | |||
standby mem | |||
</pre> | |||
===Enter standby mode (i.MX in Doze mode)=== | |||
<pre class="apf"> | |||
# echo standby > /sys/power/state | |||
PM: Syncing filesystems ... done. | |||
PM: Preparing system for standby sleep | |||
Freezing user space processes ... (elapsed 0.00 seconds) done. | |||
Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done. | |||
PM: Entering standby sleep | |||
Suspending console(s) (use no_console_suspend to debug) | |||
imx-uart imx-uart.0: preparing suspend | |||
imx-uart imx-uart.2: preparing suspend | |||
mxc_nand mxc_nand.0: preparing suspend | |||
... | |||
</pre> | |||
===Enter suspend to memory mode (i.MX in Sleep mode)=== | |||
<pre class="apf"> | |||
# echo mem > /sys/power/state | |||
</pre> | |||
only an external interrupt can now wake up the i.MX27 | |||
{{Warning| The mode 'mem' is not implemented in the kernel 2.6.35 for the [[APF28]]. please use the 'standby' mode}} | |||
Only few interrupts can wake up the i.MX51 from this mode. please check the mx51 reference manual for further information. | |||
===Wake up the board from sleep mode=== | |||
* For the [[APF28]] you can use the power button, any active interrupt or the RTC. | |||
* For the [[APF27]] you will have to use an external interrupt. | |||
* For the [[APF51]] the RTC or an external interrupt can wake up the board. | |||
===Debugging suspend/resume=== | |||
* pass '''no_console_suspend''' as boot parameter: | |||
<pre class="apf"> | |||
BIOS> setenv extrabootargs no_console_suspend | |||
BIOS> boot | |||
</pre> | |||
== Known problems == | |||
* [[APF27]] USB: usb cause system warning : | |||
<pre class="apf"> | |||
# echo standby > /sys/power/state | |||
PM: Syncing filesystems ... done. | |||
Freezing user space processes ... (elapsed 0.01 seconds) done. | |||
Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done. | |||
___ apf27_pm_suspend | |||
___ apf27_pm_resume | |||
------------[ cut here ]------------ | |||
WARNING: at kernel/hrtimer.c:625 hres_timers_resume+0x3c/0x60() | |||
hres_timers_resume() called with IRQs enabled!Modules linked in: gpio | |||
[<c002c0d8>] (dump_stack+0x0/0x14) from [<c003c148>] (warn_slowpath+0x70/0x8c) | |||
[<c003c0d8>] (warn_slowpath+0x0/0x8c) from [<c0055dfc>] (hres_timers_resume+0x3c/0x60) | |||
</pre> | |||
==Suspend to disk== | |||
Another solution to spare energy, if your board has an ON/OFF functionality, would be to activate suspend to disk mode. In this mode all currently used memory is copied by the Linux kernel to a swap partition (preferably on a eMMC). Consumption in this mode is like in OFF mode and boot-up is then faster that normal power-down/up sequence. | |||
Prerequisites are: | |||
* a lot of RAM (at least double of maximum used as time of suspend launch) | |||
* a storage device big/resilient enough to have a swap partition | |||
===Swap partition=== | |||
* Create a spare partition on your SOM with fdisk and set it to type 0x82 (SWAP) | |||
<pre class="apf"> | |||
# ... | |||
</pre> | |||
* Format this partition as swap | |||
<pre class="apf"> | |||
# ... | |||
</pre> | |||
==Links== | |||
* [[Linux_Dynamic_Frequency_Scaling| Another good way of decreasing mA is to use frequency scaling]] | |||
* [http://www.linuxjournal.com/article/6699 Power Management in Linux-Based Systems (Linux Journal)] | |||
* [http://wiki.davincidsp.com/index.php?title=Startup_shutdown_and_power_management BlackFin way of doing] | |||
[[Category:Power Management]] |
Latest revision as of 19:43, 10 December 2024
APF9328
APF9328 alone
Power consumption measurements have been done on an APF9328 board.
The results are available in the APF9328 datasheet.
APF9328 connected to a DevLight board
Functionnality | power needed @ 5V | how to reduce it |
---|---|---|
FPGA | xxxmA | don't configure it |
Ethernet | ifconfig eth0 down | |
i.MXL (proc + SDRAM + Flash) | ||
LCD | ||
APF27/APF28/APF51
Linux configuration
[*] Power management options ---> [*] Power Management support [*] Power Management Debug Support [*] Verbose Power Management debugging [*] Suspend to RAM and standby [ ] Test suspend/resume and wakealarm during bootup < > Advanced Power Management Emulation [ ] Use D14 LED of the APF27Dev for suspend signaling [ ] Use S1 switch of the APF27Dev to resume after a suspend
For the apf27, power management handling is done in arch/arm/mach-mx2/pm_imx27.c
- if you put the APF27 in suspend mode, it could be interesting to be able to wake it with the "User button":
$ make linux-menuconfig
[*] Power management options ---> [*] Power Management support [*] Power Management Debug Support [*] Verbose Power Management debugging [*] Suspend to RAM and standby [ ] Test suspend/resume and wakealarm during bootup < > Advanced Power Management Emulation [ ] Use D14 LED of the APF27Dev for suspend signaling [*] Use S1 switch of the APF27Dev to resume after a suspend
- if you put the APF28 in suspend mode, you can use the power button to wake up the board.
To know if driver is launched
# dmesg | grep Power Power Management for Freescale i.MX2x
Ethernet
for the APF27 the fec_old driver currently do not implement CONFIG_PM stuff...
Power-up
# ifconfig eth0 up
Power-down
# ifconfig eth0 down -->> ~ -400 mW
Other devices
Should comply to suspend/resume device drive mechanism.
List available suspend modes
# cat /sys/power/state standby mem
Enter standby mode (i.MX in Doze mode)
# echo standby > /sys/power/state PM: Syncing filesystems ... done. PM: Preparing system for standby sleep Freezing user space processes ... (elapsed 0.00 seconds) done. Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done. PM: Entering standby sleep Suspending console(s) (use no_console_suspend to debug) imx-uart imx-uart.0: preparing suspend imx-uart imx-uart.2: preparing suspend mxc_nand mxc_nand.0: preparing suspend ...
Enter suspend to memory mode (i.MX in Sleep mode)
# echo mem > /sys/power/state
only an external interrupt can now wake up the i.MX27
![]() |
Warning: The mode 'mem' is not implemented in the kernel 2.6.35 for the APF28. please use the 'standby' mode |
Only few interrupts can wake up the i.MX51 from this mode. please check the mx51 reference manual for further information.
Wake up the board from sleep mode
- For the APF28 you can use the power button, any active interrupt or the RTC.
- For the APF27 you will have to use an external interrupt.
- For the APF51 the RTC or an external interrupt can wake up the board.
Debugging suspend/resume
- pass no_console_suspend as boot parameter:
BIOS> setenv extrabootargs no_console_suspend BIOS> boot
Known problems
- APF27 USB: usb cause system warning :
# echo standby > /sys/power/state PM: Syncing filesystems ... done. Freezing user space processes ... (elapsed 0.01 seconds) done. Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done. ___ apf27_pm_suspend ___ apf27_pm_resume ------------[ cut here ]------------ WARNING: at kernel/hrtimer.c:625 hres_timers_resume+0x3c/0x60() hres_timers_resume() called with IRQs enabled!Modules linked in: gpio [<c002c0d8>] (dump_stack+0x0/0x14) from [<c003c148>] (warn_slowpath+0x70/0x8c) [<c003c0d8>] (warn_slowpath+0x0/0x8c) from [<c0055dfc>] (hres_timers_resume+0x3c/0x60)
Suspend to disk
Another solution to spare energy, if your board has an ON/OFF functionality, would be to activate suspend to disk mode. In this mode all currently used memory is copied by the Linux kernel to a swap partition (preferably on a eMMC). Consumption in this mode is like in OFF mode and boot-up is then faster that normal power-down/up sequence.
Prerequisites are:
- a lot of RAM (at least double of maximum used as time of suspend launch)
- a storage device big/resilient enough to have a swap partition
Swap partition
- Create a spare partition on your SOM with fdisk and set it to type 0x82 (SWAP)
# ...
- Format this partition as swap
# ...