]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/usb.c
powerpc: remove 4xx support
[people/ms/u-boot.git] / common / usb.c
index 205041b6a62b2499abe4b29779b8bf683483fe26..0904259757371a25b2cb25f2d1189b6a53a43d17 100644 (file)
@@ -37,9 +37,6 @@
 #include <asm/unaligned.h>
 #include <errno.h>
 #include <usb.h>
-#ifdef CONFIG_4xx
-#include <asm/4xx_pci.h>
-#endif
 
 #define USB_BUFSIZ     512
 
@@ -557,12 +554,10 @@ int usb_clear_halt(struct usb_device *dev, int pipe)
 static int usb_get_descriptor(struct usb_device *dev, unsigned char type,
                        unsigned char index, void *buf, int size)
 {
-       int res;
-       res = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
-                       USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
-                       (type << 8) + index, 0,
-                       buf, size, USB_CNTL_TIMEOUT);
-       return res;
+       return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
+                              USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
+                              (type << 8) + index, 0, buf, size,
+                              USB_CNTL_TIMEOUT);
 }
 
 /**********************************************************************
@@ -612,14 +607,10 @@ int usb_get_configuration_no(struct usb_device *dev, int cfgno,
  */
 static int usb_set_address(struct usb_device *dev)
 {
-       int res;
-
        debug("set address %d\n", dev->devnum);
-       res = usb_control_msg(dev, usb_snddefctrl(dev),
-                               USB_REQ_SET_ADDRESS, 0,
-                               (dev->devnum), 0,
-                               NULL, 0, USB_CNTL_TIMEOUT);
-       return res;
+
+       return usb_control_msg(dev, usb_snddefctrl(dev), USB_REQ_SET_ADDRESS,
+                              0, (dev->devnum), 0, NULL, 0, USB_CNTL_TIMEOUT);
 }
 
 /********************************************************************
@@ -1077,6 +1068,14 @@ int usb_select_config(struct usb_device *dev)
        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);
+
        /* only support for one config for now */
        err = usb_get_configuration_len(dev, 0);
        if (err >= 0) {
@@ -1174,7 +1173,7 @@ int usb_new_device(struct usb_device *dev)
         * with the device. So a get_descriptor will fail before any
         * of that is done for XHCI unlike EHCI.
         */
-#ifdef CONFIG_USB_XHCI
+#ifdef CONFIG_USB_XHCI_HCD
        do_read = false;
 #endif
        err = usb_setup_device(dev, do_read, dev->parent);