summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2019-04-02 19:19:06 +0200
committerTom Rini <trini@konsulko.com>2019-06-07 11:03:39 -0400
commit0a0f23142ffd39954c84af3554f8026e2b8de848 (patch)
tree61f18c8c389542910876e82ba505fdf252acd33b /Makefile
parent219dee7e38c61a815a65ba50e575fca692a60c1c (diff)
downloadu-boot-0a0f23142ffd39954c84af3554f8026e2b8de848.tar.gz
configs: define CONFIG_SPL_SIZE_LIMIT
A new configuration variable CONFIG_SPL_SIZE_LIMIT is introduced to define the board specific maximum size for the SPL file. Use Makefile function size_check() to implement the test. Depending on the size of CONFIG_SPL_SIZE_LIMIT an error like the following is thrown: spl/u-boot-spl.bin exceeds file size limit: limit: 30720 bytes actual: 33426 bytes excess: 2706 bytes make: *** [Makefile:1663: spl/u-boot-spl.bin] Error 1 Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index af2ab4e019..da8a38da63 100644
--- a/Makefile
+++ b/Makefile
@@ -796,6 +796,12 @@ else
BOARD_SIZE_CHECK =
endif
+ifneq ($(CONFIG_SPL_SIZE_LIMIT),0)
+SPL_SIZE_CHECK = @$(call size_check,$@,$(CONFIG_SPL_SIZE_LIMIT))
+else
+SPL_SIZE_CHECK =
+endif
+
# Statically apply RELA-style relocations (currently arm64 only)
# This is useful for arm64 where static relocation needs to be performed on
# the raw binary, but certain simulators only accept an ELF file (but don't
@@ -1712,6 +1718,8 @@ u-boot.lds: $(LDSCRIPT) prepare FORCE
spl/u-boot-spl.bin: spl/u-boot-spl
@:
+ $(SPL_SIZE_CHECK)
+
spl/u-boot-spl: tools prepare \
$(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SPL_OF_PLATDATA),dts/dt.dtb) \
$(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_TPL_OF_PLATDATA),dts/dt.dtb)