mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master] ARM: i.MX8MM bootsource: fix serial detection for QSPI boot source
@ 2024-01-19 10:34 Marco Felsch
  2024-01-22 10:23 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Marco Felsch @ 2024-01-19 10:34 UTC (permalink / raw)
  To: barebox

From: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>

The current code override the serial download boot mode which is set in
case the BootROM decide to fallback due to an empty QSPI. This lead into
the wrong boot source detection and barebox will try to download the
rest of the image via QSPI instead of using the serial download mode.

Fix this by reorder the detection, first try the generic bootsource and
if this fails try to detect the QSPI boot mode. This is also how u-boot
does it in the first place.

Fixes: 7b55ababb40f ("ARM: i.MX8MM bootsource: fix QSPI boot source detection")
Signed-off-by: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 arch/arm/mach-imx/boot.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-imx/boot.c b/arch/arm/mach-imx/boot.c
index c6134f35b659..153da835606c 100644
--- a/arch/arm/mach-imx/boot.c
+++ b/arch/arm/mach-imx/boot.c
@@ -711,15 +711,18 @@ void imx8mm_get_boot_source(enum bootsource *src, int *instance)
 		return;
 	}
 
+	addr = IMX8M_BOOT_SW_INFO_POINTER_ADDR_A0;
+
+	__imx7_get_boot_source(src, instance, addr, sbmr2);
+
+	if (*src != BOOTSOURCE_UNKNOWN)
+		return;
+
 	if (imx8mm_bootsource_qspi(sbmr1)) {
 		*src = BOOTSOURCE_SPI; /* Really: qspi */
 		*instance = 0;
 		return;
 	}
-
-	addr = IMX8M_BOOT_SW_INFO_POINTER_ADDR_A0;
-
-	__imx7_get_boot_source(src, instance, addr, sbmr2);
 }
 
 void imx8mm_boot_save_loc(void)
-- 
2.39.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-22 10:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-19 10:34 [PATCH master] ARM: i.MX8MM bootsource: fix serial detection for QSPI boot source Marco Felsch
2024-01-22 10:23 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox