[U-Boot] [U-Boot, 1/4] cam_enc_4xx: fix CONFIG_SPL_MAX_SIZE semantics

Tom Rini trini at ti.com
Mon Apr 8 22:43:53 CEST 2013


On Mon, Apr 08, 2013 at 09:58:26AM -0000, Albert ARIBAUD wrote:

> CONFIG_SPL_MAX_SIZE wrongly included BSS size. Split
> max size between image and BSS based on sizes reported
> for current build.
> 
> Signed-off-by: Albert ARIBAUD <albert.u.boot at aribaud.net>
> 
> ---
> board/ait/cam_enc_4xx/u-boot-spl.lds |    2 +-
>  include/configs/cam_enc_4xx.h        |    4 +++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/board/ait/cam_enc_4xx/u-boot-spl.lds b/board/ait/cam_enc_4xx/u-boot-spl.lds
> index dd9d52d..25625dc 100644
> --- a/board/ait/cam_enc_4xx/u-boot-spl.lds
> +++ b/board/ait/cam_enc_4xx/u-boot-spl.lds
> @@ -25,7 +25,7 @@
>   */
>  
>  MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
> -		LENGTH = CONFIG_SPL_MAX_SIZE }
> +		LENGTH = (CONFIG_SPL_MAX_SIZE + CONFIG_SPL_BSS_MAX_SIZE) }
>  
>  OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
>  OUTPUT_ARCH(arm)
> diff --git a/include/configs/cam_enc_4xx.h b/include/configs/cam_enc_4xx.h
> index 56528dd..df3682b 100644
> --- a/include/configs/cam_enc_4xx.h
> +++ b/include/configs/cam_enc_4xx.h
> @@ -230,7 +230,9 @@
>  #define CONFIG_SPL_STACK		(0x00010000 + 0x7f00)
>  
>  #define CONFIG_SPL_TEXT_BASE		0x00000020 /*CONFIG_SYS_SRAM_START*/
> -#define CONFIG_SPL_MAX_SIZE		12320
> +/* SPL max size is 12K -- but --pad-to requires a single decimal number */
> +#define CONFIG_SPL_MAX_SIZE		12288
> +#define CONFIG_SPL_BSS_MAX_SIZE		(4*1024)

This is wrong, you've just increased the overall limit to 16K.  I know
there's a reason that current limit is so exact, Heiko?  And also, this
shows the conceptual problem I have (and 2/2 has the same, along with
tegra).  The important limit is the combined size.  It doesn't matter if
it's 11K text/data/rodata and 1K BSS, or 8+4.  When using custom linker
scripts, we avoid this and can just comment overall (which would need
adding here) that we only care about the combined size.  But then tegra
would be wrong since it uses the generic arm spl linker script?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130408/3c3a9f45/attachment.pgp>


More information about the U-Boot mailing list