dfu: add 'SCRIPT' entity

Define a new 'SCRIPT' type for DFU entities. The downloaded data are
treated as simple u-boot's scripts and executed with run_command_list()
function.

Flashing the 'SCRIPT' entity might result in changing the 'dfu_alt_info'
environment variable from the flashed script, so add a global variable
for tracking the potential need to reinitialize the dfu_alt_info related
structures.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
This commit is contained in:
Marek Szyprowski
2020-12-22 11:32:22 +01:00
committed by Marek Vasut
parent b5f3405b9d
commit c533f94c10
4 changed files with 46 additions and 4 deletions

View File

@@ -34,6 +34,7 @@ enum dfu_layout {
DFU_FS_EXT4,
DFU_RAM_ADDR,
DFU_SKIP,
DFU_SCRIPT,
};
enum dfu_op {
@@ -497,6 +498,8 @@ static inline int dfu_fill_entity_virt(struct dfu_entity *dfu, char *devstr,
}
#endif
extern bool dfu_reinit_needed;
#if CONFIG_IS_ENABLED(DFU_WRITE_ALT)
/**
* dfu_write_by_name() - write data to DFU medium