mx53 otg usb hot plug

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

mx53 otg usb hot plug

2,982 Views
Maddis
Contributor IV

Hi,


I have mx53 based hw running Linux (2.6.35.3) and usb otg port is configured to be used as a host. There is just one problem. It doesn't recognize when the usb device is plugged in. If I remove driver modules, plug the usb device in and load the driver modules the usb device is found and works ok. But if the driver modules are already loaded and I plug the usb device is, Linux doesn't see that usb device has been plugged in.

Is there something that should be done for the otg port or is this otg port feature or any clue what might be wrong?

Tags (2)
0 Kudos
Reply
12 Replies

1,889 Views
makeshi
NXP Employee
NXP Employee

Yes, you shold add the UDC/otg driver if your need support otg switch.

0 Kudos
Reply

1,889 Views
Maddis
Contributor IV

For now, the ID pin is grounded, but the future plan would be able to use that port either host or device mode.


I disabled the udc driver (USB GADGET in Linux since UDC driver cannot be built as a module) and now detection seems to be working just fine. I can plug in the usb device and it get's detected properly also in OTG port.So thanks for the tip!

But I'm guessing that now I cannot use the OTG in device mode any more if I want to? For that I need the UDC/otg driver (and USB GADGET)?

0 Kudos
Reply

1,889 Views
makeshi
NXP Employee
NXP Employee

ID pin is grounded properly in board-init ,so you otg port only can use host ,right? If yes,I suggest you that only select the otg host driver,not load otg and udc driver. If  USB device  plugged in to OTG port, there is a portsc interrupt to indicate that something happen.

If you want to debug the issue, I suggest you indacate that is there interrupt happen when you plug in your device to otg port.

0 Kudos
Reply

1,889 Views
Maddis
Contributor IV

It seems that I already have those patches.


I'm running out of ideas what could be wrong.

What that could indicate that kernel doesn't notice at all that the USB device has been plugged in to OTG port? And yet the same port works just fine and finds the same USB device if the device is plugged in while loading the drivers.

0 Kudos
Reply

1,889 Views
makeshi
NXP Employee
NXP Employee

udc driver is driver controler driver,it is arcotg_udc.c,mybe the attached patch can help you.

0 Kudos
Reply

1,889 Views
Maddis
Contributor IV

I have fsl_otg_arc and ehci_hcd drivers loaded. I compiled new kernel with CONFIG_USB_DEBUG=y and interestingly enough nothing gets printed to dmesg when I plug the USB mouse in.

What is udc driver? Is that a typo or what driver is that? I couldn't find any udc drivers.

0 Kudos
Reply

1,889 Views
makeshi
NXP Employee
NXP Employee

Is the otg driver and udc driver add to your image? Can You confiure CONFIG_USB_DEBUG=y
and send out the debug message?

0 Kudos
Reply

1,889 Views
makeshi
NXP Employee
NXP Employee


Jorma Pulkkinen said:

Nope. Didn't help. Mouse wasn't recognized when I plugged in usb driver loaded. LED went on for short while and then turned off. Lsusb also didn't show any new usb device. When I unloaded the ehci_hcd driver and loaded it again the LED turned on and stayed on and and now the lsusb shows the mouse as well.

0 Kudos
Reply

1,889 Views
Maddis
Contributor IV

Nope. Didn't help. Mouse wasn't recognized when I plugged in usb driver loaded. LED went on for short while and then turned off. Lsusb also didn't show any new usb device. When I unloaded the ehci_hcd driver and loaded it again the LED turned on and stayed on and and now the lsusb shows the mouse as well.

0 Kudos
Reply

1,889 Views
JerryFan
NXP Employee
NXP Employee

Please plug a mouse(usually a LowSpeed device) to see it can be find or not.

0 Kudos
Reply

1,889 Views
Maddis
Contributor IV

ID pin is grounded properly in board-init. OTG - driver in Linux doesn't touch it. Also the system works okay if I load the driver while the USB device(USB memory stick to be precise) is connected.


I don't remember how does the usb detection work, does the plugged in device ground one of the data line when plugged in to get CPU's attention. The electrical connection is so simple and it's similar to Sabre board and I cannot find what's wrong with it, but if detection is done by grounding one data line then that would suggest that the problem is somewhere CPU either in OTG hw or Linux driver.

0 Kudos
Reply

1,889 Views
VladanJovanovic
NXP Employee
NXP Employee

This could be caused by wrong USB plug or adapter that doesn't ground the ID pin on the OTG port properly.

0 Kudos
Reply