drivers: USB: OHCI: allow compilation for 64-bit targets
[oweals/u-boot.git] / drivers / usb / host / dwc2.c
index 0c4adafee249d19c9766de575dd612099c971e18..d08879dc67de2ca6a58d913a5c945402f71d44da 100644 (file)
@@ -1088,6 +1088,15 @@ static int dwc2_init_common(struct dwc2_priv *priv)
                }
        }
 
+       /*
+        * Add a 1 second delay here. This gives the host controller
+        * a bit time before the comminucation with the USB devices
+        * is started (the bus is scanned) and  fixes the USB detection
+        * problems with some problematic USB keys.
+        */
+       if (readl(&regs->gintsts) & DWC2_GINTSTS_CURMODE_HOST)
+               mdelay(1000);
+
        return 0;
 }
 
@@ -1201,6 +1210,9 @@ static int dwc2_usb_ofdata_to_platdata(struct udevice *dev)
 static int dwc2_usb_probe(struct udevice *dev)
 {
        struct dwc2_priv *priv = dev_get_priv(dev);
+       struct usb_bus_priv *bus_priv = dev_get_uclass_priv(dev);
+
+       bus_priv->desc_before_addr = true;
 
        return dwc2_init_common(priv);
 }