- printf("USB: ");
- result = usb_lowlevel_init(0, &ctrl);
- /* if lowlevel init is OK, scan the bus for devices
- * i.e. search HUBs and configure them */
- if (result == 0) {
- printf("scanning bus for devices... ");
- running = 1;
- usb_scan_devices();
+ for (i = 0; i < CONFIG_USB_MAX_CONTROLLER_COUNT; i++) {
+ /* init low_level USB */
+ printf("USB%d: ", i);
+ if (usb_lowlevel_init(i, &ctrl)) {
+ puts("lowlevel init failed\n");
+ continue;
+ }
+ /*
+ * lowlevel init is OK, now scan the bus for devices
+ * i.e. search HUBs and configure them
+ */
+ start_index = dev_index;
+ printf("scanning bus %d for devices... ", i);
+ dev = usb_alloc_new_device(ctrl);
+ /*
+ * device 0 is always present
+ * (root hub, so let it analyze)
+ */
+ if (dev)
+ usb_new_device(dev);
+
+ if (start_index == dev_index)
+ puts("No USB Device found\n");
+ else
+ printf("%d USB Device(s) found\n",
+ dev_index - start_index);
+