IM8XMM USB resume issue

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

IM8XMM USB resume issue

310 Views
massimo_toscanelli
Contributor I

Hello,

I have issues with the USB2.0 Dual Role on the USB1 of an IMX8MM running mainline Linux Kernel v5.15.

The role switch works fine when I connect a USB stick or a PC to the device. When I disconnect the cable, the device switches to “device mode”, in case it was connected to the USB stick, or it just detects a VBUS change, if it was instead connected to the PC, being already in “device mode”.

The switch from “host mode” (USB stick connected) to “device mode” when the cable is disconnected is understandable, because the USB_ID is pulled-up, like suggested here: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX8MM-i-MX8MQ-USB2-0-Design-Without-US....

However, when the cable is unplugged, the device continuously receives wake-up interrupts from the USB_ID every time it tries to suspend the controller, causing an infinite loop of suspend-resume.

The driver enables the WKUP_VBUS_EN and WKUP_ID_EN bits of the CTRL1 register before suspending the controller, so I tried to fix the issue disabling the WKUP_ID_EN.

In this way there are no suspend-resume loops, but I cannot resume the controller anymore plugging the cable. I don’t understand why this can happen, because the DP/DM lines are also enabled as interrupts when I check the WKUP_DPDM_EN bit.

Do you know what could be the cause and what could be missing to detect the attach event?

I would like to check if the suspend procedure of the driver is correctly followed as explained in the reference manual, but USBPHY_PWD register and USBPHY_CTRL.CLKGATE bit are not present in the document. Reading discussion https://community.nxp.com/t5/Vybrid-Processors/USB-suspend-resume-issue-on-Vybrid/m-p/445657 they seem to be quite important for the Vybrid processor and I thought they could be so for the IMX8 as well.

Is there an error or some parts missing in the reference manual?

Thank you.

Labels (2)
0 Kudos
Reply
0 Replies