mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-27 23:20:26 +09:00
dfu: add support for the dfu_alt_info reintialization from the flashed script
Reinitialize DFU USB gadget 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> [lukma - I've moved the bool retry to avoid build (CI) errors]
This commit is contained in:
parent
c533f94c10
commit
9129f2f164
13
cmd/dfu.c
13
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)
|
#if defined(CONFIG_DFU_TIMEOUT) || defined(CONFIG_DFU_OVER_TFTP)
|
||||||
unsigned long value = 0;
|
unsigned long value = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (argc >= 4) {
|
if (argc >= 4) {
|
||||||
interface = argv[2];
|
interface = argv[2];
|
||||||
devstring = argv[3];
|
devstring = argv[3];
|
||||||
@ -67,9 +66,19 @@ static int do_dfu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
int controller_index = simple_strtoul(usb_controller, NULL, 0);
|
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:
|
done:
|
||||||
dfu_free_entities();
|
dfu_free_entities();
|
||||||
#endif
|
#endif
|
||||||
|
@ -98,6 +98,9 @@ int run_usb_dnl_gadget(int usbctrl_index, char *usb_dnl_gadget)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (dfu_reinit_needed)
|
||||||
|
goto exit;
|
||||||
|
|
||||||
WATCHDOG_RESET();
|
WATCHDOG_RESET();
|
||||||
usb_gadget_handle_interrupts(usbctrl_index);
|
usb_gadget_handle_interrupts(usbctrl_index);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user