Skip to content

tools: kwbimage: Support for parsing extended v0 format

Pali Rohár u-boot 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 2 repliesIn review
  2. v17 patches 10 repliesSuperseded

Changes in v2 from the cover letter

* Implement custom function fls4() as it is not possible to use U-Boot's fls() from asm-generic/bitsops/fls.h file when compling for Mac or Win.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7tools: kwbimage: Define structures for extended kwbimage v0 headerstools/kwbimage.h+42 -90 replies
2/7tools: kwbimage: Fix calculating size of kwbimage v0 headertools/kwbimage.h+13 -10 replies
3/7tools: kwbimage: Add support for dumping extended and binary v0 headerstools/kwbimage.c tools/kwbimage.h+179 -121 reply
4/7tools: kwbimage: Do not show mkimage error message in dumpimagetools/kwbimage.c+1 -10 replies
5/7tools: kwbimage: Add support for NAND_BLKSZ and NAND_BADBLK_LOCATION for v0 imagestools/kwbimage.c+6 -00 replies
6/7tools: kwbimage: Fix help how to extract DDR3 training codetools/kwbimage.c+1 -10 replies
7/7tools: kwbimage: Add me as an author of kwbimagetools/kwbimage.c+2 -00 replies

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchTony DinhStefan Roese
1/7T-b R-b
2/7T-b R-b
3/7T-b R-b
4/7T-b R-b
5/7T-b R-b
6/7T-b R-b
7/7T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH u-boot-marvell v2 0/7] tools: kwbimage: Support for parsing extended v0 format

This patch series extends kwbimage v0 format support by providing ability to dump content of Dove boot images (extension of v0 format). It also fixes recognition of these images in kwboot utility (as it uses macros and inline functions from kwbimage.h header file).

Implementation is based on 88AP510 Functional Specifications, Chapter 5.2 Boot Image Format, which is publicly available at:
https://web.archive.org/web/20120130172443/https://www.marvell.com/application-processors/armada-500/assets/Armada-510-Functional-Spec.pdf

Printing information about image.kwb is possible by:

  $ ./tools/dumpimage -l image.kwb

Dumping image.kwb is possible by commands:

  $ ./tools/dumpimage -T kwbimage -p -1 -o image.cfg image.kwb
  $ ./tools/dumpimage -T kwbimage -p 0 -o data.bin image.kwb
  $ ./tools/dumpimage -T kwbimage -p 1 -o binary1.bin image.kwb
  $ ./tools/dumpimage -T kwbimage -p 2 -o binary2.bin image.kwb
    ...
    (where -p N is Nth binary executable header, e.g. SPL)

Dove images contains more sections which in config file begins with line "MATCH ADDRESS 0xaddr MASK 0xmask VALUE 0xval" and means that section is executed only when check ((readl(addr) & mask) == (val & mask)) passes.

Support for generating these kind of images is not provided. I hope that this patch series helps somebody else to implement it.

Changes in v2:
* Implement custom function fls4() as it is not possible to use U-Boot's fls() from asm-generic/bitsops/fls.h file when compling for Mac or Win.

Pali Rohár (7):
tools: kwbimage: Define structures for extended kwbimage v0 headers
tools: kwbimage: Fix calculating size of kwbimage v0 header
tools: kwbimage: Add support for dumping extended and binary v0
headers
tools: kwbimage: Do not show mkimage error message in dumpimage
tools: kwbimage: Add support for NAND_BLKSZ and NAND_BADBLK_LOCATION
for v0 images
tools: kwbimage: Fix help how to extract DDR3 training code
tools: kwbimage: Add me as an author of kwbimage

 tools/kwbimage.c | 152 ++++++++++++++++++++++++++++++++++++++++++-----
 tools/kwbimage.h | 116 ++++++++++++++++++++++++++++++++----
 2 files changed, 244 insertions(+), 24 deletions(-)
Signature · 1 line
2.20.1