diff options
author | Heiko Schocher <hs@denx.de> | 2021-08-17 08:17:18 +0200 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2021-10-07 16:53:50 +0200 |
commit | deb80ec023ecace8afa3dc13c1bef757a247b206 (patch) | |
tree | 8b62ab9142def602c000e0fce5d996e050877675 /common | |
parent | 9de35448580020b526b6e5a8b538a59a64c72f0e (diff) | |
download | u-boot-deb80ec023ecace8afa3dc13c1bef757a247b206.zip u-boot-deb80ec023ecace8afa3dc13c1bef757a247b206.tar.gz u-boot-deb80ec023ecace8afa3dc13c1bef757a247b206.tar.bz2 |
imx: spl: fix imx8m secure boot
cherry-picked from NXP code:
719d665a87c6: ("MLK-20467 imx8m: Fix issue for booting signed image through uuu")
which fixes secure boot on imx8m based boards. Problem was
that FIT header and so IVT header too, was loaded to
memallocated address. So the ivt header address coded
in IVT itself does not fit with the real position.
Signed-off-by: Heiko Schocher <hs@denx.de>
Tested-by: Tim Harvey <tharvey@gateworks.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/spl/spl_fit.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 849e01a..5fe0273 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -538,6 +538,11 @@ static void *spl_get_fit_load_buffer(size_t size) return buf; } +__weak void *board_spl_fit_buffer_addr(ulong fit_size, int sectors, int bl_len) +{ + return spl_get_fit_load_buffer(sectors * bl_len); +} + /* * Weak default function to allow customizing SPL fit loading for load-only * use cases by allowing to skip the parsing/processing of the FIT contents @@ -640,7 +645,7 @@ static int spl_simple_fit_read(struct spl_fit_info *ctx, * For FIT with external data, data is not loaded in this step. */ sectors = get_aligned_image_size(info, size, 0); - buf = spl_get_fit_load_buffer(sectors * info->bl_len); + buf = board_spl_fit_buffer_addr(size, sectors, info->bl_len); count = info->read(info, sector, sectors, buf); ctx->fit = buf; |