Suspend to ram and wakeup by console input?


I’m using ConnectCore i.mx8qxp board, I’d like to test the suspend-to-ram functions as mentioned here:

I followed the instructions as in the document above:

/* Set the wakeup alarm for 30s */
# echo +30 > /sys/class/rtc/rtc0/wakealarm
/* Suspend system to RAM */
# echo -n mem > /sys/power/state

and also rtcwake -d /dev/rtc0 -s 30 -m mem.

It seems that the suspend is working fine. (I run ping cmd at the same time and I saw it disconnected).

Now I’d like to test the wake-up from console input.
I am connecting the PC to imx8qxp’s debug port, which displays as “ttyLP2” during boot.

Is there a way to config ttyLP2 as a wakeup input?

From some other website, there is an instruction like this:

echo enabled > /sys/devices/platform/imx-uart.0/tty/ttymxc0/power/wakeup echo mem > /sys/power/state

but in my imx8qxp, I didn’t find /sys/devices/platform/imx-uart.0, maybe in a different path or name?


please see:

Wake from suspend
To allow an MCA UART to resume the system from suspend when a character is received (and not lose data), run the following command:

~# echo enabled > /sys/class/tty/ttyMCAx/power/wakeup
where x is the UART index, starting at 0.

An application must be reading from the device or the system will not wake up when a character is received.