diff options
author | Tom Rini <trini@konsulko.com> | 2019-11-06 15:11:02 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-11-06 15:11:02 +0300 |
commit | a8c184663349cbaf029f97d306c63b1ffa7eb544 (patch) | |
tree | fc351cbeb958feae856bbb83f3d8455dd5add325 /cmd | |
parent | e64ebde12dc82e80f81a74d66b48da2fe598041f (diff) | |
parent | 02b0e1a36c5bc20174299312556ec4e266872bd6 (diff) | |
download | u-boot-a8c184663349cbaf029f97d306c63b1ffa7eb544.tar.xz |
Merge branch 'master' of git://git.denx.de/u-boot-usb
- DFU updates
- USB Storage updates
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/Kconfig | 1 | ||||
-rw-r--r-- | cmd/dfu.c | 21 | ||||
-rw-r--r-- | cmd/thordown.c | 3 |
3 files changed, 16 insertions, 9 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig index b08a709857..c414c5d8e6 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -442,6 +442,7 @@ config CMD_FITUPD config CMD_THOR_DOWNLOAD bool "thor - TIZEN 'thor' download" + select DFU help Implements the 'thor' download protocol. This is a way of downloading a software update over USB from an attached host. @@ -21,23 +21,28 @@ static int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { - if (argc < 4) + if (argc < 2) return CMD_RET_USAGE; #ifdef CONFIG_DFU_OVER_USB char *usb_controller = argv[1]; #endif #if defined(CONFIG_DFU_OVER_USB) || defined(CONFIG_DFU_OVER_TFTP) - char *interface = argv[2]; - char *devstring = argv[3]; + char *interface = NULL; + char *devstring = NULL; + + if (argc >= 4) { + interface = argv[2]; + devstring = argv[3]; + } #endif int ret = 0; #ifdef CONFIG_DFU_OVER_TFTP unsigned long addr = 0; if (!strcmp(argv[1], "tftp")) { - if (argc == 5) - addr = simple_strtoul(argv[4], NULL, 0); + if (argc == 5 || argc == 3) + addr = simple_strtoul(argv[argc - 1], NULL, 0); return update_tftp(addr, interface, devstring); } @@ -48,7 +53,7 @@ static int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) goto done; ret = CMD_RET_SUCCESS; - if (argc > 4 && strcmp(argv[4], "list") == 0) { + if (strcmp(argv[argc - 1], "list") == 0) { dfu_show_entities(); goto done; } @@ -67,7 +72,7 @@ U_BOOT_CMD(dfu, CONFIG_SYS_MAXARGS, 1, do_dfu, "Device Firmware Upgrade", "" #ifdef CONFIG_DFU_OVER_USB - "<USB_controller> <interface> <dev> [list]\n" + "<USB_controller> [<interface> <dev>] [list]\n" " - device firmware upgrade via <USB_controller>\n" " on device <dev>, attached to interface\n" " <interface>\n" @@ -77,7 +82,7 @@ U_BOOT_CMD(dfu, CONFIG_SYS_MAXARGS, 1, do_dfu, #ifdef CONFIG_DFU_OVER_USB "dfu " #endif - "tftp <interface> <dev> [<addr>]\n" + "tftp [<interface> <dev>] [<addr>]\n" " - device firmware upgrade via TFTP\n" " on device <dev>, attached to interface\n" " <interface>\n" diff --git a/cmd/thordown.c b/cmd/thordown.c index dd0544d475..8dae024e31 100644 --- a/cmd/thordown.c +++ b/cmd/thordown.c @@ -40,7 +40,8 @@ int do_thor_down(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ret = g_dnl_register("usb_dnl_thor"); if (ret) { pr_err("g_dnl_register failed %d\n", ret); - return ret; + ret = CMD_RET_FAILURE; + goto exit; } ret = thor_init(); |