Generate USB device detach event

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Generate USB device detach event

1,099 次查看
falstaff
Senior Contributor I

Using U-Boot's USB Gadget stack for a USB client protocol implementation generates a proper USB disconnect on i.MX 6 devices, however, on i.MX 7 it does not generate a USB disconnect. This seem to cause issues on some hosts for subsequent USB reenumeration, hence I am trying to understand why i.MX 7 behaves differently.

As far as I understand the USB disconnect is generated by udc_disconnect in drivers/usb/gadget/ci_udc.c by writing a 0 to USBCMD RS field. According to the i.MX 6 and 7 Reference Manual this should cause a disconnect

Device operation mode:
Writing a one to this bit will cause the controller to enable a pull-up on D+ and initiate an attach event. This
control bit is not directly connected to the pull-up enable, as the pull-up will become disabled upon
transitioning into high-speed mode. Software should use this bit to prevent an attach event before the
controller has been properly initialized. Writing a 0 to this will cause a detach event.

It just seems that this does not work on i.MX 7... How can I properly cause a detach even on i.MX 7?

What I also noticed is that in the i.MX 7 Reference Manaul some register are described in the USB-PHY chapter 11.5, however, a register map for the USB PHY seems to be missing....

Best regards

Stefan

标记 (1)
0 项奖励
回复
2 回复数

883 次查看
CarlosCasillas
NXP Employee
NXP Employee

Hi Stefan,

Could you please specify which NXP boards and BSP are you using? Have you ensured that you are testing the same kind of USB port on both devices (Host only / OTG, with/without PHY).

Hope this will be useful for you.

Best regards!

/Carlos

0 项奖励
回复

883 次查看
falstaff
Senior Contributor I

This is on our Toradex Colibri iMX6/iMX7 boards. I can replicate the issue on GA 4.1.15_2..0.0 as well as on mainline, it is not really software related, since I can reproduce it when poking the register using U-Boot memory write (mw.l) commands directly.

I am especially wondering where the registers documented in i.MX 7 Reference Manaul in the USB-PHY chapter 11.5 actually are located...

0 项奖励
回复