Skip to content

Instantly share code, notes, and snippets.

@jannau
Created August 25, 2022 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jannau/6f217029cf1b9e5dbec58dd71cc8808d to your computer and use it in GitHub Desktop.
Save jannau/6f217029cf1b9e5dbec58dd71cc8808d to your computer and use it in GitHub Desktop.
u-boot asahi usb logitech unifying receiver probe workaround
diff --git a/common/usb.c b/common/usb.c
index aad13fd9c557..1d97999a146d 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -1068,34 +1068,35 @@ static int usb_prepare_device(struct usb_device *dev, int addr, bool do_read,
* after device is assigned an address. This is only applicable
* to xHCI so far.
*/
if (!do_read) {
err = usb_setup_descriptor(dev, true);
if (err)
return err;
}
return 0;
}
int usb_select_config(struct usb_device *dev)
{
unsigned char *tmpbuf = NULL;
int err;
+ mdelay(1);
err = get_descriptor_len(dev, USB_DT_DEVICE_SIZE, USB_DT_DEVICE_SIZE);
if (err)
return err;
/* correct le values */
le16_to_cpus(&dev->descriptor.bcdUSB);
le16_to_cpus(&dev->descriptor.idVendor);
le16_to_cpus(&dev->descriptor.idProduct);
le16_to_cpus(&dev->descriptor.bcdDevice);
/*
* Kingston DT Ultimate 32GB USB 3.0 seems to be extremely sensitive
* about this first Get Descriptor request. If there are any other
* requests in the first microframe, the stick crashes. Wait about
* one microframe duration here (1mS for USB 1.x , 125uS for USB 2.0).
*/
mdelay(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment