aboutsummaryrefslogtreecommitdiff
path: root/tools/kwbimage.c
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2023-01-14 14:46:09 +0100
committerStefan Roese <sr@denx.de>2023-03-01 06:39:17 +0100
commite060779e59e79f8b1ff85ae03502e4a19c414608 (patch)
treeb69bee84941100b956e16f883a6016d18fb6925a /tools/kwbimage.c
parentaab9b063b5f6cea143d77dc1d27c004c1f89ab41 (diff)
downloadu-boot-e060779e59e79f8b1ff85ae03502e4a19c414608.zip
u-boot-e060779e59e79f8b1ff85ae03502e4a19c414608.tar.gz
u-boot-e060779e59e79f8b1ff85ae03502e4a19c414608.tar.bz2
tools: kwbimage: Fix dumping NAND_BADBLK_LOCATION
Value 0x0 for NAND_BADBLK_LOCATION/nandbadblklocation means that BBI is on the first or second page and value 0x1 means that BBI is on the last page. This indicates also NAND Flash Technology, value 0x0 is SLC NAND and value 0x1 is MLC NAND. Therefore we need to dump NAND_BADBLK_LOCATION also when it is zero. Note that in v0 images, nandbadblklocation field overlaps with ddrinitdelay field in one union. ddrinitdelay is used in Kirkwood and nandbadblklocation is used in Dove. For Dove images is_v0_ext should be set, so use it to distinguish if nandbadblklocation is available or not. In v1 images there is always nandbadblklocation field. Fixes: 1a8e6b63e24f ("tools: kwbimage: Dump kwbimage config file on '-p -1' option") Signed-off-by: Pali Rohár <pali@kernel.org>
Diffstat (limited to 'tools/kwbimage.c')
-rw-r--r--tools/kwbimage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index a6f6f15..4e9ba5d 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -2187,7 +2187,7 @@ static int kwbimage_generate_config(void *ptr, struct image_tool_params *params)
if (version != 0 && mhdr->blockid == IBR_HDR_NAND_ID)
fprintf(f, "NAND_BLKSZ 0x%x\n", (unsigned)mhdr->nandblocksize);
- if (mhdr->blockid == IBR_HDR_NAND_ID && (mhdr->nandbadblklocation != 0 || is_v0_ext))
+ if (mhdr->blockid == IBR_HDR_NAND_ID && (version != 0 || is_v0_ext))
fprintf(f, "NAND_BADBLK_LOCATION 0x%x\n", (unsigned)mhdr->nandbadblklocation);
if (version == 0 && mhdr->blockid == IBR_HDR_SATA_ID)