]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
tools: kwbimage: Print image data offset when printing kwbimage header
authorPali Rohár <pali@kernel.org>
Sun, 8 Jan 2023 12:58:26 +0000 (13:58 +0100)
committerStefan Roese <sr@denx.de>
Wed, 1 Mar 2023 05:39:17 +0000 (06:39 +0100)
For all images except SATA is data offset in bytes. For SATA it is in LBA
format (number of sectors). This is how Marvell BootROM interprets it.

Signed-off-by: Pali Rohár <pali@kernel.org>
tools/kwbimage.c

index a5de9855aa569fbf8b639216a9d7291619170e60..5f62ed159c4bff00542ec8dbb6856f9a79d224a8 100644 (file)
@@ -1929,6 +1929,12 @@ static void kwbimage_print_header(const void *ptr)
 
        printf("Data Size:    ");
        genimg_print_size(le32_to_cpu(mhdr->blocksize) - sizeof(uint32_t));
+       printf("Data Offset:  ");
+       if (mhdr->blockid == IBR_HDR_SATA_ID)
+               printf("%u Sector%s (LBA)\n", le32_to_cpu(mhdr->srcaddr),
+                      le32_to_cpu(mhdr->srcaddr) != 1 ? "s" : "");
+       else
+               genimg_print_size(le32_to_cpu(mhdr->srcaddr));
        printf("Load Address: %08x\n", le32_to_cpu(mhdr->destaddr));
        printf("Entry Point:  %08x\n", le32_to_cpu(mhdr->execaddr));
 }