[PATCH] mkimage: fit: align DTs in external data to 8 Bytes by default

Simon Glass sjg at chromium.org
Tue Feb 3 05:16:43 CET 2026


On Thu, 29 Jan 2026 at 16:55, Marek Vasut
<marek.vasut+renesas at mailbox.org> wrote:
>
> 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 at mailbox.org>
> ---
> Cc: Alper Nebi Yasak <alpernebiyasak at gmail.com>
> Cc: Anshul Dalal <anshuld at ti.com>
> Cc: Aristo Chen <jj251510319013 at gmail.com>
> Cc: Beleswar Padhi <b-padhi at ti.com>
> Cc: Bryan Brattlof <bb at ti.com>
> Cc: Paul HENRYS <paul.henrys_ext at softathome.com>
> Cc: Quentin Schulz <quentin.schulz at cherry.de>
> Cc: Rasmus Villemoes <ravi at prevas.dk>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Tom Rini <trini at konsulko.com>
> Cc: Wolfgang Wallner <wolfgang.wallner at at.abb.com>
> Cc: Yannic Moog <y.moog at phytec.de>
> ---
>  tools/binman/ftest.py | 20 +++++++--------
>  tools/fit_image.c     | 58 ++++++++++++++++++++++++++++++++++---------
>  2 files changed, 56 insertions(+), 22 deletions(-)

Reviewed-by: Simon Glass <simon.glass at canonical.com>

This aligns binman with the new mkimage but I think that is OK.

Regards,
Simon


More information about the U-Boot mailing list