]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
tools: kwbimage: Fix endianity when dumping NAND_PAGE_SIZE
authorPali Rohár <pali@kernel.org>
Sat, 14 Jan 2023 13:31:00 +0000 (14:31 +0100)
committerStefan Roese <sr@denx.de>
Wed, 1 Mar 2023 05:39:17 +0000 (06:39 +0100)
Fixes: 1a8e6b63e24f ("tools: kwbimage: Dump kwbimage config file on '-p -1' option")
Signed-off-by: Pali Rohár <pali@kernel.org>
tools/kwbimage.c

index 1719b0415da1fec5b5ebc15a3ca0fc393c894864..a6f6f1578c79f368e6f90b8e244a228dc25ecbc4 100644 (file)
@@ -2182,7 +2182,7 @@ static int kwbimage_generate_config(void *ptr, struct image_tool_params *params)
                fprintf(f, "NAND_ECC_MODE %s\n", image_nand_ecc_mode_name(mhdr0->nandeccmode));
 
        if (mhdr->blockid == IBR_HDR_NAND_ID)
-               fprintf(f, "NAND_PAGE_SIZE 0x%x\n", (unsigned)mhdr->nandpagesize);
+               fprintf(f, "NAND_PAGE_SIZE 0x%x\n", (unsigned)le16_to_cpu(mhdr->nandpagesize));
 
        if (version != 0 && mhdr->blockid == IBR_HDR_NAND_ID)
                fprintf(f, "NAND_BLKSZ 0x%x\n", (unsigned)mhdr->nandblocksize);