Wakeup from USB on i.MX6S

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Wakeup from USB on i.MX6S

2,691 Views
ralf2
Contributor II

I am new to this community, so HI EVERYONE :smileyhappy:.

I am working on an i.MX6S (Solo, without X or Lite) attached to a module attached to a carrier board. It's running Yocto 2.2.3.

I am trying to wake it up from one of the available standby states (freeze/mem/standby) by plugging in an USB Device.

To do so, I have tried to simply enable all available wakeup devices by executing

"for i in $(find /sys/devices/soc0/ -name wakeup);do echo enabled > $i;done", which should enable 

"find /sys/devices/soc0/ -name wakeup
/sys/devices/soc0/gpio-keys/power/wakeup
/sys/devices/soc0/soc/1ffc000.pcie/pci0000:00/0000:00:00.0/power/wakeup
/sys/devices/soc0/soc/2000000.aips-bus/20c9000.usbphy/power/wakeup
/sys/devices/soc0/soc/2000000.aips-bus/2000000.spba-bus/2020000.serial/tty/ttymxc0/power/wakeup
/sys/devices/soc0/soc/2000000.aips-bus/20ca000.usbphy/power/wakeup
/sys/devices/soc0/soc/2100000.aips-bus/21f4000.serial/tty/ttymxc4/power/wakeup
/sys/devices/soc0/soc/2100000.aips-bus/21ec000.serial/tty/ttymxc2/power/wakeup
/sys/devices/soc0/soc/2100000.aips-bus/21e8000.serial/tty/ttymxc1/power/wakeup
/sys/devices/soc0/soc/2100000.aips-bus/21f0000.serial/tty/ttymxc3/power/wakeup
/sys/devices/soc0/soc/2100000.aips-bus/2184200.usb/power/wakeup
/sys/devices/soc0/soc/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/power/wakeup
/sys/devices/soc0/soc/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/power/wakeup
/sys/devices/soc0/soc/2100000.aips-bus/2184200.usb/ci_hdrc.1/power/wakeup
/sys/devices/soc0/soc/2100000.aips-bus/2184000.usb/power/wakeup
/sys/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/power/wakeup" (first one has already been enabled by default, it's the board's wake button)

This is the method I've found in several documents** about wakeup on linux in general or, more specific, on Yocto on i.MX6.

But for some reason, it doesn't wake up from freeze or standby when I plug in/out an usb stick or keyboard or press a button on that keybard whose additional wakeup devices I've enabled previously (it adds some on connect).

For "mem" the behaviour is strange: As long as "/sys/devices/soc0/soc/2100000.aips-bus/2184200.usb/power/wakeup" is enabled, the board doesn't go asleep (for a noteworthy time). The LEDs just flicker and no "Suspended for *.* seconds" message is given. Also if no external usb devices are connected.

Wakeup_on_serial_Input on the other hand works as expected after "echo enabled > /sys/devices/soc0/soc/2000000.aips-bus/2000000.spba-bus/2020000.serial/tty/ttymxc0/power/wakeup", from freeze/mem/standby.

Do you have any idea what's my mistake or what is wrong and how I can make Wakeup_On_USB_Device_Plug_In work?

Best regards,

Ralf

** The most promising documents were https://community.nxp.com/thread/446856#comments including an i.MX Reference Manual and testing scripts for wake on usb that do the same as I do, and Wakeup from USB on mx6 — Linux USB , a technician of our board/module supplier sent to me. Both basically describe to echo-pipe "enabled" into the wakeup files of several devices.

Labels (2)
0 Kudos
Reply
2 Replies

1,723 Views
igorpadykov
NXP Employee
NXP Employee

Hi Ralf

please refer to sect.39.2.4 USB Wakeup Usage

atatched Linux Manual, use software described on

https://www.nxp.com/support/developer-resources/run-time-software/i.mx-developer-resources/i.mx-6ser...

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,723 Views
ralf2
Contributor II

Hi Igor,

I've tried this, for some reason it doesn't work on my board(s)

1st attempt (VBUS and ID only):

"echo enabled > /sys/bus/platform/devices/20c9000.usbphy/power/wakeup

echo enabled > /sys/bus/platform/devices/2184000.usb/power/wakeup

echo enabled > /sys/bus/platform/devices/ci_hdrc.0/power/wakeup

echo mem > /sys/power/state"

*plug in usb-keyboard* --> no reaction

power off, reboot

2nd attempt (remote and connect/disconnect wakeup only):

"echo enabled > /sys/bus/usb/devices/usb1/power/wakeup

echo enabled > /sys/bus/usb/devices/1-1/power/wakeup

echo mem > /sys/power/state"

*plug in usb-keyboard* --> no reaction

power off, reboot

3rd attempt (both):

"echo enabled > /sys/bus/platform/devices/20c9000.usbphy/power/wakeup

echo enabled > /sys/bus/platform/devices/2184000.usb/power/wakeup

echo enabled > /sys/bus/platform/devices/ci_hdrc.0/power/wakeup

echo enabled > /sys/bus/usb/devices/usb1/power/wakeup

echo enabled > /sys/bus/usb/devices/1-1/power/wakeup

echo mem > /sys/power/state"

*plug in usb-keyboard* --> no reaction

Best regards,

Ralf

0 Kudos
Reply