aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2021-10-25 15:12:54 +0200
committerStefan Roese <sr@denx.de>2021-11-03 06:45:27 +0100
commit5923ef686a61c7ac15ed990487e4a4fd312ddeec (patch)
tree8fd8b3a41ca91d128c62128f31d37e3b3213ba10
parent2ecca3d0d76023f219ac4350b0112cd19fbdda2e (diff)
downloadu-boot-5923ef686a61c7ac15ed990487e4a4fd312ddeec.zip
u-boot-5923ef686a61c7ac15ed990487e4a4fd312ddeec.tar.gz
u-boot-5923ef686a61c7ac15ed990487e4a4fd312ddeec.tar.bz2
tools: kwboot: Reserve enough space for patching kwbimage in memory
SPI image header and data parts do not have to be aligned to 128 byte xmodem block size. So reserve additional memory for aligning header part and additional memory for aligning data part. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
-rw-r--r--tools/kwboot.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/kwboot.c b/tools/kwboot.c
index c55b410..4e29317 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
@@ -1672,8 +1672,10 @@ main(int argc, char **argv)
else
/* ensure we have enough space for baudrate change code */
after_img_rsv += KWBOOT_BAUDRATE_BIN_HEADER_SZ +
+ KWBOOT_XM_BLKSZ +
sizeof(kwboot_pre_baud_code) +
- sizeof(kwboot_baud_code);
+ sizeof(kwboot_baud_code) +
+ KWBOOT_XM_BLKSZ;
if (imgpath) {
img = kwboot_read_image(imgpath, &size, after_img_rsv);