[PATCH 2/2] ARM: stm32mp: init: expand bootsource logic to STM32MP13{1,3}

Ahmad Fatoum a.fatoum at pengutronix.de
Wed Apr 9 06:19:20 PDT 2025


We currently run through the bootsource logic only for STM32MP135, but
the code is equally applicable to the cheaper variants that only differ
in available peripherals.

Change the check to account for current STM32MP13 variants.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 arch/arm/mach-stm32mp/init.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-stm32mp/init.c b/arch/arm/mach-stm32mp/init.c
index b24649e86658..1c7f62dbb033 100644
--- a/arch/arm/mach-stm32mp/init.c
+++ b/arch/arm/mach-stm32mp/init.c
@@ -240,7 +240,11 @@ static int stm32mp_init(void)
 {
 	u32 boot_ctx;
 
-	if (of_machine_is_compatible("st,stm32mp135"))
+	if (of_machine_is_compatible("st,stm32mp131"))
+		__st32mp_soc = 0x32131;
+	else if (of_machine_is_compatible("st,stm32mp133"))
+		__st32mp_soc = 0x32133;
+	else if (of_machine_is_compatible("st,stm32mp135"))
 		__st32mp_soc = 0x32135;
 	else if (of_machine_is_compatible("st,stm32mp151"))
 		__st32mp_soc = 0x32151;
@@ -251,7 +255,7 @@ static int stm32mp_init(void)
 	else
 		return 0;
 
-	if (__st32mp_soc == 0x32135) {
+	if ((__st32mp_soc & 0xFF0) == 0x130) {
 		boot_ctx = readl(STM32MP13_TAMP_BOOT_CONTEXT);
 	} else {
 		stm32mp15_setup_cpu_type();
-- 
2.39.5




More information about the barebox mailing list