This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

omap-l138 MUSB in OTG mode fails when connected at boot

Other Parts Discussed in Thread: OMAP-L138, DA8XX

I have a logic-PD omap-l138 development kit. I'm trying to get the USB OTG port working reliably. I can only get it to work by inserting something AFTER booting the kernel.

While running:

Connecting a PC puts it into gadget mode, using the G_ETHER driver.

Connecting a USB stick puts it in host mode. The stick is detected and mounted correctly, and performs as expected.

If i leave the USB stick in, and reset the system (full power off and on, or reset, or soft restart), the system will boot, but the USB stick will fail to initialize. A few seconds after booting, the kernel outputs the following error every 10 seconds or so:

usb 1-1: device descriptor read/64, error -110

If I leave the PC connected and reboot, the gadget initializes, but runs slowly and the performance is awful.

Re-inserting the stick or PC does not make a difference. Only removing it and doing a reboot, and then connecting the sickt or PC will fix the issue.

I've tried removing USB support from u-boot, building USB components as modules and load them later, but that did not make any difference at all. I'm using kernel 2.6.37-psp03.21.00.04

I've seen a few reports of similar issues, via Google, but I've not seen any remark on either cause or solution.

  • you may want to try below change. (Remove the SESSION reset line "devctl &= ~MUSB_DEVCTL_SESSION;" )

    --- a/drivers/usb/musb/musb_core.c
    +++ b/drivers/usb/musb/musb_core.c
    @@ -917,7 +917,6 @@ void musb_start(struct musb *musb)

            musb->is_active = 0;
            devctl = musb_readb(regs, MUSB_DEVCTL);
    -       devctl &= ~MUSB_DEVCTL_SESSION;

            if (is_otg_enabled(musb)) {
                    /* session started after:

    Ajay

  • Found it at offset 987 in the file (not at 917), changed it and compiled the kernel. No difference, behavior is exactly the same.

  • Correction, i forgot to boot the new kernel on the second round. The patch DID fix the issue at reboot.

    After some more testing, I found that switching from host back to gadget doesn't work. Once the omap has been a host, it will no longer become a gadget, and one has to reboot to be able to go back into gadget mode again. Do you happen to have a patch for that as well?

  • You can try below patch done for another platform ti81xx. Update changes done in ti81xx.c to da8xx.c inside drivers/usb/musb folder.

    http://arago-project.org/git/projects/?p=linux-am33x.git;a=commitdiff;h=5b20494150d8c045f152f06bee57da2e64dc4964

    Ajay