[U-Boot] [RFC][PATCH] ARM: at91: lds: add test SPL binary size and bbs size

Eugen.Hristev at microchip.com Eugen.Hristev at microchip.com
Tue Oct 23 08:07:24 UTC 2018


From: Wenyou Yang <wenyou.yang at atmel.com>

Add the test for the SPL binary size and the bbs section size.

Signed-off-by: Wenyou Yang <wenyou.yang at atmel.com>
---

Hello,

This patch from our at91 tree will check for the SPL size and BSS size,
however, with this check, build will fail for some old platforms.
The solution would be to disable SPL for these failing platform, where
SPL cannot work anyway (too big for the SRAM where it's supposed to be loaded)
or work through the SPL to make it smaller (remove some support from it).
Which is the best approach we should pursue ?
The check would be good anyway to avoid oversizing the SPL.
Any thoughts?

Thanks,
Eugen

 arch/arm/mach-at91/arm926ejs/u-boot-spl.lds | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds b/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
index eca78f8..82098dc 100644
--- a/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
+++ b/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
@@ -48,3 +48,13 @@ SECTIONS
 		__bss_end = .;
 	} >.sdram
 }
+
+#if defined(CONFIG_SPL_MAX_SIZE)
+ASSERT(__image_copy_end - __image_copy_start < (CONFIG_SPL_MAX_SIZE), \
+	"SPL image too big");
+#endif
+
+#if defined(CONFIG_SPL_BSS_MAX_SIZE)
+ASSERT(__bss_end - __bss_start < (CONFIG_SPL_BSS_MAX_SIZE), \
+	"SPL image BSS too big");
+#endif
-- 
2.7.4



More information about the U-Boot mailing list