]> git.ipfire.org Git - thirdparty/u-boot.git/commit
mkimage: fit: align DTs in external data to 8 Bytes by default
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Thu, 29 Jan 2026 03:53:29 +0000 (04:53 +0100)
committerTom Rini <trini@konsulko.com>
Mon, 2 Feb 2026 15:15:52 +0000 (09:15 -0600)
commit22129bf4733d78da046337440e85a9e49ca1a421
tree6182e2f80e1c1cbc888ea94dfebf9ac2b5fd89e7
parent8bca63d2ed9d73ec2ff83fa76510245e48e29730
mkimage: fit: align DTs in external data to 8 Bytes by default

Unless specified otherwise using the mkimage -B n option, align
DTs in fitImage external data to 8 Bytes, and retain alignment
of everything else to 4 Bytes. This should fulfill the DTspec
requirement, that DTs must be placed at 8 Byte aligned addresses,
even for DTs that are part of fitImage with external data. For
fitImage with embedded data, there is nothing we can do, as the
embedded data are aligned to 4 Bytes, just like any other DT
property.

Replace fdtdec_get_child_count() counting of images with counting
of padding using fdt_for_each_subnode(). This is much more useful,
as the added up padding can be passed directly to calloc() when
allocating the buffer which holds the external data. The image
count is no longer needed.

Adjust the image layouting such, that buf_ptr is incremented to
place the next image at align_size aligned offset. This is done
at the beginning of the loop, once the align_size for current
image can be determined from the current image type.

Update binman test to validate the new 8 Byte alignment.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
tools/binman/ftest.py
tools/fit_image.c