aboutsummaryrefslogtreecommitdiff
path: root/include/dfu.h
diff options
context:
space:
mode:
authorAndy Shevchenko2019-11-27 18:12:15 +0200
committerMarek Vasut2020-01-07 14:37:50 +0100
commit98a8f445fd6b93988340d845c96fd47ff454e895 (patch)
treee1452a58cfedbce315b95651ce9908c721b904ba /include/dfu.h
parent2b1f8c2bdfe5f874233df221f037e1494bb8f875 (diff)
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 https://github.com/01org/edison-u-boot/commit/5e966ccc3c65c18c9783741fa04e0c45e021780c 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>
Diffstat (limited to 'include/dfu.h')
-rw-r--r--include/dfu.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/dfu.h b/include/dfu.h
index 2e3e91c8d29..fb5260d903a 100644
--- a/include/dfu.h
+++ b/include/dfu.h
@@ -178,6 +178,11 @@ unsigned char *dfu_free_buf(void);
unsigned long dfu_get_buf_size(void);
bool dfu_usb_get_reset(void);
+#ifdef CONFIG_DFU_TIMEOUT
+unsigned long dfu_get_timeout(void);
+void dfu_set_timeout(unsigned long);
+#endif
+
int dfu_read(struct dfu_entity *de, void *buf, int size, int blk_seq_num);
int dfu_write(struct dfu_entity *de, void *buf, int size, int blk_seq_num);
int dfu_flush(struct dfu_entity *de, void *buf, int size, int blk_seq_num);