]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/usb.c
usb/gadget: fastboot: add eMMC support for flash command
[karo-tx-uboot.git] / common / usb.c
index e23d78885521d0e5bf35d19cb3bc140ba0571c2c..bd0f8d5d180fb1a72590dd341562cea4056c4253 100644 (file)
@@ -33,7 +33,8 @@
 #include <linux/ctype.h>
 #include <asm/byteorder.h>
 #include <asm/unaligned.h>
-
+#include <compiler.h>
+#include <errno.h>
 #include <usb.h>
 #ifdef CONFIG_4xx
 #include <asm/4xx_pci.h>
@@ -59,6 +60,7 @@ int usb_init(void)
        void *ctrl;
        struct usb_device *dev;
        int i, start_index = 0;
+       int ret;
 
        dev_index = 0;
        asynch_allowed = 1;
@@ -74,7 +76,13 @@ int usb_init(void)
        for (i = 0; i < CONFIG_USB_MAX_CONTROLLER_COUNT; i++) {
                /* init low_level USB */
                printf("USB%d:   ", i);
-               if (usb_lowlevel_init(i, &ctrl)) {
+               ret = usb_lowlevel_init(i, USB_INIT_HOST, &ctrl);
+               if (ret == -ENODEV) {   /* No such device. */
+                       puts("Port not available.\n");
+                       continue;
+               }
+
+               if (ret) {              /* Other error. */
                        puts("lowlevel init failed\n");
                        continue;
                }
@@ -1066,4 +1074,9 @@ int usb_new_device(struct usb_device *dev)
        return 0;
 }
 
+__weak
+int board_usb_init(int index, enum usb_init_type init)
+{
+       return 0;
+}
 /* EOF */