diff mbox series

[u-boot-marvell,5/7] tools: kwbimage: Add support for NAND_BLKSZ and NAND_BADBLK_LOCATION for v0 images

Message ID 20220215185925.16060-6-pali@kernel.org
State Superseded
Delegated to: Stefan Roese
Headers show
Series tools: kwbimage: Support for parsing extended v0 format | expand

Commit Message

Pali Rohár Feb. 15, 2022, 6:59 p.m. UTC
These two commands are currently not processed when generating v0 images.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 tools/kwbimage.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Stefan Roese Feb. 16, 2022, 9:48 a.m. UTC | #1
On 2/15/22 19:59, Pali Rohár wrote:
> These two commands are currently not processed when generating v0 images.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>

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

Thanks,
Stefan

> ---
>   tools/kwbimage.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/tools/kwbimage.c b/tools/kwbimage.c
> index 8fd30516c9d4..e455c10dc744 100644
> --- a/tools/kwbimage.c
> +++ b/tools/kwbimage.c
> @@ -985,9 +985,15 @@ static void *image_create_v0(size_t *imagesz, struct image_tool_params *params,
>   	e = image_find_option(IMAGE_CFG_NAND_ECC_MODE);
>   	if (e)
>   		main_hdr->nandeccmode = e->nandeccmode;
> +	e = image_find_option(IMAGE_CFG_NAND_BLKSZ);
> +	if (e)
> +		main_hdr->nandblocksize = e->nandblksz / (64 * 1024);
>   	e = image_find_option(IMAGE_CFG_NAND_PAGESZ);
>   	if (e)
>   		main_hdr->nandpagesize = cpu_to_le16(e->nandpagesz);
> +	e = image_find_option(IMAGE_CFG_NAND_BADBLK_LOCATION);
> +	if (e)
> +		main_hdr->nandbadblklocation = e->nandbadblklocation;
>   	main_hdr->checksum = image_checksum8(image,
>   					     sizeof(struct main_hdr_v0));
>   

Viele Grüße,
Stefan Roese
diff mbox series

Patch

diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index 8fd30516c9d4..e455c10dc744 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -985,9 +985,15 @@  static void *image_create_v0(size_t *imagesz, struct image_tool_params *params,
 	e = image_find_option(IMAGE_CFG_NAND_ECC_MODE);
 	if (e)
 		main_hdr->nandeccmode = e->nandeccmode;
+	e = image_find_option(IMAGE_CFG_NAND_BLKSZ);
+	if (e)
+		main_hdr->nandblocksize = e->nandblksz / (64 * 1024);
 	e = image_find_option(IMAGE_CFG_NAND_PAGESZ);
 	if (e)
 		main_hdr->nandpagesize = cpu_to_le16(e->nandpagesz);
+	e = image_find_option(IMAGE_CFG_NAND_BADBLK_LOCATION);
+	if (e)
+		main_hdr->nandbadblklocation = e->nandbadblklocation;
 	main_hdr->checksum = image_checksum8(image,
 					     sizeof(struct main_hdr_v0));