Skip to contentSkip to conversation

Kconfig: Use hex values for CONFIG_{SPL,TPL}_SIZE_LIMIT

PATCH New Ovidiu Panait 3 participants 3 messages Sep 25, 2020 – Oct 23, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Kconfig: Use hex values for CONFIG_{SPL,TPL}_SIZE_LIMIT

CONFIG_{SPL,TPL}_SIZE_LIMIT are defined as hex (SPL_SIZE_LIMIT was converted in b51882d0 ("spl: Convert CONFIG_SPL_SIZE_LIMIT to hex"), but there are still places that reference integer values. Change those to hex as well. Also, update the Makefile to check for 0x0 instead of 0.

This also fixes the following build error when CONFIG_SPL_SIZE_LIMIT is set by menuconfig to 0x0:
...
spl/u-boot-spl.bin exceeds file size limit:
limit: 0 bytes
actual: 0x80f0 bytes
excess: 0x80f0 bytes

---

 Makefile                          | 4 ++--
 common/spl/Kconfig                | 8 ++++----
 configs/firefly-rk3288_defconfig  | 2 +-
 configs/imxrt1020-evk_defconfig   | 2 +-
 configs/imxrt1050-evk_defconfig   | 2 +-
 configs/tinker-s-rk3288_defconfig | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)
Makefile +2 -2
index dd98b43031..0ccbe3ed42 100644
@@ -859,13 +859,13 @@ else
 BOARD_SIZE_CHECK =
 endif
 
-ifneq ($(CONFIG_SPL_SIZE_LIMIT),0)
+ifneq ($(CONFIG_SPL_SIZE_LIMIT),0x0)
 SPL_SIZE_CHECK = @$(call size_check,$@,$$(tools/spl_size_limit))
 else
 SPL_SIZE_CHECK =
 endif
 
-ifneq ($(CONFIG_TPL_SIZE_LIMIT),0)
+ifneq ($(CONFIG_TPL_SIZE_LIMIT),0x0)
 TPL_SIZE_CHECK = @$(call size_check,$@,$(CONFIG_TPL_SIZE_LIMIT))
 else
 TPL_SIZE_CHECK =
common/spl/Kconfig +4 -4
index af8255a8d6..9367c74b54 100644
@@ -37,9 +37,9 @@ config SPL_FRAMEWORK_BOARD_INIT_F
 config SPL_SIZE_LIMIT
 	hex "Maximum size of SPL image"
 	depends on SPL
-	default 69632 if ARCH_MX6 && !MX6_OCRAM_256KB
-	default 200704 if ARCH_MX6 && MX6_OCRAM_256KB
-	default 0
+	default 0x11000 if ARCH_MX6 && !MX6_OCRAM_256KB
+	default 0x31000 if ARCH_MX6 && MX6_OCRAM_256KB
+	default 0x0
 	help
 	  Specifies the maximum length of the U-Boot SPL image.
 	  If this value is zero, it is ignored.
@@ -1334,7 +1334,7 @@ if TPL
 config TPL_SIZE_LIMIT
 	hex "Maximum size of TPL image"
 	depends on TPL
-	default 0
+	default 0x0
 	help
 	  Specifies the maximum length of the U-Boot TPL image.
 	  If this value is zero, it is ignored.
configs/firefly-rk3288_defconfig +1 -1
index 534358f78a..0d504944be 100644
@@ -6,7 +6,7 @@ CONFIG_ENV_OFFSET=0x3F8000
 CONFIG_ROCKCHIP_RK3288=y
 CONFIG_TARGET_FIREFLY_RK3288=y
 CONFIG_SPL_STACK_R_ADDR=0x80000
-CONFIG_SPL_SIZE_LIMIT=262144
+CONFIG_SPL_SIZE_LIMIT=0x40000
 CONFIG_DEBUG_UART_BASE=0xff690000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEFAULT_DEVICE_TREE="rk3288-firefly"
configs/imxrt1020-evk_defconfig +1 -1
index 61f99e9de6..9bddb69cd4 100644
@@ -12,7 +12,7 @@ CONFIG_SPL_TEXT_BASE=0x20209000
 CONFIG_TARGET_IMXRT1020_EVK=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
-CONFIG_SPL_SIZE_LIMIT=131072
+CONFIG_SPL_SIZE_LIMIT=0x20000
 CONFIG_SPL=y
 CONFIG_DEFAULT_DEVICE_TREE="imxrt1020-evk"
 CONFIG_DISTRO_DEFAULTS=y
configs/imxrt1050-evk_defconfig +1 -1
index 3f7b670459..a1f9d38cf5 100644
@@ -14,7 +14,7 @@ CONFIG_SPL_TEXT_BASE=0x20209000
 CONFIG_TARGET_IMXRT1050_EVK=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
-CONFIG_SPL_SIZE_LIMIT=131072
+CONFIG_SPL_SIZE_LIMIT=0x20000
 CONFIG_SPL=y
 CONFIG_DEFAULT_DEVICE_TREE="imxrt1050-evk"
 CONFIG_DISTRO_DEFAULTS=y
configs/tinker-s-rk3288_defconfig +1 -1
index 68411d863b..94ddfd4d24 100644
@@ -7,7 +7,7 @@ CONFIG_NR_DRAM_BANKS=1
 CONFIG_ROCKCHIP_RK3288=y
 CONFIG_TARGET_TINKER_RK3288=y
 CONFIG_SPL_STACK_R_ADDR=0x800000
-CONFIG_SPL_SIZE_LIMIT=307200
+CONFIG_SPL_SIZE_LIMIT=0x4B000
 CONFIG_DEBUG_UART_BASE=0xff690000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEFAULT_DEVICE_TREE="rk3288-tinker-s"
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 Kconfig: Use hex values for CONFIG_{SPL,TPL}_SIZE_LIMIT

Hi Ovidiu,

Quoted 17 lines · Ovidiu Panait

CONFIG_{SPL,TPL}_SIZE_LIMIT are defined as hex (SPL_SIZE_LIMIT was converted in b51882d0 ("spl: Convert CONFIG_SPL_SIZE_LIMIT to hex"), but there are still places that reference integer values. Change those to hex as well. Also, update the Makefile to check for 0x0 instead of 0.

This also fixes the following build error when CONFIG_SPL_SIZE_LIMIT is set by menuconfig to 0x0:
...
spl/u-boot-spl.bin exceeds file size limit:
limit: 0 bytes
actual: 0x80f0 bytes
excess: 0x80f0 bytes

---

Quoted 8 lines
 Makefile                          | 4 ++--
 common/spl/Kconfig                | 8 ++++----
 configs/firefly-rk3288_defconfig  | 2 +-
 configs/imxrt1020-evk_defconfig   | 2 +-
 configs/imxrt1050-evk_defconfig   | 2 +-
 configs/tinker-s-rk3288_defconfig | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)
Quoted 38 lines
Makefile +2 -2
index dd98b43031..0ccbe3ed42 100644
@@ -859,13 +859,13 @@ else
 BOARD_SIZE_CHECK =
 endif
 
-ifneq ($(CONFIG_SPL_SIZE_LIMIT),0)
+ifneq ($(CONFIG_SPL_SIZE_LIMIT),0x0)
 SPL_SIZE_CHECK = @$(call size_check,$@,$$(tools/spl_size_limit))
 else
 SPL_SIZE_CHECK =
 endif
 
-ifneq ($(CONFIG_TPL_SIZE_LIMIT),0)
+ifneq ($(CONFIG_TPL_SIZE_LIMIT),0x0)
 TPL_SIZE_CHECK = @$(call size_check,$@,$(CONFIG_TPL_SIZE_LIMIT))
 else
 TPL_SIZE_CHECK =
common/spl/Kconfig +3 -3
index af8255a8d6..9367c74b54 100644
@@ -37,9 +37,9 @@ config SPL_FRAMEWORK_BOARD_INIT_F
 config SPL_SIZE_LIMIT
        hex "Maximum size of SPL image"
        depends on SPL
-       default 69632 if ARCH_MX6 && !MX6_OCRAM_256KB
-       default 200704 if ARCH_MX6 && MX6_OCRAM_256KB
-       default 0
+       default 0x11000 if ARCH_MX6 && !MX6_OCRAM_256KB
+       default 0x31000 if ARCH_MX6 && MX6_OCRAM_256KB
+       default 0x0
        help
          Specifies the maximum length of the U-Boot SPL image.
          If this value is zero, it is ignored.

common/spl/Kconfig if TPL · line 1337

Quoted 5 lines
common/spl/Kconfig +1 -1
@@ -1334,7 +1334,7 @@ if TPL
 config TPL_SIZE_LIMIT
        hex "Maximum size of TPL image"
        depends on TPL
-       default 0
+       default 0x0

That seems a bit like obfuscation to me, but OK.

common/spl/Kconfig if TPL · line 1340

Quoted 3 lines
common/spl/Kconfig +0 -0
        help
          Specifies the maximum length of the U-Boot TPL image.
          If this value is zero, it is ignored.

Regards,
Simon

#2 lore raw

PATCH 1/1 Kconfig: Use hex values for CONFIG_{SPL,TPL}_SIZE_LIMIT

In reply to Ovidiu Panait
Quoted 13 lines · Ovidiu Panait

CONFIG_{SPL,TPL}_SIZE_LIMIT are defined as hex (SPL_SIZE_LIMIT was converted in b51882d0 ("spl: Convert CONFIG_SPL_SIZE_LIMIT to hex"), but there are still places that reference integer values. Change those to hex as well. Also, update the Makefile to check for 0x0 instead of 0.

This also fixes the following build error when CONFIG_SPL_SIZE_LIMIT is set by menuconfig to 0x0:
...
spl/u-boot-spl.bin exceeds file size limit:
limit: 0 bytes
actual: 0x80f0 bytes
excess: 0x80f0 bytes

Quoted 2 lines

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201022/94cd6be7/attachment.sig>