spl: Convert CONFIG_SPL_SIZE_LIMIT to hex
authorSimon Glass <sjg@chromium.org>
Wed, 25 Sep 2019 14:56:28 +0000 (08:56 -0600)
committerBin Meng <bmeng.cn@gmail.com>
Tue, 8 Oct 2019 05:57:45 +0000 (13:57 +0800)
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>
Makefile
arch/arm/mach-socfpga/Kconfig
common/spl/Kconfig
configs/evb-rk3288_defconfig
configs/tinker-rk3288_defconfig

index b68cbaf4377f279b160e56796a8789381607ecf3..3593039303180d6b1371c9e86966f5615732a6e3 100644 (file)
--- 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
index ee79953fcc2e197da667196a39e340995532ca84..45de153aa5ab84b4faa948cc560219ccee8c9872 100644 (file)
@@ -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
index 048b85ba7a2d8446cab3dc6289355a048e83f3d6..ef4fb19e52c995620506f873d66fec8e0dabc75c 100644 (file)
@@ -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
index 7b0e908f715c8d994076752ba8268c470ed8a6b3..043ee32bb441186c8f959a58fe4c8d18108706df 100644 (file)
@@ -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
index 93286084525dad92c6d7248d6ae50a1e704ba25a..eff3b06b5ce274844a95c95dc5ab4452a43dbeaf 100644 (file)
@@ -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