[U-Boot] musb-new startup timeout

Alex Kiernan alex.kiernan at gmail.com
Fri Jul 27 09:54:10 UTC 2018


We've been chasing a problem for a while where we've got USB3 devices
plugged in (on AM3352 board), this is using the musb-new driver.

The symptoms are you plug in a device in and run `usb start` and get
`USB0:   Port not available.`, having watched the timings (and from
our reading of the USB spec - though this is spec in one hand and
analyser in the other...) we think that the USB device should raise
the D+ line within 100ms to indicate that it is present. With a USB
2.0 hubs we see this very quickly, but with some USB3 hubs (and some
USB3 memory sticks) this takes on the order of 800ms. We failed to
find the right part of the USB3 spec, so not sure if this is normal.

There's a timeout in musb_uboot.c of 1s:

  int musb_lowlevel_init(struct musb_host_data *host)
  {
          void *mbase;
          /* USB spec says it may take up to 1 second for a device to connect */
          unsigned long timeout = get_timer(0) + 1000;
          int ret;
   ...

If we bump that timeout to 1200ms then devices that were unreliable
now work, but obviously the longer the delay, the more time the boot
process takes when there's no USB (assuming there's a `usb start` in
there).

Would making that timeout configurable be a crazy thing to do, or are
these devices which we're trying to use just broken and we should
avoid them. Given the timeout's down in a driver, I assume other
drivers have the same 1s timeout?

-- 
Alex Kiernan


More information about the U-Boot mailing list