summaryrefslogtreecommitdiff
path: root/include/dfu.h
diff options
context:
space:
mode:
authorRasmus Villemoes <[email protected]>2024-09-11 15:39:00 +0200
committerMattijs Korpershoek <[email protected]>2024-10-01 10:55:09 +0200
commit4b17845529f5f0c94fe68c2daba1948d0ee41bb2 (patch)
tree65899b63101bc1ede3b4ca96e2d53a23e880caaf /include/dfu.h
parent3a0b829efc35227b1079a444f00e0729502197ad (diff)
dfu: define a callback function for the dfu_alt_info environment variable
I'm trying to use dfu-util for bootstrapping an stm32mp board. It mostly works fine, but something goes horribly wrong as soon as I make use of the ability to run arbitrary u-boot shell commands. The shell commands themselves work fine, but the heuristic "dfu_alt_info may have changed, we have to reinit" seems to cause the board and/or my host machine to go into some bad state, and further dfu-util commands fail. U-Boot already has a mechanism whereby C code can be told about changes to specific environment variables. So instead of always doing re-init, add a hook to the dfu_alt_info variable so that we only do set dfu_reinit_needed if the commands actually did modify that variable. Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mattijs Korpershoek <[email protected]>
Diffstat (limited to 'include/dfu.h')
-rw-r--r--include/dfu.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/dfu.h b/include/dfu.h
index 6c5431b3948..e25588c33cb 100644
--- a/include/dfu.h
+++ b/include/dfu.h
@@ -517,6 +517,7 @@ static inline int dfu_fill_entity_virt(struct dfu_entity *dfu, char *devstr,
#endif
extern bool dfu_reinit_needed;
+extern bool dfu_alt_info_changed;
#if CONFIG_IS_ENABLED(DFU_WRITE_ALT)
/**