2 * Copyright (C) 2011 Samsung Electronics
3 * Lukasz Majewski <l.majewski@samsung.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 #include <usb_mass_storage.h>
27 int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag,
28 int argc, char * const argv[])
31 unsigned int dev_num = 0, offset = 0, part_size = 0;
34 struct ums_board_info *ums_info;
35 static char *s = "ums";
38 printf("usage: ums <dev> - e.g. ums 0\n");
42 dev_num = (int)simple_strtoul(argv[1], &ep, 16);
45 puts("\nSet eMMC device to 0! - e.g. ums 0\n");
50 ums_info = board_ums_init(dev_num, offset, part_size);
53 printf("MMC: %d -> NOT available\n", dev_num);
56 rc = fsg_init(ums_info);
58 printf("cmd ums: fsg_init failed\n");
65 /* Handle control-c and timeouts */
67 printf("The remote end did not respond in time.\n");
70 usb_gadget_handle_interrupts();
71 /* Check if USB cable has been detached */
72 if (fsg_main_thread(NULL) == EIO)
83 U_BOOT_CMD(ums, CONFIG_SYS_MAXARGS, 1, do_usb_mass_storage,
84 "Use the UMS [User Mass Storage]",
85 "ums - User Mass Storage Gadget"