[PATCH u-boot-marvell 02/11] tools: kwbimage: Explicitly set version also for kwbimage v0

Stefan Roese sr at denx.de
Wed Nov 10 09:23:32 CET 2021


On 08.11.21 18:12, Marek Behún wrote:
> From: Pali Rohár <pali at kernel.org>
> 
> For documentation purposes update struct main_hdr_v0 to include information
> where version of the image must be stored. For kwbimage v0 it obviously
> must be 0. By default all image header memory is initialized to zero,
> therefore this change has no functional effect.
> 
> Signed-off-by: Pali Rohár <pali at kernel.org>
> Signed-off-by: Marek Behún <marek.behun at nic.cz>

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

Thanks,
Stefan

> ---
>   tools/kwbimage.c | 1 +
>   tools/kwbimage.h | 3 ++-
>   2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/kwbimage.c b/tools/kwbimage.c
> index f24d49496b..d29f2cfcce 100644
> --- a/tools/kwbimage.c
> +++ b/tools/kwbimage.c
> @@ -881,6 +881,7 @@ static void *image_create_v0(size_t *imagesz, struct image_tool_params *params,
>   		cpu_to_le32(payloadsz - headersz);
>   	main_hdr->srcaddr   = cpu_to_le32(headersz);
>   	main_hdr->ext       = has_ext;
> +	main_hdr->version   = 0;
>   	main_hdr->destaddr  = cpu_to_le32(params->addr);
>   	main_hdr->execaddr  = cpu_to_le32(params->ep);
>   
> diff --git a/tools/kwbimage.h b/tools/kwbimage.h
> index f1ba95c2fa..f74767e633 100644
> --- a/tools/kwbimage.h
> +++ b/tools/kwbimage.h
> @@ -42,7 +42,8 @@ struct main_hdr_v0 {
>   	uint8_t  nandeccmode;		/* 0x1       */
>   	uint16_t nandpagesize;		/* 0x2-0x3   */
>   	uint32_t blocksize;		/* 0x4-0x7   */
> -	uint32_t rsvd1;			/* 0x8-0xB   */
> +	uint8_t  version;		/* 0x8       */
> +	uint8_t  rsvd1[3];		/* 0x9-0xB   */
>   	uint32_t srcaddr;		/* 0xC-0xF   */
>   	uint32_t destaddr;		/* 0x10-0x13 */
>   	uint32_t execaddr;		/* 0x14-0x17 */
> 

Viele Grüße,
Stefan Roese

-- 
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