1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00

dfu: Add optional timeout parameter

When the `dfu` command is called from the U-Boot environment,
it now accepts an optional parameter that specifies a timeout (in seconds).
If a DFU connection is not made within that time the `dfu` command exits
(as it would if Ctrl+C was pressed). If the timeout is left empty or being
zero the `dfu` command behaves as it does now.

This is useful for allowing U-Boot to check to see if anything wants to
upload new firmware before continuing to boot.

The patch is based on the commit
5e966ccc3c
by Sebastien Colleur, which has been heavily reworked due to U-Boot changes
in the past.

Signed-off-by: Brad Campbell <bradjc5@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
Andy Shevchenko
2019-11-27 18:12:15 +02:00
committed by Marek Vasut
parent 2b1f8c2bdf
commit 98a8f445fd
6 changed files with 62 additions and 4 deletions

View File

@@ -43,6 +43,7 @@ Configuration Options:
CONFIG_DFU_RAM
CONFIG_DFU_SF
CONFIG_DFU_SF_PART
CONFIG_DFU_TIMEOUT
CONFIG_DFU_VIRTUAL
CONFIG_CMD_DFU
@@ -70,12 +71,15 @@ Commands:
dfu <USB_controller> [<interface> <dev>] list
list the alternate device defined in "dfu_alt_info"
dfu <USB_controller> [<interface> <dev>]
dfu <USB_controller> [<interface> <dev>] [<timeout>]
start the dfu stack on the USB instance with the selected medium
backend and use the "dfu_alt_info" variable to configure the
alternate setting and link each one with the medium
The dfu command continue until receive a ^C in console or
a DFU detach transaction from HOST.
a DFU detach transaction from HOST. If CONFIG_DFU_TIMEOUT option
is enabled and <timeout> parameter is present in the command line,
the DFU operation will be aborted automatically after <timeout>
seconds of waiting remote to initiate DFU session.
The possible values of <interface> are :
(with <USB controller> = 0 in the dfu command example)