From: Pali Rohár Date: Mon, 25 Oct 2021 13:12:54 +0000 (+0200) Subject: tools: kwboot: Reserve enough space for patching kwbimage in memory X-Git-Tag: v2025.01-rc5-pxa1908~1652^2~17 X-Git-Url: http://git.dujemihanovic.xyz/%7B%7B%20%24style.RelPermalink%20%7D%7D?a=commitdiff_plain;h=5923ef686a61c7ac15ed990487e4a4fd312ddeec;p=u-boot.git 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 Reviewed-by: Marek Behún Reviewed-by: Stefan Roese --- diff --git a/tools/kwboot.c b/tools/kwboot.c index c55b41025b..4e29317f10 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);