aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorSean Anderson <seanga2@gmail.com>2023-11-08 11:48:43 -0500
committerTom Rini <trini@konsulko.com>2023-11-16 13:49:14 -0500
commit5271e359a46cc6a60d0048576326e2fa1527f231 (patch)
tree4eac04fe7c7fed86c53ff24c460df5827d623be2 /arch/arm/mach-imx
parentafdd2d98c29c443f348fd88198e59b78d50f4e2c (diff)
downloadu-boot-5271e359a46cc6a60d0048576326e2fa1527f231.zip
u-boot-5271e359a46cc6a60d0048576326e2fa1527f231.tar.gz
u-boot-5271e359a46cc6a60d0048576326e2fa1527f231.tar.bz2
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>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/spl_imx_romapi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/arm/mach-imx/spl_imx_romapi.c b/arch/arm/mach-imx/spl_imx_romapi.c
index d7f6cb4..9f0968c 100644
--- a/arch/arm/mach-imx/spl_imx_romapi.c
+++ b/arch/arm/mach-imx/spl_imx_romapi.c
@@ -101,7 +101,7 @@ static int spl_romapi_load_image_seekable(struct spl_image_info *spl_image,
struct spl_load_info load;
memset(&load, 0, sizeof(load));
- load.bl_len = pagesize;
+ spl_set_bl_len(&load, pagesize);
load.read = spl_romapi_read_seekable;
return spl_load_simple_fit(spl_image, &load, offset, header);
} else if (IS_ENABLED(CONFIG_SPL_LOAD_IMX_CONTAINER) &&
@@ -109,7 +109,7 @@ static int spl_romapi_load_image_seekable(struct spl_image_info *spl_image,
struct spl_load_info load;
memset(&load, 0, sizeof(load));
- load.bl_len = pagesize;
+ spl_set_bl_len(&load, pagesize);
load.read = spl_romapi_read_seekable;
ret = spl_load_imx_container(spl_image, &load, offset);
@@ -334,7 +334,7 @@ static int spl_romapi_load_image_stream(struct spl_image_info *spl_image,
ss.pagesize = pagesize;
memset(&load, 0, sizeof(load));
- load.bl_len = 1;
+ spl_set_bl_len(&load, 1);
load.read = spl_romapi_read_stream;
load.priv = &ss;
@@ -358,7 +358,7 @@ static int spl_romapi_load_image_stream(struct spl_image_info *spl_image,
printf("ROM download failure %d\n", imagesize);
memset(&load, 0, sizeof(load));
- load.bl_len = 1;
+ spl_set_bl_len(&load, 1);
load.read = spl_ram_load_read;
if (IS_ENABLED(CONFIG_SPL_LOAD_IMX_CONTAINER))