immortalwrt/package/boot/uboot-rockchip/patches/109-rockchip-Align-FIT-image-data-to-SD-MMC-block-length.patch
Tianling Shen 7e2430f784
uboot-rockchip: backport fixes for rkbin
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-02-08 03:28:25 +08:00

39 lines
1.3 KiB
Diff

From 4ab080257de13d5e859a614bd56c78ff30688588 Mon Sep 17 00:00:00 2001
From: Jonas Karlman <jonas@kwiboo.se>
Date: Sat, 21 Jan 2023 19:01:39 +0000
Subject: [PATCH] rockchip: Align FIT image data to SD/MMC block length
SPL load FIT images by reading the data aligned to block length.
Block length aligned image data is read directly to the load address.
Unaligned image data is written to an offset of the load address and
then the data is memcpy to the load address.
This adds a small overhead of having to memcpy unaligned data, something
that normally is not an issue.
However, TF-A may have a segment that should be loaded into SRAM, e.g.
vendor TF-A for RK3568 has a 8KiB segment that should be loaded into the
8KiB PMU SRAM. Having the image data for such segment unaligned result
in segment being written to and memcpy from beyond the SRAM boundary, in
the end this results in invalid data in SRAM.
Aligning the FIT and its external data to MMC block length to work
around such issue.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/Makefile
+++ b/Makefile
@@ -1450,7 +1450,7 @@ MKIMAGEFLAGS_u-boot.itb =
else
MKIMAGEFLAGS_u-boot.itb = -E
endif
-MKIMAGEFLAGS_u-boot.itb += -B 0x8
+MKIMAGEFLAGS_u-boot.itb += -B 0x200
ifdef U_BOOT_ITS
u-boot.itb: u-boot-nodtb.bin \