Power Modes
i.mx6 supports three different power save modes:
PM mode | Comment | Restrictions |
---|---|---|
freeze | also known as Suspend-to-Idle | Wake-on-LAN not supported, NXP Errata ERR006687 |
standby | switch IO-devices to low power mode, disable all but first CPU | Wake-on-LAN not supported, NXP Errata ERR006687 |
suspend | also known as Suspend-to-RAM (S3). This is the default power safe mode on conga-QMX6 |
|
Details on the different power save modes can be found on kernel documentation, e.g:
https://github.com/torvalds/linux/blob/v5.15/Documentation/admin-guide/pm/sleep-states.rst
Power Management IO on edge-connector or backplane
There are three buttons on the backplane which are related to the power management. Also a pin on Q7 edge connector is available to indicate the power save mode.
Button | i.mx6 GPIO | Type | Q7-pin | Q7-signal | comment |
---|---|---|---|---|---|
Power Button | GPIO3_29 | Input | 20 | PWRBTN# | external pullup on module plus external PWRBTN curcuit |
Suspend Button | GPIO4_7 | Input | 21 | SLP_BTN# | external pullup on module |
Lid Switch | GPIO4_66 | Input | 22 | LID_BTN# | external pullup on module |
SUS_S3 | GPIO1_5 | Output | 18 | SUS_S3# | external buffer / SUS_S3 curcuit, pulldown on Q7-pin |
All three buttons/switches are configured as wakeup source, so it is possible to wakeup from suspend either via suspend key or power key.
Switch to Power-Save mode
To freeze/suspend-to-idle
# echo freeze > /sys/power/state
To standby
# echo standby > /sys/power/state
To suspend/ suspend to RAM
# systemctl suspend
Remark:
do not enable suspend via power interface in sysfs, e.g. do not "echo mem > /sys/power/state
" and wakeup afterwards with power button!
Systemd handles the power button and after wakeup with power button and the system is shutting down immediately because systemd had no chance to realize the suspend (no hooks are processed via kernel api calls in sysfs) and handles the power button event as a power off signal.
Details on sysfs-interface: https://github.com/torvalds/linux/blob/v5.15/Documentation/ABI/testing/sysfs-power
Another possibility to enter suspend mode is to press the suspend button on backplane and release it.
Wakeup
Via backplane button
This works out of the box. Just switch to suspend mode and then press power button or suspend button
Via serial console
Afterwards press a button on keyboard in serial debug console to wakeup.
Via Wake-On-LAN
# ethtool -s eth0 wol g
# systemctl suspend
Then send from another computer in the same network the magic packet via:
# etherwake -i <ETH_INTERFACE> -D <MAC_ADDRESS_OF_CONGA_QMX6_MODULE>
Example:
Via Wake-On-USB
connect usb device and check via "
lsusb
" bus and identify it.
Enable wake from USB device:
# echo enabled > /sys/bus/platform/devices/2184200.usb/power/wakeup
# echo enabled > /sys/bus/platform/devices/20ca000.usbphy/power/wakeup
# echo enabled > /sys/bus/platform/devices/ci_hdrc.1/power/wakeup
# echo enabled > /sys/bus/usb/devices/1-1/power/wakeup
# echo enabled > /sys/bus/usb/devices/1-1.3/power/wakeup
The last two commands depend on the USB slot on which the wakeup source (i.e. mouse/keyboard) is connected. In the example above this is bus "1-1" and the device got "1-1.3". Watch syslog when connecting the device for details.
ATTENTION.
On QMX6 only USB #2 and #3 are powered in S3 and are able to support wake-on-usb. On QEVA backplane this ports are at CN7 (below the network connector).
3: Then enter suspend mode
# systemctl suspend
Check with keyboard / mouse button press