On 22.10.21 12:37, Pali Rohár wrote:
The NAND_PAGE_SIZE command is already supported by mkimage for v0 images,
but not for v1 images.

A38x and A39x BootROM supports reading NAND flash page size from v1 image
in the same way as Kirkwood BootROM from v0 image. It it documented in A38x
and A39x Functional Specification.

Signed-off-by: Pali Rohár <p...@kernel.org>

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

Thanks,
Stefan

---
  tools/kwbimage.c | 3 +++
  tools/kwbimage.h | 2 +-
  2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index e9324baddba4..67c0c628ae9f 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -1231,6 +1231,9 @@ static void *image_create_v1(size_t *imagesz, struct 
image_tool_params *params,
        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;
diff --git a/tools/kwbimage.h b/tools/kwbimage.h
index 126d482fe722..f1ba95c2fa5b 100644
--- a/tools/kwbimage.h
+++ b/tools/kwbimage.h
@@ -73,7 +73,7 @@ struct ext_hdr_v0 {
  struct main_hdr_v1 {
        uint8_t  blockid;               /* 0x0       */
        uint8_t  flags;                 /* 0x1       */
-       uint16_t reserved2;             /* 0x2-0x3   */
+       uint16_t nandpagesize;          /* 0x2-0x3   */
        uint32_t blocksize;             /* 0x4-0x7   */
        uint8_t  version;               /* 0x8       */
        uint8_t  headersz_msb;          /* 0x9       */



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: s...@denx.de

Reply via email to