Skip to contentSkip to conversation

ARM: at91: lds: add test for SPL binary size and bss size

PATCH New Eugen.Hristev at microchip.com 2 participants 2 messages Nov 28, 2018 – Dec 7, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: at91: lds: add test for SPL binary size and bss size

Add test for the SPL binary size and the bss section size. This will throw an error at build time if the SPL sections do not fit in the designated RAM area, thus avoiding oversizing the SPL.

Based on original work by Wenyou Yang.

---

This patch is a rework of the initial series:
[PATCH 0/4] at91: SPL size check for at91 boards

It should work fine for all the boards now, so keeping SPL enabled for all the affected boards.

Thanks to Ben Whitten for testing and solution

Changes in v2:
- replaced wrong variable __image_copy_start with __start

 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..b714e93 100644
@@ -48,3 +48,13 @@ SECTIONS
 		__bss_end = .;
 	} >.sdram
 }
+
+#if defined(CONFIG_SPL_MAX_SIZE)
+ASSERT(__image_copy_end - __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

PATCH v2 1/1 ARM: at91: lds: add test for SPL binary size and bss size

Quoted 7 lines · Eugen.Hristev at microchip.com

Add test for the SPL binary size and the bss section size. This will throw an error at build time if the SPL sections do not fit in the designated RAM area, thus avoiding oversizing the SPL.

Based on original work by Wenyou Yang.

Applied to u-boot/master, 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/20181207/507b5c9d/attachment.sig>