Merge git://git.denx.de/u-boot-fsl-qoriq
[oweals/u-boot.git] / drivers / usb / host / dwc2.c
index 30b51b3d7f296b1b31cfd3b0937c96ae965d3203..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;
 }