On 2/13/19 9:23 PM, Philipp Tomsich wrote: > > >> On 13.02.2019, at 21:21, Tom Rini <tr...@konsulko.com> wrote: >> >> On Wed, Feb 13, 2019 at 09:13:05PM +0100, Heinrich Schuchardt wrote: >> >>> The SPL image for the rk3288 boards has to fit into 32 KiB. This includes >>> 4 KiB for the device tree and up to 2 KiB for the file header. >>> >>> Without the patch we missed to see that the TinkerBoard >>> spl/u-boot-spl-dtb.bin file is too big. >>> >>> Signed-off-by: Heinrich Schuchardt <xypron.g...@gmx.de> >> >> NAK. To repeat myself in what I said after this patch was already sent, >> but for the record, we need to leverage CONFIG_SPL_MAX_SIZE (and >> CONFIG_TPL_MAX_SIZE) with the BOARD_SIZE_CHECK logic (and use said logic >> more widely) so that we catch this problem everywhere. A guess at max >> DTB size is not enough. Thanks! > > Acknowledged. >
I have figured out where to put the test but still have to work out the details: diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h index c59f5eff7a..2d65a58f1e 100644 --- a/include/configs/rk3288_common.h +++ b/include/configs/rk3288_common.h @@ -23,6 +23,8 @@ #define CONFIG_SYS_INIT_SP_ADDR 0x00100000 #define CONFIG_SYS_LOAD_ADDR 0x00800800 #define CONFIG_SPL_STACK 0xff718000 +/* 32 KiB - 2 KiB for file header */ +#define CONFIG_SPL_MAX_SIZE (0x8000 - 0x800) #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_TPL_BOOTROM_SUPPORT) # define CONFIG_SPL_TEXT_BASE 0x0 #else diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 9d5921606e..ccb39eccd1 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -259,6 +259,9 @@ $(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin \ $(if $(CONFIG_SPL_SEPARATE_BSS),,$(obj)/$(SPL_BIN)-pad.bin) \ $(FINAL_DTB_CONTAINER) FORCE $(call if_changed,cat) +ifneq ($(CONFIG_SPL_MAX_SIZE),) + echo TODO A test is needed here TODO +endif $(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-dtb.bin FORCE $(call if_changed,copy) Regards Heinrich _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot