[PATCH] spl: spl_legacy: Fix spl_end address for non ARM target

Shiji Yang yangshiji66 at outlook.com
Mon Jul 31 13:57:14 CEST 2023


Only ARM target defines _image_binary_end symbol as char*, All other
targets define it as an ulong type in include/asm-generic/sections.h.

This patch fixes the boot failure on MIPS target. Error log:
SPL: Image overlaps SPL

Fixes: 1b8a1be1a1f1 ("spl: spl_legacy: Fix spl_end address")
Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
---
 common/spl/spl_legacy.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/common/spl/spl_legacy.c b/common/spl/spl_legacy.c
index 095443c63d..0fef890384 100644
--- a/common/spl/spl_legacy.c
+++ b/common/spl/spl_legacy.c
@@ -18,9 +18,13 @@
 
 static void spl_parse_legacy_validate(uintptr_t start, uintptr_t size)
 {
+	uintptr_t end = start + size;
 	uintptr_t spl_start = (uintptr_t)_start;
+#ifdef CONFIG_ARM
 	uintptr_t spl_end = (uintptr_t)_image_binary_end;
-	uintptr_t end = start + size;
+#else
+	uintptr_t spl_end = (uintptr_t)&_image_binary_end;
+#endif /* CONFIG_ARM */
 
 	if ((start >= spl_start && start < spl_end) ||
 	    (end > spl_start && end <= spl_end) ||
-- 
2.39.2



More information about the U-Boot mailing list