diff options
author | Ye Li <ye.li@nxp.com> | 2018-11-26 18:21:15 -0800 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2018-11-27 02:57:03 -0800 |
commit | c2b3e9b15700ca611fe9399f086c3b035ea2f763 (patch) | |
tree | 6410ce705b6f2e19e4e63de14b0b5fb72c0febb5 /arch | |
parent | 6fc914b2da6810eb392bcb6de20b9cd7baf95e7f (diff) |
MLK-20467 imx8m: Fix issue for booting signed image through uuu
The SPL loads the FIT image FDT part to an address related with the device
block length. This length is 512 for SD/MMC and is 1 for other devices
like SDP, NOR, NAND, SPI, etc.
When signing FIT image, we use fixed address caculated by SD/MMC block length
to sign FDT part. Thus, when booting through uuu, this causes mismatch and
gets authentication failed.
Fix the issue by providing a override function for this FIT buffer address.
When secure boot is enabled, adjust the addresses of other devices to be same
with SD/MMC.
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 710efd3ccb99e144bd30af8e1ee46459b4a54dd6)
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-imx/spl.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c index 4b72160dda..2715b3b3d4 100644 --- a/arch/arm/mach-imx/spl.c +++ b/arch/arm/mach-imx/spl.c @@ -295,6 +295,21 @@ void board_spl_fit_post_load(ulong load_addr, size_t length) hang(); } } + +void* board_spl_fit_buffer_addr(ulong fit_size, int bl_len) +{ + int align_len = ARCH_DMA_MINALIGN - 1; + + /* Some devices like SDP, NOR, NAND, SPI are using bl_len =1, so their fit address + * is different with SD/MMC, this cause mismatch with signed address. Thus, adjust + * the bl_len to align with SD/MMC. + */ + if (bl_len < 512) + bl_len = 512; + + return (void *)((CONFIG_SYS_TEXT_BASE - fit_size - bl_len - + align_len) & ~align_len); +} #endif #if defined(CONFIG_MX6) && defined(CONFIG_SPL_OS_BOOT) |