aboutsummaryrefslogtreecommitdiff
path: root/tools/kwbimage.c
diff options
context:
space:
mode:
authorPali Rohár2023-01-08 13:58:26 +0100
committerStefan Roese2023-03-01 06:39:17 +0100
commit443894a8215102873b9b653503dc9af79b50247e (patch)
treed4ac4b5afbb608f6640ab3cf64d255633e67049e /tools/kwbimage.c
parent63cf0d726725464ed552f5835fe96401c21c3964 (diff)
tools: kwbimage: Print image data offset when printing kwbimage header
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>
Diffstat (limited to 'tools/kwbimage.c')
-rw-r--r--tools/kwbimage.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index a5de9855aa5..5f62ed159c4 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -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));
}