Skip to contentSkip to conversation

ARM: at91: lds: add test SPL binary size and bbs size

RFC PATCH Superseded Eugen.Hristev at microchip.com 2 participants 2 messages Oct 23, 2018 – Nov 16, 2018

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 ARM: at91: lds: add test SPL binary size and bbs size

From: Wenyou Yang <[email protected]>

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

---

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(+)
arch/arm/mach-at91/arm926ejs/u-boot-spl.lds +10 -0
index eca78f8..82098dc 100644
@@ -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
Signature · 1 line
2.7.4
#1 lore raw
Quoted 5 lines · Eugen.Hristev at microchip.com

From: Wenyou Yang <[email protected]>

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

So, this is a good idea. The problem is that, even aside from the patch I posted to enable thumb2 for these platforms, they still don't fit within the SPL size constraints using the gcc-7.3 toolchains we use in
travis-ci: picosam9g45 wb45n corvus

So please fix these machine in some way or another, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181116/d797dc43/attachment.sig>