at91: SPL size check for at91 boards
cover at91: SPL size check for at91 boards
This is a review of the patch
[U-Boot,RFC] ARM: at91: lds: add test SPL binary size and bbs size
Commit:
ARM: at91: lds: add test SPL binary size and bbs size
will check for the SPL size and bss to see if it can fit the known RAM area where it's supposed to be loaded. If the size exceeds, it will print an error in build.
However, some platforms already have the SPL broken: it is too big for the RAM area. These platforms would fail to build if we enable this SPL size check. So, I made the commits for these defconfigs to disable SPL before adding the actual check (for bisectability, do not break any builds in between the series commits).
In short, first three commits will prepare defconfigs for the SPL check and the last commit will implement the actual size checks.
Eugen Hristev (2):
configs: corvus_defconfig: Remove SPL
configs: wb45n_defconfig: Remove SPL
Wenyou Yang (2):
configs: picosam9g45_defconfig: Remove SPL
ARM: at91: lds: add test SPL binary size and bbs size
arch/arm/mach-at91/arm926ejs/u-boot-spl.lds | 10 ++++++++++ configs/corvus_defconfig | 8 -------- configs/picosam9g45_defconfig | 10 ---------- configs/wb45n_defconfig | 6 ------ 4 files changed, 10 insertions(+), 24 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/4 configs: picosam9g45_defconfig: Remove SPL
From: Wenyou Yang <[email protected]>
Due the size of SPL being too big, remove the SPL support. ---8<---
arm-none-linux-gnueabi-ld: SPL image too big --->8---
--- configs/picosam9g45_defconfig | 10 ---------- 1 file changed, 10 deletions(-)
configs/picosam9g45_defconfig +0 -10
@@ -3,14 +3,6 @@ CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_AT91=y CONFIG_SYS_TEXT_BASE=0x23f00000 CONFIG_TARGET_PICOSAM9G45=y -CONFIG_SPL_GPIO_SUPPORT=y -CONFIG_SPL_LIBCOMMON_SUPPORT=y -CONFIG_SPL_LIBGENERIC_SUPPORT=y -CONFIG_SPL_MMC_SUPPORT=y -CONFIG_SPL_SERIAL_SUPPORT=y -CONFIG_SPL=y -CONFIG_SPL_FAT_SUPPORT=y -CONFIG_SPL_LIBDISK_SUPPORT=y CONFIG_NR_DRAM_BANKS=2 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9M10G45,SYS_USE_MMC" CONFIG_BOOTDELAY=3
@@ -20,7 +12,6 @@ CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait" CONFIG_SYS_CONSOLE_IS_IN_ENV=y # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_BOARD_EARLY_INIT_F=y -CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="U-Boot> " # CONFIG_CMD_BDI is not set
@@ -41,6 +32,5 @@ CONFIG_USB_STORAGE=y CONFIG_LCD=y CONFIG_OF_LIBFDT=y CONFIG_DM=y -CONFIG_SPL_DM=y CONFIG_WDT=y CONFIG_WDT_AT91=y
Signature · 1 line
2.7.4
PATCH 2/4 configs: corvus_defconfig: Remove SPL
In reply to Eugen.Hristev at microchip.comDue the size of SPL being too big, remove the SPL support. ---8<---
arm-linux-gnueabi-ld: SPL image too big
--->8---
--- configs/corvus_defconfig | 8 -------- 1 file changed, 8 deletions(-)
configs/corvus_defconfig +0 -8
@@ -1,16 +1,9 @@ CONFIG_ARM=y CONFIG_SYS_THUMB_BUILD=y -# CONFIG_SPL_USE_ARCH_MEMCPY is not set -# CONFIG_SPL_USE_ARCH_MEMSET is not set CONFIG_ARCH_AT91=y CONFIG_SYS_TEXT_BASE=0x72000000 CONFIG_TARGET_CORVUS=y -CONFIG_SPL_GPIO_SUPPORT=y -CONFIG_SPL_LIBCOMMON_SUPPORT=y -CONFIG_SPL_LIBGENERIC_SUPPORT=y CONFIG_SYS_MALLOC_F_LEN=0x800 -CONFIG_SPL_SERIAL_SUPPORT=y -CONFIG_SPL=y CONFIG_NR_DRAM_BANKS=1 CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9M10G45,MACH_TYPE=2066,SYS_USE_NANDFLASH" CONFIG_BOOTDELAY=3
@@ -18,7 +11,6 @@ CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,256k(env),256k(env_redundant),256k(spare),512k(dtb),6M(kernel)ro,-(rootfs) root=/dev/mtdblock7 rw rootfstype=jffs2" # CONFIG_DISPLAY_BOARDINFO is not set CONFIG_BOARD_EARLY_INIT_F=y -CONFIG_SPL_NAND_SUPPORT=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="U-Boot> " # CONFIG_CMD_BDI is not set
Signature · 1 line
2.7.4
PATCH 3/4 configs: wb45n_defconfig: Remove SPL
In reply to Eugen.Hristev at microchip.comDue the size of SPL being too big, remove the SPL support. ---8<---
arm-linux-gnueabi-ld: SPL image too big
--->8---
--- configs/wb45n_defconfig | 6 ------ 1 file changed, 6 deletions(-)
configs/wb45n_defconfig +0 -6
@@ -3,17 +3,11 @@ CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_AT91=y CONFIG_SYS_TEXT_BASE=0x23f00000 CONFIG_TARGET_WB45N=y -CONFIG_SPL_GPIO_SUPPORT=y -CONFIG_SPL_LIBCOMMON_SUPPORT=y -CONFIG_SPL_LIBGENERIC_SUPPORT=y -CONFIG_SPL_SERIAL_SUPPORT=y -CONFIG_SPL=y CONFIG_NR_DRAM_BANKS=1 CONFIG_FIT=y CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9X5,SYS_USE_NANDFLASH" CONFIG_BOOTDELAY=3 CONFIG_BOARD_EARLY_INIT_F=y -CONFIG_SPL_NAND_SUPPORT=y CONFIG_HUSH_PARSER=y CONFIG_CMD_BOOTZ=y CONFIG_CMD_MEMTEST=y
Signature · 1 line
2.7.4
PATCH 3/4 configs: wb45n_defconfig: Remove SPL
Hi,
A shame as these boards only really need to start NAND and boot uboot proper. Out of interest how much is it over in the builder?
If SPL can't be shrunk any further then fair enough and;
Thanks,
Ben
Quoted 53 lines
-----Original Message-----
From: U-Boot [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Eugen.Hristev at microchip.com
Sent: 19 November 2018 08:23
To: u-boot at lists.denx.de
Cc: Nicolas.Ferre at microchip.com
Subject: [U-Boot] [PATCH 3/4] configs:wb45n_defconfig:
Remove SPLDue the size of SPL being too big, remove the SPL support. ---8<---
arm-linux-gnueabi-ld: SPL image too big
--->8---Signed-off-by: Eugen Hristev
<[email protected]>--- configs/wb45n_defconfig | 6 ------ 1 file changed, 6 deletions(-)configs/wb45n_defconfig +0
-5@@ -3,17 +3,11 @@ CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_AT91=y CONFIG_SYS_TEXT_BASE=0x23f00000 CONFIG_TARGET_WB45N=y -CONFIG_SPL_GPIO_SUPPORT=y -CONFIG_SPL_LIBCOMMON_SUPPORT=y -CONFIG_SPL_LIBGENERIC_SUPPORT=y -CONFIG_SPL_SERIAL_SUPPORT=y -CONFIG_SPL=y CONFIG_NR_DRAM_BANKS=1 CONFIG_FIT=y
CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9X5,SYS_USE_NA
NDFLASH"
CONFIG_BOOTDELAY=3
CONFIG_BOARD_EARLY_INIT_F=y
-CONFIG_SPL_NAND_SUPPORT=y
CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTZ=y
CONFIG_CMD_MEMTEST=y
--
2.7.4______________________________________________
_
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH 3/4 configs: wb45n_defconfig: Remove SPL
Just compiled with the bootlin toolchain
' armv5-eabi--musl--stable-2018.02-2' from within buildroot and it looks like an image is produced within size.
text data bss dec hex filename
17965 1180 4480 23625 5c49 u-boot-spl
It looks like the assertion calculates the assertion incorrectly, will comment on that patch.
Ben
Quoted 82 lines
-----Original Message-----
From: U-Boot [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Ben Whitten
Sent: 19 November 2018 10:30
To: Eugen.Hristev at microchip.com; u-boot at lists.denx.de
Cc: Nicolas.Ferre at microchip.com
Subject: Re: [U-Boot] [PATCH 3/4] configs:wb45n_defconfig: Remove SPLHi,
A shame as these boards only really need to start NAND and boot uboot proper. Out of interest how much is it over in the
builder?If SPL can't be shrunk any further then fair enough and;
Acked-by Ben Whitten <[email protected]>Thanks,
BenQuoted 28 lines
-----Original Message-----
From: U-Boot [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Eugen.Hristev at microchip.com
Sent: 19 November 2018 08:23
To: u-boot at lists.denx.de
Cc: Nicolas.Ferre at microchip.com
Subject: [U-Boot] [PATCH 3/4] configs:wb45n_defconfig:
Remove SPLDue the size of SPL being too big, remove the SPL support. ---8<---
arm-linux-gnueabi-ld: SPL image too big
--->8---Signed-off-by: Eugen Hristev
<[email protected]>--- configs/wb45n_defconfig | 6 ------ 1 file changed, 6 deletions(-)configs/wb45n_defconfig +0
-0@@ -3,17 +3,11 @@ CONFIG_SYS_THUMB_BUILD=y CONFIG_ARCH_AT91=y CONFIG_SYS_TEXT_BASE=0x23f00000configs/wb45n_defconfig CONFIG_SYS_THUMB_BUILD=y · line 9
Quoted 10 lines
configs/wb45n_defconfig +0
-5CONFIG_TARGET_WB45N=y -CONFIG_SPL_GPIO_SUPPORT=y -CONFIG_SPL_LIBCOMMON_SUPPORT=y -CONFIG_SPL_LIBGENERIC_SUPPORT=y -CONFIG_SPL_SERIAL_SUPPORT=y -CONFIG_SPL=y CONFIG_NR_DRAM_BANKS=1 CONFIG_FIT=y
CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9X5,SYS_USE_NAQuoted 11 lines
NDFLASH"
CONFIG_BOOTDELAY=3
CONFIG_BOARD_EARLY_INIT_F=y
-CONFIG_SPL_NAND_SUPPORT=y
CONFIG_HUSH_PARSER=y
CONFIG_CMD_BOOTZ=y
CONFIG_CMD_MEMTEST=y
--
2.7.4______________________________________________
Quoted 4 lines
_
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot______________________________________________
_
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH 4/4 ARM: at91: lds: add test SPL binary size and bbs size
In reply to Eugen.Hristev at microchip.comFrom: Wenyou Yang <[email protected]>
Add the test for the SPL binary size and the bbs section size.
--- 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
@@ -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
PATCH 4/4 ARM: at91: lds: add test SPL binary size and bbs size
Quoted 26 lines
-----Original Message-----
From: U-Boot [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Eugen.Hristev at microchip.com
Sent: 19 November 2018 08:23
To: u-boot at lists.denx.de
Cc: Nicolas.Ferre at microchip.com;
wenyou.yang at atmel.com
Subject: [U-Boot] [PATCH 4/4] ARM: at91: lds: add test SPL binary size and bbs sizeFrom: Wenyou Yang <[email protected]>
Add the test for the SPL binary size and the bbs section size.
Signed-off-by Wenyou Yang <[email protected]>--- arch/arm/mach-at91/arm926ejs/u-boot-spl.lds | 10 ++++++++++ 1 file changed, 10 insertions(+)arch/arm/mach-at91/arm926ejs/u-boot-spl.lds +0
-0
arch/arm/mach-at91/arm926ejs/u-boot-spl.lds SECTIONS · line 53
Quoted 6 lines
arch/arm/mach-at91/arm926ejs/u-boot-spl.lds +3
-0@@ -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.
Quoted 17 lines
(
CONFIG_SPL_MAX_SIZE), \arch/arm/mach-at91/arm926ejs/u-boot-spl.lds +5
-0+ "SPL image too big"); +#endif + +#if defined(CONFIG_SPL_BSS_MAX_SIZE) +ASSERT(__bss_end - __bss_start <(
CONFIG_SPL_BSS_MAX_SIZE), \arch/arm/mach-at91/arm926ejs/u-boot-spl.lds +2
-1+ "SPL image BSS too big"); +#endif --2.7.4
______________________________________________
_
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH 4/4 ARM: at91: lds: add test SPL binary size and bbs size
Quoted 20 lines · Ben Whitten
Quoted 20 lines
-----Original Message-----
From: U-Boot [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Eugen.Hristev at microchip.com
Sent: 19 November 2018 08:23
To: u-boot at lists.denx.de
Cc: Nicolas.Ferre at microchip.com;
wenyou.yang at atmel.com
Subject: [U-Boot] [PATCH 4/4] ARM: at91: lds: add test SPL binary size and bbs sizeFrom: Wenyou Yang <[email protected]>
Add the test for the SPL binary size and the bbs section size.
Signed-off-by Wenyou Yang <[email protected]>--- arch/arm/mach-at91/arm926ejs/u-boot-spl.lds | 10 ++++++++++ 1 file changed, 10 insertions(+)
Quoted 15 lines
arch/arm/mach-at91/arm926ejs/u-boot-spl.lds SECTIONS · line 53
Quoted 12 lines
arch/arm/mach-at91/arm926ejs/u-boot-spl.lds +3
-0@@ -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_startcausing SPL size calculation to error, replacing with__startresolves 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
Quoted 18 lines
Quoted 18 lines
(
CONFIG_SPL_MAX_SIZE), \arch/arm/mach-at91/arm926ejs/u-boot-spl.lds +5
-0+ "SPL image too big"); +#endif + +#if defined(CONFIG_SPL_BSS_MAX_SIZE) +ASSERT(__bss_end - __bss_start <(
CONFIG_SPL_BSS_MAX_SIZE), \arch/arm/mach-at91/arm926ejs/u-boot-spl.lds +2
-1+ "SPL image BSS too big"); +#endif --2.7.4
______________________________________________
_
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot