From: Patrick Delaunay Date: Thu, 8 Jul 2021 08:53:56 +0000 (+0200) Subject: arm: stm32mp1: force boot_device variable for invalid TAMP register value X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=8b71b20e0e5431f0243a5a8078ac62be0af2189e;p=u-boot.git arm: stm32mp1: force boot_device variable for invalid TAMP register value When the TAMP register 20 have an invalid value (0x0 for example after TAMPER error) the "boot_device" U-Boot env variable have no value and no error is displayed in U-Boot log. The STM32MP boot command bootcmd_stm32mp failed with strange trace: "Boot over !" and the next command in bootcmd_stm32mp failed with few indication: if test ${boot_device} = serial || test ${boot_device} = usb; then stm32prog ${boot_device} ${boot_instance}; As it is difficult to investigate, the current patch avoids this issue: - change the debug message to error: "unexpected boot mode" is displayed - display trace "Boot over invalid!" in bootcmd_stm32mp - execute "run distro_bootcmd" to try all the possible target Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- diff --git a/arch/arm/mach-stm32mp/cpu.c b/arch/arm/mach-stm32mp/cpu.c index f6ed2ce0e4..eb79f3ffd2 100644 --- a/arch/arm/mach-stm32mp/cpu.c +++ b/arch/arm/mach-stm32mp/cpu.c @@ -556,7 +556,9 @@ static void setup_boot_mode(void) env_set("boot_instance", "0"); break; default: - log_debug("unexpected boot mode = %x\n", boot_mode); + env_set("boot_device", "invalid"); + env_set("boot_instance", ""); + log_err("unexpected boot mode = %x\n", boot_mode); break; }