From 560d8f32703ffa748197f6b782884952697669ff Mon Sep 17 00:00:00 2001 From: Dario Binacchi Date: Mon, 18 May 2026 08:54:27 +0200 Subject: board: st: stm32mp15: support dynamic A/B bank bootup Following commit 4300f9f4c5d7 ("board: st: stm32mp25: support dynamic A/B bank bootup"), this patch enables automatic detection of the active A/B bank on STM32MP15 platforms by retrieving partition GUIDs from FWU metadata. This ensures the system correctly identifies the bootable partitions even in multi-bank scenarios, falling back to a standard bootable flag scan if the UUIDs are missing. To enable A/B bank bootup on STM32MP15 boards, add the following Kconfig options to the stm32mp15[_basic]_defconfig: CONFIG_FWU_MULTI_BANK_UPDATE=y CONFIG_FWU_MDATA=y CONFIG_FWU_NUM_BANKS=2 CONFIG_FWU_NUM_IMAGES_PER_BANK=3 CONFIG_CMD_FWU_METADATA=y CONFIG_FWU_MDATA_V2=y Signed-off-by: Dario Binacchi Reviewed-by: Patrice Chotard --- include/configs/stm32mp15_st_common.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include') diff --git a/include/configs/stm32mp15_st_common.h b/include/configs/stm32mp15_st_common.h index 60838cb0e3f..7727e583fc7 100644 --- a/include/configs/stm32mp15_st_common.h +++ b/include/configs/stm32mp15_st_common.h @@ -8,7 +8,22 @@ #ifndef __CONFIG_STM32MP15_ST_COMMON_H__ #define __CONFIG_STM32MP15_ST_COMMON_H__ +#ifdef CONFIG_FWU_MULTI_BANK_UPDATE +#define SCAN_DEV_FOR_BOOT_PARTS \ + "setenv devplist; " \ + "env exists boot_partuuid && " \ + "part number ${devtype} ${devnum} ${boot_partuuid} devplist; " \ + "env exists devplist || " \ + "part list ${devtype} ${devnum} -bootable devplist; " + +#define ST_STM32MP15_FWU_ENV \ + "altbootcmd=${bootcmd}\0" +#else +#define ST_STM32MP15_FWU_ENV +#endif + #define STM32MP_BOARD_EXTRA_ENV \ + ST_STM32MP15_FWU_ENV \ "usb_pgood_delay=2000\0" \ "console=ttySTM0\0" \ "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ -- cgit v1.2.3