return CMD_RET_USAGE;
usb_controller = argv[1];
- devtype = "mmc";
- devnum = argv[2];
+ if (argc >= 4) {
+ devtype = argv[2];
+ devnum = argv[3];
+ } else {
+ devtype = "mmc";
+ devnum = argv[2];
+ }
ums = ums_init(devtype, devnum);
if (!ums)
}
while (1) {
- usb_gadget_handle_interrupts();
+ usb_gadget_handle_interrupts(controller_index);
rc = fsg_main_thread(NULL);
if (rc) {
}
exit:
g_dnl_unregister();
+ board_usb_cleanup(controller_index, USB_INIT_DEVICE);
return CMD_RET_SUCCESS;
}
-U_BOOT_CMD(ums, CONFIG_SYS_MAXARGS, 1, do_usb_mass_storage,
- "Use the UMS [User Mass Storage]",
- "ums <USB_controller> <mmc_dev> e.g. ums 0 0"
+U_BOOT_CMD(ums, 4, 1, do_usb_mass_storage,
+ "Use the UMS [USB Mass Storage]",
+ "<USB_controller> [<devtype>] <devnum> e.g. ums 0 mmc 0\n"
+ " devtype defaults to mmc"
);