tools: kwbimage: Add support for SATA images with non-512 byte block size
authorPali Rohár <pali@kernel.org>
Wed, 29 Mar 2023 19:25:56 +0000 (21:25 +0200)
committerStefan Roese <sr@denx.de>
Thu, 13 Apr 2023 09:34:47 +0000 (11:34 +0200)
commit11af96d7e66030e5dbdd5fffd22eead1f105ed70
treed91b27ffaa57bef205cd241d77883a3b96b391c0
parent62d81d68d2446739374d6d2fa13ab32c8a4923ec
tools: kwbimage: Add support for SATA images with non-512 byte block size

SATA kwbimage contains offsets in block size unit, not in bytes.

Until now kwbimage expected that SATA disk always have block size of 512
bytes. But there are 4K Native SATA disks with block size of 4096 bytes.

New SATA_BLKSZ command allows to specify different block size than 512
bytes and therefore allows to generate kwbimage for disks with different
block sizes.

This change add support for generating SATA images with different block
size. Also it add support for verifying and dumping such images.

Because block size itself is not stored in SATA kwbimage, image
verification is done by checking every possible block size (it is any
power of two value between 512 and 32 kB).

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