2 * cmd_dfu.c -- dfu command
4 * Copyright (C) 2012 Samsung Electronics
5 * authors: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
6 * Lukasz Majewski <l.majewski@samsung.com>
8 * SPDX-License-Identifier: GPL-2.0+
15 static int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
23 ret = dfu_init_env_entities(argv[1], simple_strtoul(argv[2], NULL, 10));
27 if (argc > 3 && strcmp(argv[3], "list") == 0) {
40 * This extra number of usb_gadget_handle_interrupts()
41 * calls is necessary to assure correct transmission
42 * completion with dfu-util
50 usb_gadget_handle_interrupts();
58 run_command("reset", 0);
60 return CMD_RET_SUCCESS;
63 U_BOOT_CMD(dfu, CONFIG_SYS_MAXARGS, 1, do_dfu,
64 "Device Firmware Upgrade",
65 "<interface> <dev> [list]\n"
66 " - device firmware upgrade on a device <dev>\n"
67 " attached to interface <interface>\n"
68 " [list] - list available alt settings"