aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-09-25 08:56:28 -0600
committerBin Meng <bmeng.cn@gmail.com>2019-10-08 13:57:45 +0800
commitb51882d0079d3275bdb83ce49fdc8a90133f7f07 (patch)
tree3fdf9b80ff932dc134cc9703af20f1fb45ed6a54
parent27084c03d36a7f0e4d7c1679761e81567f1d5442 (diff)
downloadu-boot-b51882d0079d3275bdb83ce49fdc8a90133f7f07.zip
u-boot-b51882d0079d3275bdb83ce49fdc8a90133f7f07.tar.gz
u-boot-b51882d0079d3275bdb83ce49fdc8a90133f7f07.tar.bz2
spl: Convert CONFIG_SPL_SIZE_LIMIT to hex
This is currently a decimal value which is not as convenient or meaningful. Also U-Boot tends to use hex everywhere. Convert this option to hex and add a comment for the size_check macro. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Acked-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: correct the typo in the commit title] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
-rw-r--r--Makefile10
-rw-r--r--arch/arm/mach-socfpga/Kconfig2
-rw-r--r--common/spl/Kconfig2
-rw-r--r--configs/evb-rk3288_defconfig2
-rw-r--r--configs/tinker-rk3288_defconfig2
5 files changed, 11 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index b68cbaf..3593039 100644
--- a/Makefile
+++ b/Makefile
@@ -337,14 +337,18 @@ endif
# KBUILD_MODULES := 1
#endif
+# Check ths size of a binary:
+# Args:
+# $1: File to check
+# #2: Size limit in bytes (decimal or 0xhex)
define size_check
actual=$$( wc -c $1 | awk '{print $$1}'); \
limit=$$( printf "%d" $2 ); \
if test $$actual -gt $$limit; then \
echo "$1 exceeds file size limit:" >&2; \
- echo " limit: $$limit bytes" >&2; \
- echo " actual: $$actual bytes" >&2; \
- echo " excess: $$((actual - limit)) bytes" >&2; \
+ echo " limit: $$(printf %#x bytes $$limit) bytes" >&2; \
+ echo " actual: $$(printf %#x $$actual) bytes" >&2; \
+ echo " excess: $$(printf %#x $$((actual - limit))) bytes" >&2;\
exit 1; \
fi
endef
diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig
index ee79953..45de153 100644
--- a/arch/arm/mach-socfpga/Kconfig
+++ b/arch/arm/mach-socfpga/Kconfig
@@ -4,7 +4,7 @@ config NR_DRAM_BANKS
default 1
config SPL_SIZE_LIMIT
- default 65536 if TARGET_SOCFPGA_GEN5
+ default 0x10000 if TARGET_SOCFPGA_GEN5
config SPL_SIZE_LIMIT_PROVIDE_STACK
default 0x200 if TARGET_SOCFPGA_GEN5
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 048b85b..ef4fb19 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -26,7 +26,7 @@ config SPL_FRAMEWORK
and the Linux Kernel. If unsure, say Y.
config SPL_SIZE_LIMIT
- int "Maximum size of SPL image"
+ hex "Maximum size of SPL image"
depends on SPL
default 69632 if ARCH_MX6
default 0
diff --git a/configs/evb-rk3288_defconfig b/configs/evb-rk3288_defconfig
index 7b0e908..043ee32 100644
--- a/configs/evb-rk3288_defconfig
+++ b/configs/evb-rk3288_defconfig
@@ -4,7 +4,7 @@ CONFIG_SYS_TEXT_BASE=0x01000000
CONFIG_ROCKCHIP_RK3288=y
CONFIG_TARGET_EVB_RK3288=y
CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_SIZE_LIMIT=307200
+CONFIG_SPL_SIZE_LIMIT=0x4b000
CONFIG_SPL_STACK_R_ADDR=0x80000
CONFIG_DEBUG_UART_BASE=0xff690000
CONFIG_DEBUG_UART_CLOCK=24000000
diff --git a/configs/tinker-rk3288_defconfig b/configs/tinker-rk3288_defconfig
index 9328608..eff3b06 100644
--- a/configs/tinker-rk3288_defconfig
+++ b/configs/tinker-rk3288_defconfig
@@ -5,7 +5,7 @@ CONFIG_SPL_GPIO_SUPPORT=y
CONFIG_ROCKCHIP_RK3288=y
CONFIG_TARGET_TINKER_RK3288=y
CONFIG_NR_DRAM_BANKS=1
-CONFIG_SPL_SIZE_LIMIT=307200
+CONFIG_SPL_SIZE_LIMIT=0x4b000
CONFIG_SPL_STACK_R_ADDR=0x80000
CONFIG_DEBUG_UART_BASE=0xff690000
CONFIG_DEBUG_UART_CLOCK=24000000