2 * cmd_thordown.c -- USB TIZEN "THOR" Downloader gadget
4 * Copyright (C) 2013 Lukasz Majewski <l.majewski@samsung.com>
7 * SPDX-License-Identifier: GPL-2.0+
16 int do_thor_down(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
21 char *usb_controller = argv[1];
22 char *interface = argv[2];
23 char *devstring = argv[3];
27 puts("TIZEN \"THOR\" Downloader\n");
29 ret = dfu_init_env_entities(interface, devstring);
33 int controller_index = simple_strtoul(usb_controller, NULL, 0);
34 ret = board_usb_init(controller_index, USB_INIT_DEVICE);
36 error("USB init failed: %d", ret);
37 ret = CMD_RET_FAILURE;
41 g_dnl_register("usb_dnl_thor");
45 error("THOR DOWNLOAD failed: %d", ret);
46 ret = CMD_RET_FAILURE;
52 error("THOR failed: %d", ret);
53 ret = CMD_RET_FAILURE;
59 board_usb_cleanup(controller_index, USB_INIT_DEVICE);
66 U_BOOT_CMD(thordown, CONFIG_SYS_MAXARGS, 1, do_thor_down,
67 "TIZEN \"THOR\" downloader",
68 "<USB_controller> <interface> <dev>\n"
69 " - device software upgrade via LTHOR TIZEN dowload\n"
70 " program via <USB_controller> on device <dev>,\n"
71 " attached to interface <interface>\n"