[PATCH v4] tools: fit_image: Fallback to 8-byte alignment for flat_dt images

Tom Rini trini at konsulko.com
Wed Jan 28 18:56:13 CET 2026


On Wed, Jan 28, 2026 at 06:23:20PM +0100, Marek Vasut wrote:

Thanks for taking my request and doing what you're suggesting should be
done.

[snip]
> -	for (node = fdt_first_subnode(fdt, images);
> -	     node >= 0;
> -	     node = fdt_next_subnode(fdt, node)) {
> -		const char *data;
> -		int len;
> +	fdt_for_each_subnode(node, fdt, images) {
> +		const char *data, *type;
> +		int pl;
> +
> +		if (params->bl_len)
> +			align_size = 8;//params->bl_len;

This should be params->bl_len, not 8.

> +		else {
> +			type = fdt_getprop(fdt, node, FIT_TYPE_PROP, &pl);
> +			if (type && pl == sizeof("flat_dt") && !memcmp(type, "flat_dt", pl))
> +				align_size = 8; // or params->bl_len rounded up to 8 ?
> +			else	/* Default alignment to 4 Bytes */
> +				align_size = 8;

If not params->bl_len, then 8. If params->bl_len then whatever the user
asked for is what they get.

Then post it on its own so patchwork picks it up and I can grab it
please.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20260128/7b74191c/attachment.sig>


More information about the U-Boot mailing list