diff mbox series

[U-Boot,4/4] ARM: at91: lds: add test SPL binary size and bbs size

Message ID 1542615470-17992-5-git-send-email-eugen.hristev@microchip.com
State Changes Requested
Delegated to: Tom Rini
Headers show
Series at91: SPL size check for at91 boards | expand

Commit Message

Eugen Hristev Nov. 19, 2018, 8:23 a.m. UTC
From: Wenyou Yang <wenyou.yang@atmel.com>

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

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
 arch/arm/mach-at91/arm926ejs/u-boot-spl.lds | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Ben Whitten Nov. 19, 2018, 2:31 p.m. UTC | #1
> -----Original Message-----
> From: U-Boot [mailto:u-boot-bounces@lists.denx.de] On
> Behalf Of Eugen.Hristev@microchip.com
> Sent: 19 November 2018 08:23
> To: u-boot@lists.denx.de
> Cc: Nicolas.Ferre@microchip.com;
> wenyou.yang@atmel.com
> Subject: [U-Boot] [PATCH 4/4] ARM: at91: lds: add test SPL
> binary size and bbs size
> 
> From: Wenyou Yang <wenyou.yang@atmel.com>
> 
> Add the test for the SPL binary size and the bbs section size.
> 
> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> ---
>  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 <

There is no __image_copy_start causing SPL size calculation
to error, replacing with __start resolves it.

> (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
> 
> ______________________________________________
> _
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
Eugen Hristev Nov. 19, 2018, 3:13 p.m. UTC | #2
On 19.11.2018 16:31, Ben Whitten wrote:
>> -----Original Message-----
>> From: U-Boot [mailto:u-boot-bounces@lists.denx.de] On
>> Behalf Of Eugen.Hristev@microchip.com
>> Sent: 19 November 2018 08:23
>> To: u-boot@lists.denx.de
>> Cc: Nicolas.Ferre@microchip.com;
>> wenyou.yang@atmel.com
>> Subject: [U-Boot] [PATCH 4/4] ARM: at91: lds: add test SPL
>> binary size and bbs size
>>
>> From: Wenyou Yang <wenyou.yang@atmel.com>
>>
>> Add the test for the SPL binary size and the bbs section size.
>>
>> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
>> ---
>>   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 <
> 
> There is no __image_copy_start causing SPL size calculation
> to error, replacing with __start resolves it.

Thank you, I will modify the patch and test. This means that we can let 
the SPL in configuration, which is great news.


Eugen

> 
>> (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
>>
>> ______________________________________________
>> _
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> https://lists.denx.de/listinfo/u-boot
diff mbox series

Patch

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