diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2020-12-22 13:32:24 +0300 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2021-01-31 16:08:56 +0300 |
commit | e47431aa5cf0fe5e113ee9e33624084c93d4ec58 (patch) | |
tree | b8af207745d73c237d1ca7b735d5bc8c7ebec406 /cmd | |
parent | 9129f2f16488e95f8a71bb87937397aaf333bc1b (diff) | |
download | u-boot-e47431aa5cf0fe5e113ee9e33624084c93d4ec58.tar.xz |
thor: add support for the dfu_alt_info reintialization from the flashed script
Reinitialize dfu_env_entities after flashing the 'SCRIPT' entity to
ensure that the potential changes to the 'dfu_alt_info' environment
variable are applied.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/thordown.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/cmd/thordown.c b/cmd/thordown.c index ae20dddfdd..838764ccef 100644 --- a/cmd/thordown.c +++ b/cmd/thordown.c @@ -52,13 +52,18 @@ int do_thor_down(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) goto exit; } - ret = thor_handle(); - if (ret) { - pr_err("THOR failed: %d\n", ret); - ret = CMD_RET_FAILURE; - goto exit; - } - + do { + ret = thor_handle(); + if (ret == THOR_DFU_REINIT_NEEDED) { + dfu_free_entities(); + ret = dfu_init_env_entities(interface, devstring); + } + if (ret) { + pr_err("THOR failed: %d\n", ret); + ret = CMD_RET_FAILURE; + goto exit; + } + } while (ret == 0); exit: g_dnl_unregister(); usb_gadget_release(controller_index); |