]> git.dujemihanovic.xyz Git - u-boot.git/commit
dfu: define a callback function for the dfu_alt_info environment variable
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Wed, 11 Sep 2024 13:39:00 +0000 (15:39 +0200)
committerMattijs Korpershoek <mkorpershoek@baylibre.com>
Tue, 1 Oct 2024 08:55:09 +0000 (10:55 +0200)
commit4b17845529f5f0c94fe68c2daba1948d0ee41bb2
tree65899b63101bc1ede3b4ca96e2d53a23e880caaf
parent3a0b829efc35227b1079a444f00e0729502197ad
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 <rasmus.villemoes@prevas.dk>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20240911133900.1444083-1-rasmus.villemoes@prevas.dk
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
drivers/dfu/dfu.c
drivers/dfu/dfu_mmc.c
include/dfu.h
include/env_callback.h