summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-03-31 01:07:11 +0300
committerTom Rini <trini@konsulko.com>2022-04-08 16:05:19 +0300
commit95b641756cf0af009f8f74be5f57de84acc58d51 (patch)
treedbf6d6274716b032c1cd465bbf65cf6e6b4664ff
parent03a8a797e5dccaffe172d3b5224bc3c3fcd304d6 (diff)
downloadu-boot-95b641756cf0af009f8f74be5f57de84acc58d51.tar.xz
Convert CONFIG_BOARD_SIZE_LIMIT to Kconfig
This converts the following to Kconfig: CONFIG_BOARD_SIZE_LIMIT To do this, introduce CONFIG_HAS_BOARD_SIZE_LIMIT. Signed-off-by: Tom Rini <trini@konsulko.com>
-rw-r--r--Kconfig17
-rw-r--r--README5
-rw-r--r--configs/bk4r1_defconfig2
-rw-r--r--configs/colibri_pxa270_defconfig2
-rw-r--r--configs/colibri_vf_defconfig2
-rw-r--r--configs/ea-lpc3250devkitv2_defconfig2
-rw-r--r--configs/gardena-smart-gateway-mt7688_defconfig2
-rw-r--r--configs/guruplug_defconfig2
-rw-r--r--configs/linkit-smart-7688_defconfig2
-rw-r--r--configs/mx51evk_defconfig2
-rw-r--r--configs/mx53loco_defconfig2
-rw-r--r--configs/mx7ulp_com_defconfig2
-rw-r--r--configs/openrd_base_defconfig2
-rw-r--r--configs/openrd_client_defconfig2
-rw-r--r--configs/openrd_ultimate_defconfig2
-rw-r--r--configs/pcm052_defconfig2
-rw-r--r--configs/pico-dwarf-imx6ul_defconfig2
-rw-r--r--configs/pico-dwarf-imx7d_defconfig2
-rw-r--r--configs/pico-hobbit-imx6ul_defconfig2
-rw-r--r--configs/pico-hobbit-imx7d_defconfig2
-rw-r--r--configs/pico-imx6_defconfig2
-rw-r--r--configs/pico-imx6ul_defconfig2
-rw-r--r--configs/pico-imx7d_bl33_defconfig2
-rw-r--r--configs/pico-imx7d_defconfig2
-rw-r--r--configs/pico-nymph-imx7d_defconfig2
-rw-r--r--configs/pico-pi-imx6ul_defconfig2
-rw-r--r--configs/pico-pi-imx7d_defconfig2
-rw-r--r--configs/sheevaplug_defconfig2
-rw-r--r--configs/tbs2910_defconfig2
-rw-r--r--configs/vf610twr_defconfig2
-rw-r--r--configs/vf610twr_nand_defconfig2
-rw-r--r--configs/warp7_bl33_defconfig2
-rw-r--r--configs/warp7_defconfig2
-rw-r--r--include/configs/bk4r1.h3
-rw-r--r--include/configs/colibri_pxa270.h2
-rw-r--r--include/configs/colibri_vf.h3
-rw-r--r--include/configs/ea-lpc3250devkitv2.h5
-rw-r--r--include/configs/gardena-smart-gateway-mt7688.h6
-rw-r--r--include/configs/guruplug.h5
-rw-r--r--include/configs/linkit-smart-7688.h6
-rw-r--r--include/configs/mx51evk.h13
-rw-r--r--include/configs/mx53loco.h12
-rw-r--r--include/configs/mx7ulp_com.h10
-rw-r--r--include/configs/openrd.h5
-rw-r--r--include/configs/pcm052.h3
-rw-r--r--include/configs/pico-imx6.h12
-rw-r--r--include/configs/pico-imx6ul.h11
-rw-r--r--include/configs/pico-imx7d.h10
-rw-r--r--include/configs/rcar-gen3-common.h3
-rw-r--r--include/configs/sheevaplug.h5
-rw-r--r--include/configs/sunxi-common.h9
-rw-r--r--include/configs/tbs2910.h2
-rw-r--r--include/configs/vf610twr.h3
-rw-r--r--include/configs/warp7.h13
54 files changed, 79 insertions, 146 deletions
diff --git a/Kconfig b/Kconfig
index 6b1ddfc549..74a1013e4c 100644
--- a/Kconfig
+++ b/Kconfig
@@ -395,6 +395,23 @@ config BUILD_TARGET
special image will be automatically built upon calling
make / buildman.
+config HAS_BOARD_SIZE_LIMIT
+ bool "Define a maximum size for the U-Boot image"
+ default y if RCAR_GEN3
+ help
+ In some cases, we need to enforce a hard limit on how big the U-Boot
+ image itself can be.
+
+config BOARD_SIZE_LIMIT
+ int "Maximum size of the U-Boot image in bytes"
+ default 1048576 if RCAR_GEN3
+ depends on HAS_BOARD_SIZE_LIMIT
+ help
+ Maximum size of the U-Boot image. When defined, the build system
+ checks that the actual size does not exceed it. This does not
+ include SPL nor TPL, on platforms that use that functionality, they
+ have a separate option to restict size.
+
config SYS_CUSTOM_LDSCRIPT
bool "Use a custom location for the U-Boot linker script"
help
diff --git a/README b/README
index f31fcd73f1..04e3fad0b8 100644
--- a/README
+++ b/README
@@ -2183,11 +2183,6 @@ use the "saveenv" command to store a valid environment.
later, once stdio is running and output goes to the LCD, if
present.
-- CONFIG_BOARD_SIZE_LIMIT:
- Maximum size of the U-Boot image. When defined, the
- build system checks that the actual size does not
- exceed it.
-
Low Level (hardware related) configuration options:
---------------------------------------------------
diff --git a/configs/bk4r1_defconfig b/configs/bk4r1_defconfig
index d41a19c88e..d00333995a 100644
--- a/configs/bk4r1_defconfig
+++ b/configs/bk4r1_defconfig
@@ -17,6 +17,8 @@ CONFIG_ENV_OFFSET_REDUND=0x220000
CONFIG_TARGET_BK4R1=y
CONFIG_SYS_MEMTEST_START=0x80010000
CONFIG_SYS_MEMTEST_END=0x87c00000
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=520192
CONFIG_SYS_LOAD_ADDR=0x82000000
CONFIG_FIT=y
CONFIG_BOOTDELAY=3
diff --git a/configs/colibri_pxa270_defconfig b/configs/colibri_pxa270_defconfig
index c2c0a2bc4a..e629c31857 100644
--- a/configs/colibri_pxa270_defconfig
+++ b/configs/colibri_pxa270_defconfig
@@ -9,6 +9,8 @@ CONFIG_NR_DRAM_BANKS=1
CONFIG_ENV_SIZE=0x40000
CONFIG_ENV_SECT_SIZE=0x40000
CONFIG_ENV_VARS_UBOOT_CONFIG=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=262144
CONFIG_SYS_LOAD_ADDR=0xa0000000
CONFIG_TIMESTAMP=y
CONFIG_SYS_MONITOR_BASE=0x00000000
diff --git a/configs/colibri_vf_defconfig b/configs/colibri_vf_defconfig
index ce6b3315e3..43d8023426 100644
--- a/configs/colibri_vf_defconfig
+++ b/configs/colibri_vf_defconfig
@@ -14,6 +14,8 @@ CONFIG_TARGET_COLIBRI_VF=y
CONFIG_SYS_MEMTEST_START=0x80010000
CONFIG_SYS_MEMTEST_END=0x87c00000
CONFIG_ENV_VARS_UBOOT_CONFIG=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=520192
CONFIG_SYS_LOAD_ADDR=0x80008000
CONFIG_BOOTDELAY=1
CONFIG_USE_BOOTCOMMAND=y
diff --git a/configs/ea-lpc3250devkitv2_defconfig b/configs/ea-lpc3250devkitv2_defconfig
index 8d9a905c42..ba8c796686 100644
--- a/configs/ea-lpc3250devkitv2_defconfig
+++ b/configs/ea-lpc3250devkitv2_defconfig
@@ -9,6 +9,8 @@ CONFIG_NR_DRAM_BANKS=1
CONFIG_TARGET_EA_LPC3250DEVKITV2=y
CONFIG_DEFAULT_DEVICE_TREE="lpc3250-ea3250"
CONFIG_DISTRO_DEFAULTS=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=1048575
CONFIG_SYS_LOAD_ADDR=0x80100000
# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
# CONFIG_AUTOBOOT is not set
diff --git a/configs/gardena-smart-gateway-mt7688_defconfig b/configs/gardena-smart-gateway-mt7688_defconfig
index 2bd302f76b..2b8ede6745 100644
--- a/configs/gardena-smart-gateway-mt7688_defconfig
+++ b/configs/gardena-smart-gateway-mt7688_defconfig
@@ -22,6 +22,8 @@ CONFIG_RESTORE_EXCEPTION_VECTOR_BASE=y
# CONFIG_MIPS_BOOT_ENV_LEGACY is not set
CONFIG_MIPS_BOOT_FDT=y
CONFIG_ENV_VARS_UBOOT_CONFIG=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=655360
CONFIG_SYS_LOAD_ADDR=0x80100000
CONFIG_FIT=y
CONFIG_FIT_SIGNATURE=y
diff --git a/configs/guruplug_defconfig b/configs/guruplug_defconfig
index 7116c77cd5..4f7e39cfa5 100644
--- a/configs/guruplug_defconfig
+++ b/configs/guruplug_defconfig
@@ -12,6 +12,8 @@ CONFIG_ENV_OFFSET=0xE0000
CONFIG_DEFAULT_DEVICE_TREE="kirkwood-guruplug-server-plus"
CONFIG_IDENT_STRING="\nMarvell-GuruPlug"
# CONFIG_SYS_MALLOC_F is not set
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=917504
CONFIG_SYS_LOAD_ADDR=0x800000
CONFIG_BOOTDELAY=3
CONFIG_USE_BOOTCOMMAND=y
diff --git a/configs/linkit-smart-7688_defconfig b/configs/linkit-smart-7688_defconfig
index eedc3a2045..a68b3ba8a0 100644
--- a/configs/linkit-smart-7688_defconfig
+++ b/configs/linkit-smart-7688_defconfig
@@ -19,6 +19,8 @@ CONFIG_MIPS_CACHE_DISABLE=y
CONFIG_RESTORE_EXCEPTION_VECTOR_BASE=y
# CONFIG_MIPS_BOOT_ENV_LEGACY is not set
CONFIG_MIPS_BOOT_FDT=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=524288
CONFIG_SYS_LOAD_ADDR=0x80100000
CONFIG_FIT=y
CONFIG_FIT_SIGNATURE=y
diff --git a/configs/mx51evk_defconfig b/configs/mx51evk_defconfig
index 6cf3c5931c..134cb0cf35 100644
--- a/configs/mx51evk_defconfig
+++ b/configs/mx51evk_defconfig
@@ -9,6 +9,8 @@ CONFIG_TARGET_MX51EVK=y
CONFIG_DM_GPIO=y
CONFIG_DEFAULT_DEVICE_TREE="imx51-babbage"
# CONFIG_CMD_BMODE is not set
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=785408
CONFIG_SYS_LOAD_ADDR=0x92000000
CONFIG_USE_BOOTCOMMAND=y
CONFIG_BOOTCOMMAND="mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else run netboot; fi"
diff --git a/configs/mx53loco_defconfig b/configs/mx53loco_defconfig
index e7a4797bd0..9b70a55a2b 100644
--- a/configs/mx53loco_defconfig
+++ b/configs/mx53loco_defconfig
@@ -13,6 +13,8 @@ CONFIG_SYS_I2C_MXC_I2C3=y
CONFIG_DM_GPIO=y
CONFIG_DEFAULT_DEVICE_TREE="imx53-qsb"
# CONFIG_CMD_BMODE is not set
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=785408
CONFIG_SYS_LOAD_ADDR=0x72000000
CONFIG_SUPPORT_RAW_INITRD=y
CONFIG_USE_BOOTCOMMAND=y
diff --git a/configs/mx7ulp_com_defconfig b/configs/mx7ulp_com_defconfig
index 2f860f61fd..4e51a791a4 100644
--- a/configs/mx7ulp_com_defconfig
+++ b/configs/mx7ulp_com_defconfig
@@ -9,6 +9,8 @@ CONFIG_DM_GPIO=y
CONFIG_DEFAULT_DEVICE_TREE="imx7ulp-com"
CONFIG_LDO_ENABLED_MODE=y
CONFIG_TARGET_MX7ULP_COM=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=785408
CONFIG_SYS_LOAD_ADDR=0x60800000
CONFIG_USE_BOOTCOMMAND=y
CONFIG_BOOTCOMMAND="if run loadimage; then run mmcboot; fi"
diff --git a/configs/openrd_base_defconfig b/configs/openrd_base_defconfig
index 3f0de34850..73ba408d84 100644
--- a/configs/openrd_base_defconfig
+++ b/configs/openrd_base_defconfig
@@ -13,6 +13,8 @@ CONFIG_ENV_OFFSET=0x80000
CONFIG_DEFAULT_DEVICE_TREE="kirkwood-openrd-base"
CONFIG_IDENT_STRING="\nOpenRD-Base"
# CONFIG_SYS_MALLOC_F is not set
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=524288
CONFIG_SYS_LOAD_ADDR=0x800000
CONFIG_BOOTDELAY=3
CONFIG_USE_BOOTCOMMAND=y
diff --git a/configs/openrd_client_defconfig b/configs/openrd_client_defconfig
index 50f66c5487..faf51464e5 100644
--- a/configs/openrd_client_defconfig
+++ b/configs/openrd_client_defconfig
@@ -14,6 +14,8 @@ CONFIG_ENV_OFFSET=0x80000
CONFIG_DEFAULT_DEVICE_TREE="kirkwood-openrd-client"
CONFIG_IDENT_STRING="\nOpenRD-Client"
# CONFIG_SYS_MALLOC_F is not set
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=524288
CONFIG_SYS_LOAD_ADDR=0x800000
CONFIG_BOOTDELAY=3
CONFIG_USE_BOOTCOMMAND=y
diff --git a/configs/openrd_ultimate_defconfig b/configs/openrd_ultimate_defconfig
index f552234be0..597e694a16 100644
--- a/configs/openrd_ultimate_defconfig
+++ b/configs/openrd_ultimate_defconfig
@@ -14,6 +14,8 @@ CONFIG_ENV_OFFSET=0x80000
CONFIG_DEFAULT_DEVICE_TREE="kirkwood-openrd-ultimate"
CONFIG_IDENT_STRING="\nOpenRD-Ultimate"
# CONFIG_SYS_MALLOC_F is not set
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=524288
CONFIG_SYS_LOAD_ADDR=0x800000
CONFIG_BOOTDELAY=3
CONFIG_USE_BOOTCOMMAND=y
diff --git a/configs/pcm052_defconfig b/configs/pcm052_defconfig
index ca56f93102..292b6b2cd4 100644
--- a/configs/pcm052_defconfig
+++ b/configs/pcm052_defconfig
@@ -13,6 +13,8 @@ CONFIG_ENV_OFFSET_REDUND=0xC0000
CONFIG_TARGET_PCM052=y
CONFIG_SYS_MEMTEST_START=0x80010000
CONFIG_SYS_MEMTEST_END=0x87c00000
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=520192
CONFIG_SYS_LOAD_ADDR=0x82000000
CONFIG_BOOTDELAY=3
CONFIG_USE_BOOTCOMMAND=y
diff --git a/configs/pico-dwarf-imx6ul_defconfig b/configs/pico-dwarf-imx6ul_defconfig
index 3a03081247..8e1c25def9 100644
--- a/configs/pico-dwarf-imx6ul_defconfig
+++ b/configs/pico-dwarf-imx6ul_defconfig
@@ -19,6 +19,8 @@ CONFIG_SPL_LIBDISK_SUPPORT=y
CONFIG_SYS_MEMTEST_START=0x80000000
CONFIG_SYS_MEMTEST_END=0x88000000
CONFIG_DISTRO_DEFAULTS=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=715776
CONFIG_BOOTDELAY=3
CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
CONFIG_DEFAULT_FDT_FILE="imx6ul-pico-dwarf.dtb"
diff --git a/configs/pico-dwarf-imx7d_defconfig b/configs/pico-dwarf-imx7d_defconfig
index c0d2bfe694..90b607b90d 100644
--- a/configs/pico-dwarf-imx7d_defconfig
+++ b/configs/pico-dwarf-imx7d_defconfig
@@ -21,6 +21,8 @@ CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
CONFIG_IMX_RDC=y
CONFIG_IMX_BOOTAUX=y
CONFIG_DISTRO_DEFAULTS=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=715776
CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
CONFIG_DEFAULT_FDT_FILE="imx7d-pico-dwarf.dtb"
CONFIG_SPL_I2C=y
diff --git a/configs/pico-hobbit-imx6ul_defconfig b/configs/pico-hobbit-imx6ul_defconfig
index 0c5555e2e4..2841466685 100644
--- a/configs/pico-hobbit-imx6ul_defconfig
+++ b/configs/pico-hobbit-imx6ul_defconfig
@@ -20,6 +20,8 @@ CONFIG_SPL_LIBDISK_SUPPORT=y
CONFIG_SYS_MEMTEST_START=0x80000000
CONFIG_SYS_MEMTEST_END=0x88000000
CONFIG_DISTRO_DEFAULTS=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=715776
CONFIG_BOOTDELAY=3
CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
CONFIG_DEFAULT_FDT_FILE="imx6ul-pico-hobbit.dtb"
diff --git a/configs/pico-hobbit-imx7d_defconfig b/configs/pico-hobbit-imx7d_defconfig
index d708f2043a..1342d85011 100644
--- a/configs/pico-hobbit-imx7d_defconfig
+++ b/configs/pico-hobbit-imx7d_defconfig
@@ -21,6 +21,8 @@ CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
CONFIG_IMX_RDC=y
CONFIG_IMX_BOOTAUX=y
CONFIG_DISTRO_DEFAULTS=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=715776
CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
CONFIG_DEFAULT_FDT_FILE="imx7d-pico-hobbit.dtb"
CONFIG_SPL_I2C=y
diff --git a/configs/pico-imx6_defconfig b/configs/pico-imx6_defconfig
index 44d9295444..0bd66135d9 100644
--- a/configs/pico-imx6_defconfig
+++ b/configs/pico-imx6_defconfig
@@ -18,6 +18,8 @@ CONFIG_SPL_SERIAL=y
CONFIG_SPL=y
CONFIG_SPL_LIBDISK_SUPPORT=y
CONFIG_DISTRO_DEFAULTS=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=715776
CONFIG_FIT=y
CONFIG_SPL_FIT_PRINT=y
CONFIG_SPL_LOAD_FIT=y
diff --git a/configs/pico-imx6ul_defconfig b/configs/pico-imx6ul_defconfig
index 6a26174f0c..c198a660ea 100644
--- a/configs/pico-imx6ul_defconfig
+++ b/configs/pico-imx6ul_defconfig
@@ -20,6 +20,8 @@ CONFIG_SPL_LIBDISK_SUPPORT=y
CONFIG_SYS_MEMTEST_START=0x80000000
CONFIG_SYS_MEMTEST_END=0x88000000
CONFIG_DISTRO_DEFAULTS=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=715776
CONFIG_BOOTDELAY=3
CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
CONFIG_DEFAULT_FDT_FILE="ask"
diff --git a/configs/pico-imx7d_bl33_defconfig b/configs/pico-imx7d_bl33_defconfig
index 56df161d9b..09117e9a4e 100644
--- a/configs/pico-imx7d_bl33_defconfig
+++ b/configs/pico-imx7d_bl33_defconfig
@@ -19,6 +19,8 @@ CONFIG_SPL=y
CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
CONFIG_SYS_MEMTEST_START=0x80000000
CONFIG_SYS_MEMTEST_END=0xa0000000
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=715776
CONFIG_FIT=y
CONFIG_FIT_SIGNATURE=y
CONFIG_FIT_VERBOSE=y
diff --git a/configs/pico-imx7d_defconfig b/configs/pico-imx7d_defconfig
index 2f07308cff..6473aaaede 100644
--- a/configs/pico-imx7d_defconfig
+++ b/configs/pico-imx7d_defconfig
@@ -21,6 +21,8 @@ CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
CONFIG_IMX_RDC=y
CONFIG_IMX_BOOTAUX=y
CONFIG_DISTRO_DEFAULTS=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=715776
CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
CONFIG_DEFAULT_FDT_FILE="ask"
CONFIG_SPL_I2C=y
diff --git a/configs/pico-nymph-imx7d_defconfig b/configs/pico-nymph-imx7d_defconfig
index c0d2bfe694..90b607b90d 100644
--- a/configs/pico-nymph-imx7d_defconfig
+++ b/configs/pico-nymph-imx7d_defconfig
@@ -21,6 +21,8 @@ CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
CONFIG_IMX_RDC=y
CONFIG_IMX_BOOTAUX=y
CONFIG_DISTRO_DEFAULTS=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=715776
CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
CONFIG_DEFAULT_FDT_FILE="imx7d-pico-dwarf.dtb"
CONFIG_SPL_I2C=y
diff --git a/configs/pico-pi-imx6ul_defconfig b/configs/pico-pi-imx6ul_defconfig
index 690c1b4d33..31f37dab26 100644
--- a/configs/pico-pi-imx6ul_defconfig
+++ b/configs/pico-pi-imx6ul_defconfig
@@ -20,6 +20,8 @@ CONFIG_SPL_LIBDISK_SUPPORT=y
CONFIG_SYS_MEMTEST_START=0x80000000
CONFIG_SYS_MEMTEST_END=0x88000000
CONFIG_DISTRO_DEFAULTS=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=715776
CONFIG_BOOTDELAY=3
CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
CONFIG_DEFAULT_FDT_FILE="imx6ul-pico-pi.dtb"
diff --git a/configs/pico-pi-imx7d_defconfig b/configs/pico-pi-imx7d_defconfig
index cd759a8138..812aa24b09 100644
--- a/configs/pico-pi-imx7d_defconfig
+++ b/configs/pico-pi-imx7d_defconfig
@@ -21,6 +21,8 @@ CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
CONFIG_IMX_RDC=y
CONFIG_IMX_BOOTAUX=y
CONFIG_DISTRO_DEFAULTS=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=715776
CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
CONFIG_DEFAULT_FDT_FILE="imx7d-pico-pi.dtb"
CONFIG_SPL_I2C=y
diff --git a/configs/sheevaplug_defconfig b/configs/sheevaplug_defconfig
index db941872cf..483b5ca190 100644
--- a/configs/sheevaplug_defconfig
+++ b/configs/sheevaplug_defconfig
@@ -13,6 +13,8 @@ CONFIG_ENV_OFFSET=0x80000
CONFIG_DEFAULT_DEVICE_TREE="kirkwood-sheevaplug"
CONFIG_IDENT_STRING="\nMarvell-Sheevaplug"
# CONFIG_SYS_MALLOC_F is not set
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=524288
CONFIG_SYS_LOAD_ADDR=0x800000
CONFIG_BOOTDELAY=3
CONFIG_USE_BOOTCOMMAND=y
diff --git a/configs/tbs2910_defconfig b/configs/tbs2910_defconfig
index 4d6ca4f20b..993997ba7a 100644
--- a/configs/tbs2910_defconfig
+++ b/configs/tbs2910_defconfig
@@ -15,6 +15,8 @@ CONFIG_AHCI=y
CONFIG_SYS_MEMTEST_START=0x10000000
CONFIG_SYS_MEMTEST_END=0x2f400000
CONFIG_LTO=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=392192
CONFIG_SUPPORT_RAW_INITRD=y
CONFIG_BOOTDELAY=3
CONFIG_USE_BOOTCOMMAND=y
diff --git a/configs/vf610twr_defconfig b/configs/vf610twr_defconfig
index 787ce4d9b4..4d2aaeeece 100644
--- a/configs/vf610twr_defconfig
+++ b/configs/vf610twr_defconfig
@@ -13,6 +13,8 @@ CONFIG_DM_GPIO=y
CONFIG_DEFAULT_DEVICE_TREE="vf610-twr"
CONFIG_SYS_MEMTEST_START=0x80010000
CONFIG_SYS_MEMTEST_END=0x87c00000
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=520192
CONFIG_SYS_LOAD_ADDR=0x82000000
CONFIG_BOOTDELAY=3
CONFIG_USE_BOOTCOMMAND=y
diff --git a/configs/vf610twr_nand_defconfig b/configs/vf610twr_nand_defconfig
index 0063575e53..f282a1df92 100644
--- a/configs/vf610twr_nand_defconfig
+++ b/configs/vf610twr_nand_defconfig
@@ -13,6 +13,8 @@ CONFIG_DM_GPIO=y
CONFIG_DEFAULT_DEVICE_TREE="vf610-twr"
CONFIG_SYS_MEMTEST_START=0x80010000
CONFIG_SYS_MEMTEST_END=0x87c00000
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=520192
CONFIG_SYS_LOAD_ADDR=0x82000000
CONFIG_BOOTDELAY=3
CONFIG_USE_BOOTCOMMAND=y
diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index 306c7a4ec3..949790c865 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -10,6 +10,8 @@ CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
CONFIG_IMX_HAB=y
CONFIG_SYS_MEMTEST_START=0x80000000
CONFIG_SYS_MEMTEST_END=0xa0000000
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=785408
CONFIG_FIT=y
CONFIG_FIT_SIGNATURE=y
CONFIG_FIT_VERBOSE=y
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 5f4f8d010d..ab7299c988 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -15,6 +15,8 @@ CONFIG_IMX_BOOTAUX=y
CONFIG_IMX_HAB=y
CONFIG_SYS_MEMTEST_START=0x80000000
CONFIG_SYS_MEMTEST_END=0xa0000000
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=785408
CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_USE_BOOTCOMMAND=y
diff --git a/include/configs/bk4r1.h b/include/configs/bk4r1.h
index 762d1980bd..bd07b4b031 100644
--- a/include/configs/bk4r1.h
+++ b/include/configs/bk4r1.h
@@ -62,9 +62,6 @@
#define CONFIG_SYS_FSL_QSPI_LE
#endif
-/* We boot from the gfxRAM area of the OCRAM. */
-#define CONFIG_BOARD_SIZE_LIMIT 520192
-
/* boot command, including the target-defined one if any */
/* Extra env settings (including the target-defined ones if any) */
diff --git a/include/configs/colibri_pxa270.h b/include/configs/colibri_pxa270.h
index 99645f3f7a..a5ba916279 100644
--- a/include/configs/colibri_pxa270.h
+++ b/include/configs/colibri_pxa270.h
@@ -12,8 +12,6 @@
/*
* High Level Board Configuration Options
*/
-/* Avoid overwriting factory configuration block */
-#define CONFIG_BOARD_SIZE_LIMIT 0x40000
/*
* Environment settings
diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h
index 2e7b640357..24851494f5 100644
--- a/include/configs/colibri_vf.h
+++ b/include/configs/colibri_vf.h
@@ -23,9 +23,6 @@
#define CONFIG_FDTADDR 0x84000000
-/* We boot from the gfxRAM area of the OCRAM. */
-#define CONFIG_BOARD_SIZE_LIMIT 520192
-
#define MEM_LAYOUT_ENV_SETTINGS \
"bootm_size=0x10000000\0" \
"fdt_addr_r=0x82000000\0" \
diff --git a/include/configs/ea-lpc3250devkitv2.h b/include/configs/ea-lpc3250devkitv2.h
index 220c3c44d6..2d0e787879 100644
--- a/include/configs/ea-lpc3250devkitv2.h
+++ b/include/configs/ea-lpc3250devkitv2.h
@@ -11,11 +11,6 @@
#include <asm/arch/cpu.h>
/*
- * SoC and board defines
- */
-#define CONFIG_BOARD_SIZE_LIMIT 0x000fffff /* maximum allowable size for full U-Boot binary */
-
-/*
* RAM
*/
#define CONFIG_SYS_SDRAM_BASE EMC_DYCS0_BASE
diff --git a/include/configs/gardena-smart-gateway-mt7688.h b/include/configs/gardena-smart-gateway-mt7688.h
index 8b80841cdb..269bb93272 100644
--- a/include/configs/gardena-smart-gateway-mt7688.h
+++ b/include/configs/gardena-smart-gateway-mt7688.h
@@ -46,10 +46,4 @@
/* Environment settings */
-/*
- * Environment is right behind U-Boot in flash. Make sure U-Boot
- * doesn't grow into the environment area.
- */
-#define CONFIG_BOARD_SIZE_LIMIT CONFIG_ENV_OFFSET
-
#endif /* __CONFIG_GARDENA_SMART_GATEWAY_H */
diff --git a/include/configs/guruplug.h b/include/configs/guruplug.h
index 25c5a97c69..d5655e4ada 100644
--- a/include/configs/guruplug.h
+++ b/include/configs/guruplug.h
@@ -18,11 +18,6 @@
* max 4k env size is enough, but in case of nand
* it has to be rounded to sector size
*/
-/*
- * Environment is right behind U-Boot in flash. Make sure U-Boot
- * doesn't grow into the environment area.
- */
-#define CONFIG_BOARD_SIZE_LIMIT CONFIG_ENV_OFFSET
/*
* Default environment variables
diff --git a/include/configs/linkit-smart-7688.h b/include/configs/linkit-smart-7688.h
index 4a19fb881d..86bad6fa03 100644
--- a/include/configs/linkit-smart-7688.h
+++ b/include/configs/linkit-smart-7688.h
@@ -47,10 +47,4 @@
/* Environment settings */
-/*
- * Environment is right behind U-Boot in flash. Make sure U-Boot
- * doesn't grow into the environment area.
- */
-#define CONFIG_BOARD_SIZE_LIMIT CONFIG_ENV_OFFSET
-
#endif /* __CONFIG_LINKIT_SMART_7688_H */
diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h
index f299cc06d3..ccfe292f6c 100644
--- a/include/configs/mx51evk.h
+++ b/include/configs/mx51evk.h
@@ -130,17 +130,4 @@
* environment organization
*/
-/*
- * Environment starts at CONFIG_ENV_OFFSET=0xC0000 = 768k = 768 * 1024 = 786432
- *
- * Detect overlap between U-Boot image and environment area in build-time
- *
- * CONFIG_BOARD_SIZE_LIMIT = CONFIG_ENV_OFFSET - u-boot.imx offset
- * CONFIG_BOARD_SIZE_LIMIT = 768k - 1k = 767k = 785408
- *
- * Currently CONFIG_BOARD_SIZE_LIMIT does not handle expressions, so
- * write the direct value here
- */
-#define CONFIG_BOARD_SIZE_LIMIT 785408
-
#endif
diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index 43455aa531..8b9f0a2901 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -106,18 +106,6 @@
#define CONFIG_SYS_INIT_SP_ADDR \
(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
-/* Environment starts at 768k = 768 * 1024 = 786432 */
-/*
- * Detect overlap between U-Boot image and environment area in build-time
- *
- * CONFIG_BOARD_SIZE_LIMIT = CONFIG_ENV_OFFSET - u-boot.imx offset
- * CONFIG_BOARD_SIZE_LIMIT = 768k - 1k = 767k = 785408
- *
- * Currently CONFIG_BOARD_SIZE_LIMIT does not handle expressions, so
- * write the direct value here
- */
-#define CONFIG_BOARD_SIZE_LIMIT 785408
-
#ifdef CONFIG_CMD_SATA
#define CONFIG_DWC_AHSATA_PORT_ID 0
#define CONFIG_DWC_AHSATA_BASE_ADDR SATA_BASE_ADDR
diff --git a/include/configs/mx7ulp_com.h b/include/configs/mx7ulp_com.h
index d3ba144927..ce6afcde2a 100644
--- a/include/configs/mx7ulp_com.h
+++ b/include/configs/mx7ulp_com.h
@@ -17,16 +17,6 @@
#define CONFIG_SYS_BOOTM_LEN 0x1000000
-/*
- * Detect overlap between U-Boot image and environment area in build-time
- *
- * CONFIG_BOARD_SIZE_LIMIT = CONFIG_ENV_OFFSET - u-boot-dtb.imx offset
- * CONFIG_BOARD_SIZE_LIMIT = 768k - 1k = 767k = 785408
- *
- * Currently CONFIG_BOARD_SIZE_LIMIT does not handle expressions, so
- * write the direct value here
- */
-#define CONFIG_BOARD_SIZE_LIMIT 785408
#define CONFIG_MMCROOT "/dev/mmcblk0p2"
/* Using ULP WDOG for reset */
diff --git a/include/configs/openrd.h b/include/configs/openrd.h
index 7dad002f3b..006f06e6af 100644
--- a/include/configs/openrd.h
+++ b/include/configs/openrd.h
@@ -22,11 +22,6 @@
* max 4k env size is enough, but in case of nand
* it has to be rounded to sector size
*/
-/*
- * Environment is right behind U-Boot in flash. Make sure U-Boot
- * doesn't grow into the environment area.
- */
-#define CONFIG_BOARD_SIZE_LIMIT CONFIG_ENV_OFFSET
/*
* Default environment variables
diff --git a/include/configs/pcm052.h b/include/configs/pcm052.h
index fd4a0b1aa8..79b69dfe17 100644
--- a/include/configs/pcm052.h
+++ b/include/configs/pcm052.h
@@ -16,9 +16,6 @@
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-/* We boot from the gfxRAM area of the OCRAM. */
-#define CONFIG_BOARD_SIZE_LIMIT 520192
-
/* if no target-specific extra environment settings were defined by the
target, define an empty one */
#ifndef PCM052_EXTRA_ENV_SETTINGS
diff --git a/include/configs/pico-imx6.h b/include/configs/pico-imx6.h
index 536e07b4da..855d799348 100644
--- a/include/configs/pico-imx6.h
+++ b/include/configs/pico-imx6.h
@@ -116,18 +116,6 @@
/* Environment organization */
-/* Environment starts at 768k = 768 * 1024 = 786432 */
-/*
- * Detect overlap between U-Boot image and environment area in build-time
- *
- * CONFIG_BOARD_SIZE_LIMIT = CONFIG_ENV_OFFSET - u-boot.img offset
- * CONFIG_BOARD_SIZE_LIMIT = 768k - 69k = 699k = 715776
- *
- * Currently CONFIG_BOARD_SIZE_LIMIT does not handle expressions, so
- * write the direct value here
- */
-#define CONFIG_BOARD_SIZE_LIMIT 715776
-
/* Ethernet Configuration */
#define IMX_FEC_BASE ENET_BASE_ADDR
#define CONFIG_FEC_MXC_PHYADDR 1
diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h
index 2646f19cef..39be433570 100644
--- a/include/configs/pico-imx6ul.h
+++ b/include/configs/pico-imx6ul.h
@@ -116,17 +116,6 @@
(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
/* environment organization */
-/* Environment starts at 768k = 768 * 1024 = 786432 */
-/*
- * Detect overlap between U-Boot image and environment area in build-time
- *
- * CONFIG_BOARD_SIZE_LIMIT = CONFIG_ENV_OFFSET - u-boot.img offset
- * CONFIG_BOARD_SIZE_LIMIT = 768k - 69k = 699k = 715776
- *
- * Currently CONFIG_BOARD_SIZE_LIMIT does not handle expressions, so
- * write the direct value here
- */
-#define CONFIG_BOARD_SIZE_LIMIT 715776
#ifdef CONFIG_DM_VIDEO
#define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
diff --git a/include/configs/pico-imx7d.h b/include/configs/pico-imx7d.h
index a90befc011..06fd78f9da 100644
--- a/include/configs/pico-imx7d.h
+++ b/include/configs/pico-imx7d.h
@@ -122,16 +122,6 @@
/* FLASH and environment organization */
/* Environment starts at 768k = 768 * 1024 = 786432 */
-/*
- * Detect overlap between U-Boot image and environment area in build-time
- *
- * CONFIG_BOARD_SIZE_LIMIT = CONFIG_ENV_OFFSET - u-boot.img offset
- * CONFIG_BOARD_SIZE_LIMIT = 768k - 69k = 699k = 715776
- *
- * Currently CONFIG_BOARD_SIZE_LIMIT does not handle expressions, so
- * write the direct value here
- */
-#define CONFIG_BOARD_SIZE_LIMIT 715776
#define CONFIG_SYS_FSL_USDHC_NUM 2
diff --git a/include/configs/rcar-gen3-common.h b/include/configs/rcar-gen3-common.h
index 2422f03792..c3759ed19b 100644
--- a/include/configs/rcar-gen3-common.h
+++ b/include/configs/rcar-gen3-common.h
@@ -44,9 +44,6 @@
#define CONFIG_SYS_MONITOR_LEN (1 * 1024 * 1024)
#define CONFIG_SYS_BOOTM_LEN (64 << 20)
-/* The HF/QSPI layout permits up to 1 MiB large bootloader blob */
-#define CONFIG_BOARD_SIZE_LIMIT 1048576
-
/* ENV setting */
#define CONFIG_EXTRA_ENV_SETTINGS \
diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
index 4499a63aed..0cc58c3a7d 100644
--- a/include/configs/sheevaplug.h
+++ b/include/configs/sheevaplug.h
@@ -18,11 +18,6 @@
* max 4k env size is enough, but in case of nand
* it has to be rounded to sector size
*/
-/*
- * Environment is right behind U-Boot in flash. Make sure U-Boot
- * doesn't grow into the environment area.
- */
-#define CONFIG_BOARD_SIZE_LIMIT CONFIG_ENV_OFFSET
/*
* Default environment variables
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index c467e9bd15..a9031035d7 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -98,15 +98,6 @@
/* mmc config */
#define CONFIG_MMC_SUNXI_SLOT 0
-#if defined(CONFIG_ENV_IS_IN_MMC)
-/*
- * This is actually (CONFIG_ENV_OFFSET -
- * (CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)), but the value will be used
- * directly in a makefile, without the preprocessor expansion.
- */
-#define CONFIG_BOARD_SIZE_LIMIT 0x7e000
-#endif
-
#define CONFIG_SYS_MMC_MAX_DEVICE 4
/*
diff --git a/include/configs/tbs2910.h b/include/configs/tbs2910.h
index 065b406e2e..b7a94812f3 100644
--- a/include/configs/tbs2910.h
+++ b/include/configs/tbs2910.h
@@ -55,8 +55,6 @@
#endif /* CONFIG_CMD_USB_MASS_STORAGE */
#endif /* CONFIG_CMD_USB */
-#define CONFIG_BOARD_SIZE_LIMIT 392192 /* (CONFIG_ENV_OFFSET - 1024) */
-
#define CONFIG_EXTRA_ENV_SETTINGS \
BOOTENV \
"bootargs_mmc1=console=ttymxc0,115200 di0_primary console=tty1\0" \
diff --git a/include/configs/vf610twr.h b/include/configs/vf610twr.h
index ebae8223fe..db7c8be7ce 100644
--- a/include/configs/vf610twr.h
+++ b/include/configs/vf610twr.h
@@ -29,9 +29,6 @@
/* I2C Configs */
#define CONFIG_SYS_SPD_BUS_NUM 0
-/* We boot from the gfxRAM area of the OCRAM. */
-#define CONFIG_BOARD_SIZE_LIMIT 520192
-
/*
* We do have 128MB of memory on the Vybrid Tower board. Leave the last
* 16MB alone to avoid conflicts with Cortex-M4 firmwares running from
diff --git a/include/configs/warp7.h b/include/configs/warp7.h
index 83ee1784ce..b3c9f14c8f 100644
--- a/include/configs/warp7.h
+++ b/include/configs/warp7.h
@@ -94,19 +94,6 @@
#define CONFIG_SYS_INIT_SP_ADDR \
(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
-/*
- * Environment starts at CONFIG_ENV_OFFSET= 0xC0000 = 768k = 768*1024 = 786432
- *
- * Detect overlap between U-Boot image and environment area in build-time
- *
- * CONFIG_BOARD_SIZE_LIMIT = CONFIG_ENV_OFFSET - u-boot.imx offset
- * CONFIG_BOARD_SIZE_LIMIT = 768k - 1k = 767k = 785408
- *
- * Currently CONFIG_BOARD_SIZE_LIMIT does not handle expressions, so
- * write the direct value here
- */
-#define CONFIG_BOARD_SIZE_LIMIT 785408
-
/* environment organization */
#define CONFIG_SYS_FSL_USDHC_NUM 1