Wake up from suspend using USB device on iMX8MM

After suspend to mem, wakeup from USB Keyboard is not working on iMX8MM.

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.6.94-7.3.0-devel #1 SMP PREEMPT Wed Jun 25 09:14:55 UTC 2025
Kernel command line:      root=PARTUUID=9420bafe-02 ro rootwait console=tty1 console=ttymxc0,115200
Distro name:              NAME="TDX Wayland with XWayland"
Distro version:           VERSION_ID=7.3.0-devel-20250708053505-build.0
Distro variant:           -
Hostname:                 verdin-imx8mm-14838650
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Mini WB on Verdin Development Board
Toradex version:          0055 V1.1E
Serial number:            14838650
Processor arch:           aarch64
------------------------------------------------------------

The available usb and enabled wakeup source (usb keyboard):


root@verdin-imx8mm-14838650:/sys/class/wakeup# ls -lha
...
lrwxrwxrwx    1 root     root           0 May 29 19:23 wakeup5 -> ../../devices/platform/soc@0/32c00000.bus/32e50000.usb/ci_hdrc.1/usb1/1-1/1-1.1/wakeup/wakeup5
...

root@verdin-imx8mm-14838650:/sys/class/wakeup# cat wakeup5/device/power/wakeup
enabled

If I do a echo mem > /sys/power/state the system goes to suspend:

root@verdin-imx8mm-14838650:~# echo mem > /sys/power/state
[  175.432865] PM: suspend entry (deep)
[  175.448278] Filesystems sync: 0.006 seconds
[  175.459969] Freezing user space processes
[  175.468898] Freezing user space processes completed (elapsed 0.001 seconds)
[  175.478774] OOM killer disabled.
[  175.485777] Freezing remaining freezable tasks
[  175.495282] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[  175.505556] printk: Suspending console(s) (use no_console_suspend to debug)

Wake up on USB from suspend doesn’t work now, what’s the problem ?

Try to do some additional steps like:

echo enabled > /sys/bus/usb/devices/1-1/power/wakeup
echo enabled > /sys/bus/platform/devices/32e50000.usb/power/wakeup
echo enabled > /sys/bus/platform/devices/ci_hdrc.1/power/wakeup

But it doesn’t help.

Do any changes need to be made in the device tree ?

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


Hello! Thank you for sharing such detailed information about your Verdin iMX8M Mini setup and the troubleshooting steps you’ve already attempted.

Understanding the Issue

On the Verdin iMX8MM, wake-up from USB (for example, with a keyboard) after suspend-to-mem (deep sleep) often depends on a combination of:

  • Device tree configuration—does the hardware controller support wakeup, and is this defined in the device tree?
  • Driver support—does the Linux kernel USB host driver (CI_HDRC/EHCI/XHCI) have wake-up support?
  • Power supply—is USB power maintained during suspend? (Carrier board design may affect this, but as per guidelines, I’ll focus on software.)

You’ve already:

  • Enabled the relevant wakeup sources in userspace (checked /sys and set to enabled).
  • Observed that wakeup via keyboard is still not working.

Device Tree Considerations

It is likely you need to adapt your device tree, as by default, wakeup may not be enabled for the USB host controller. The “wakeup-source” property in device tree influences whether the kernel marks a device as capable of waking up the system(1)(4).

Steps to Customize Device Tree

  1. Identify the USB Host Node

    For the iMX8MM, the USB host nodes are typically named something like usb@32e50000 (where 32e50000 matches the address you observed).

  2. Add wakeup-source Property

    In your custom device tree source file, find the node (usually under &usbh1, &usbh2, etc.) and add:

    wakeup-source;
    

    Example:

    &usbh1 {
        wakeup-source;
        status = "okay";
    };
    

    If the USB host declaration uses a full node block (usb@32e50000), add the property inside there.

  3. Rebuild and Deploy Device Tree

  4. Reboot with Your Custom DTB

    Make sure your new device tree blob file (DTB) is loaded at boot (adjust U-Boot variable if needed).

Additional kernel and system tips

  • You may need to pass no_console_suspend to the kernel for debugging (if you want to see logs during suspend).
  • Not all USB devices will necessarily trigger wakeup. It typically needs to be a low-speed device like a keyboard, and your board must supply VBUS in suspend.

Summary

Yes, you likely need to add or enable the wakeup-source property on the USB host nodes in your device tree.
Links to help you with device tree changes and general process:

If after this change USB wakeup is still not working, further debugging the power state of the USB host and keyboard during suspend may be required. Let me know if you need step-by-step on building or deploying the device tree!

Best regards,
Toradex AI Assistant.

Add wakeup-source; to imx8mm-verdin.dtsi#L766

/* Verdin USB_2 */
&usbotg2 {
	dr_mode = "host";
    wakeup-source;
	samsung,picophy-dc-vol-level-adjust = <7>;
	samsung,picophy-pre-emp-curr-control = <3>;
	vbus-supply = <&reg_usb_otg2_vbus>;
};

This doesn’t resolve the problem.

Try also add wakeup-source to imx8mm-verdin-dev.dtsi#L158

/* Verdin USB_2 */
&usbotg2 {
	disable-over-current;
        wakeup-source;
	status = "okay";
};

same as above doesn’t resolve the problem.

Hello @agerf,

Sorry for the delay here.

I will look into this topic and get back to you with more information.

Best Regards,
Bruno

1 Like

Hello @agerf,

I could confirm the behavior that you are seeing.
It looks like it may be related to the lack of the CONFIG_PM_WAKELOCKS config.
Can you try to enable this config and see if the wakeup works?

Best Regards,
Bruno

I’ll try it out and get back to you.

1 Like

Problem resolved the usbphynop/wakeup must also be set to enabled:
echo enabled > /sys/devices/platform/usbphynop1/power/wakeup
echo enabled > /sys/devices/platform/usbphynop2/power/wakeup

echo enabled > /sys/devices/platform/soc@0/32c00000.bus/32e40000.usb/power/wakeup
echo enabled > /sys/devices/platform/soc@0/32c00000.bus/32e40000.usb/ci_hdrc.0/power/wakeup
echo enabled > /sys/devices/platform/soc@0/32c00000.bus/32e50000.usb/power/wakeup
echo enabled > /sys/devices/platform/soc@0/32c00000.bus/32e50000.usb/ci_hdrc.1/usb1/power/wakeup
echo enabled > /sys/devices/platform/soc@0/32c00000.bus/32e50000.usb/ci_hdrc.1/usb1/1-1/power/wakeup
echo enabled > /sys/devices/platform/soc@0/32c00000.bus/32e50000.usb/ci_hdrc.1/usb1/1-1/1-1.1/power/wakeup
echo enabled > /sys/devices/platform/soc@0/32c00000.bus/32e50000.usb/ci_hdrc.1/power/wakeup

1 Like

Hello @agerf,

Thanks for the update and for sending the solution here.

Best Regards,
Bruno