]> git.dujemihanovic.xyz Git - u-boot.git/commit
spl: Only support bl_len when we have to
authorSean Anderson <seanga2@gmail.com>
Wed, 8 Nov 2023 16:48:43 +0000 (11:48 -0500)
committerTom Rini <trini@konsulko.com>
Thu, 16 Nov 2023 18:49:14 +0000 (13:49 -0500)
commit5271e359a46cc6a60d0048576326e2fa1527f231
tree4eac04fe7c7fed86c53ff24c460df5827d623be2
parentafdd2d98c29c443f348fd88198e59b78d50f4e2c
spl: Only support bl_len when we have to

Aligning addresses and sizes causes overhead which is unnecessary when we
are not loading from block devices. Remove bl_len when it is not needed.

For example, on iot2050 we save 144 bytes with this patch (once the rest of
this series is applied):

add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-144 (-144)
Function                                     old     new   delta
spl_load_simple_fit                          920     904     -16
load_simple_fit                              496     444     -52
spl_spi_load_image                           384     308     -76
Total: Before=87431, After=87287, chg -0.16%

We use panic() instead of BUILD_BUG_ON in spl_set_bl_len because we still
need to be able to compile it for things like mmc_load_image_raw_sector,
even if that function will not be used.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 files changed:
arch/arm/mach-imx/spl_imx_romapi.c
arch/arm/mach-sunxi/spl_spi_sunxi.c
common/spl/Kconfig
common/spl/spl_blk_fs.c
common/spl/spl_fat.c
common/spl/spl_fit.c
common/spl/spl_imx_container.c
common/spl/spl_legacy.c
common/spl/spl_mmc.c
common/spl/spl_nand.c
common/spl/spl_net.c
common/spl/spl_nor.c
common/spl/spl_ram.c
common/spl/spl_semihosting.c
common/spl/spl_spi.c
common/spl/spl_ymodem.c
drivers/usb/gadget/f_sdp.c
include/spl.h
test/image/Kconfig
test/image/spl_load.c
test/image/spl_load_os.c