aboutsummaryrefslogtreecommitdiff
path: root/cmd/dfu.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-01-31 14:24:35 -0500
committerTom Rini <trini@konsulko.com>2021-01-31 14:24:35 -0500
commitb4804cdd5747d1d932bd338e0ca102ade51b8b6b (patch)
treedd3aa210c95de630ee7e62a58e7924e73ee0458a /cmd/dfu.c
parentfad42d3afbeb23e86fae2bb56ba863a2a5a133e1 (diff)
parent723fd5668ff2c8dd19e808778b5670d0fa6bdc4b (diff)
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-usb
- Assorted gadget changes including: - dfu: Fix handling of UBI partitions in MTD backend - gadget: f_thor: fix wrong file size cast - Extend cmd: bcb - Fixes for fastboot and rockchip gadgets - dfu: Add SCRIPT and SKIP entities - dfu/thor: Add `dfu_alt_info` reinitialization from flashed script - u-boot: Reduce size of u-boot as usbd_device_* arrays are not exported
Diffstat (limited to 'cmd/dfu.c')
-rw-r--r--cmd/dfu.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/cmd/dfu.c b/cmd/dfu.c
index 7310595a02..ef4f897ce0 100644
--- a/cmd/dfu.c
+++ b/cmd/dfu.c
@@ -34,7 +34,6 @@ static int do_dfu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
#if defined(CONFIG_DFU_TIMEOUT) || defined(CONFIG_DFU_OVER_TFTP)
unsigned long value = 0;
#endif
-
if (argc >= 4) {
interface = argv[2];
devstring = argv[3];
@@ -67,8 +66,18 @@ static int do_dfu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
}
int controller_index = simple_strtoul(usb_controller, NULL, 0);
+ bool retry = false;
+ do {
+ run_usb_dnl_gadget(controller_index, "usb_dnl_dfu");
- run_usb_dnl_gadget(controller_index, "usb_dnl_dfu");
+ if (dfu_reinit_needed) {
+ dfu_free_entities();
+ ret = dfu_init_env_entities(interface, devstring);
+ if (ret)
+ goto done;
+ retry = true;
+ }
+ } while (retry);
done:
dfu_free_entities();