]> git.sur5r.net Git - u-boot/blobdiff - common/usb_hub.c
nios2: convert ioremap to use dm cpu data
[u-boot] / common / usb_hub.c
index f621ddb9ab5debe7c6b65514f2b04ee408167bfc..415b45c1f139451c685fd450a6477bde34859cab 100644 (file)
@@ -26,6 +26,7 @@
 #include <command.h>
 #include <dm.h>
 #include <errno.h>
+#include <memalign.h>
 #include <asm/processor.h>
 #include <asm/unaligned.h>
 #include <linux/ctype.h>
@@ -489,11 +490,15 @@ static int usb_hub_configure(struct usb_device *dev)
                        portstatus = le16_to_cpu(portsts->wPortStatus);
                        portchange = le16_to_cpu(portsts->wPortChange);
 
-                       if ((portchange & USB_PORT_STAT_C_CONNECTION) ==
-                               (portstatus & USB_PORT_STAT_CONNECTION))
+                       /* No connection change happened, wait a bit more. */
+                       if (!(portchange & USB_PORT_STAT_C_CONNECTION))
+                               continue;
+
+                       /* Test if the connection came up, and if so, exit. */
+                       if (portstatus & USB_PORT_STAT_CONNECTION)
                                break;
 
-               } while (get_timer(start) < CONFIG_SYS_HZ * 10);
+               } while (get_timer(start) < CONFIG_SYS_HZ * 1);
 
                if (ret < 0)
                        continue;