[PATCH v3 6/6] board: samsung: e850-96: Enter DFU automatically on USB boot
Sam Protsenko
semen.protsenko at linaro.org
Wed Nov 19 00:21:19 CET 2025
Doing USB boot on E850-96 is most useful in two cases:
1. For unbricking the board
2. During the bootloader development
In both cases a U-Boot binary is being re-flashed to eMMC. The most
convenient way to update U-Boot in eMMC is by using DFU. Implement
entering DFU flashing mode automatically when U-Boot is executed on USB
boot. That makes it easier for users to re-flash U-Boot without even
having serial console running, e.g.:
$ ./smdk-usbdl
$ dfu-util -D u-boot.bin -a bootloader
See [1,2] for details.
Entering DFU mode is implemented by setting corresponding environment
variables:
bootcmd="dfu 0 mmc 0"
bootdelay=0
Do not save the U-Boot environment though, to avoid falling through to
DFU mode on a regular eMMC boot.
[1] doc/board/samsung/e850-96.rst
[2] https://gitlab.com/LinaroLtd/e850-96/tools/dltool/-/tree/uboot
Signed-off-by: Sam Protsenko <semen.protsenko at linaro.org>
---
Changes in v3:
- This patch is added in v3
board/samsung/e850-96/e850-96.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/board/samsung/e850-96/e850-96.c b/board/samsung/e850-96/e850-96.c
index 3aa4992a36d5..415505f2561c 100644
--- a/board/samsung/e850-96/e850-96.c
+++ b/board/samsung/e850-96/e850-96.c
@@ -209,6 +209,12 @@ int board_late_init(void)
else
load_firmware_blk();
+ if (bootdev_is_usb()) {
+ env_set("bootcmd", "echo \"Entering DFU mode...\"; "
+ "dfu 0 mmc 0");
+ env_set("bootdelay", "0");
+ }
+
return 0;
}
--
2.47.3
More information about the U-Boot
mailing list