[PATCH u-boot-marvell 03/13] tools: kwboot: Reserve enough space for patching kwbimage in memory

Stefan Roese sr at denx.de
Tue Oct 26 07:42:26 CEST 2021


On 25.10.21 15:12, Marek Behún wrote:
> From: Pali Rohár <pali at kernel.org>
> 
> 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 at kernel.org>
> Reviewed-by: Marek Behún <marek.behun at nic.cz>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan

> ---
>   tools/kwboot.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> 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);
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list