diff options
author | Tom Rini <trini@konsulko.com> | 2020-01-09 08:51:57 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-01-09 08:51:57 -0500 |
commit | a74a2134b245d19a999c796d29285597a22954ed (patch) | |
tree | 0838cf4adc01fe969bbcf7dc53d41611546429a2 /cmd | |
parent | 7086de4948ba2bc46cdd3001f7d845535f05f7fe (diff) | |
parent | 3a117e721cc5b4a366dbd5fbbf8df0a80cbb0fa2 (diff) | |
download | u-boot-a74a2134b245d19a999c796d29285597a22954ed.tar.gz |
Merge branch 'master' of git://git.denx.de/u-boot-usb
- DFU updates
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/dfu.c | 28 |
1 files changed, 21 insertions, 7 deletions
@@ -30,28 +30,35 @@ static int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #if defined(CONFIG_DFU_OVER_USB) || defined(CONFIG_DFU_OVER_TFTP) char *interface = NULL; char *devstring = NULL; +#if defined(CONFIG_DFU_TIMEOUT) || defined(CONFIG_DFU_OVER_TFTP) + unsigned long value = 0; +#endif if (argc >= 4) { interface = argv[2]; devstring = argv[3]; } + +#if defined(CONFIG_DFU_TIMEOUT) || defined(CONFIG_DFU_OVER_TFTP) + if (argc == 5 || argc == 3) + value = simple_strtoul(argv[argc - 1], NULL, 0); +#endif #endif int ret = 0; #ifdef CONFIG_DFU_OVER_TFTP - unsigned long addr = 0; - if (!strcmp(argv[1], "tftp")) { - if (argc == 5 || argc == 3) - addr = simple_strtoul(argv[argc - 1], NULL, 0); - - return update_tftp(addr, interface, devstring); - } + if (!strcmp(argv[1], "tftp")) + return update_tftp(value, interface, devstring); #endif #ifdef CONFIG_DFU_OVER_USB ret = dfu_init_env_entities(interface, devstring); if (ret) goto done; +#ifdef CONFIG_DFU_TIMEOUT + dfu_set_timeout(value * 1000); +#endif + ret = CMD_RET_SUCCESS; if (strcmp(argv[argc - 1], "list") == 0) { dfu_show_entities(); @@ -72,10 +79,17 @@ U_BOOT_CMD(dfu, CONFIG_SYS_MAXARGS, 1, do_dfu, "Device Firmware Upgrade", "" #ifdef CONFIG_DFU_OVER_USB +#ifdef CONFIG_DFU_TIMEOUT + "<USB_controller> [<interface> <dev>] [<timeout>] [list]\n" +#else "<USB_controller> [<interface> <dev>] [list]\n" +#endif " - device firmware upgrade via <USB_controller>\n" " on device <dev>, attached to interface\n" " <interface>\n" +#ifdef CONFIG_DFU_TIMEOUT + " [<timeout>] - specify inactivity timeout in seconds\n" +#endif " [list] - list available alt settings\n" #endif #ifdef CONFIG_DFU_OVER_TFTP |