[PATCH v2 1/2] scripts/Makefile.xpl: Align filtered DTB to 8-byte within multidtb.fit

Marek Vasut marek.vasut at mailbox.org
Tue Jan 13 14:27:38 CET 2026


On 1/13/26 11:25 AM, Beleswar Prasad Padhi wrote:

>>>>>> - Should mkimage -E align blobs to 8 bytes by default ? I think yes,
>>>>>> and frankly, I thought it does so already, but apparently not.
>>>>>
>>>>>
>>>>> This can be done, but should it be? Not all FITs demand an 8-byte
>>>>> alignment right? It is only the FDT which requires this.
>>>> Maybe if image type is flat_dt, it should be implicitly 8-byte aligned then
>>>> ?
>>>
>>> Well, the device tree spec says 8-byte alignment.
>>
>> 8 byte alignment of what, start of DT, right ?
> 
> 
> Yeah from start... In this case, the FDT for OS is aligned, but the sub DT
> from the FIT is not aligned by 8-bytes.

For mkimage -E (fit with trailing external data) , enforcing that 
alignment should be easily doable.

>>> It's not "FDT for OS"
>>> that's 8-byte, it's any device tree should start out 8 byte aligned, and
>>> everything else should then be naturally aligned. If we're looking in a
>>> device tree for another device tree to use in place and not relocate
>>> then that second tree must be aligned.
>>>
>>> Or am I missing something?
>> The discussion is about mkimage -E which generates DTs for U-Boot SPL use. The DTs in those external data should likely be aligned to 8 bytes by default, i.e. implicitly set -B 8 (they don't seem to be right now).
> 
> Instead of -E, we can use '-b' which always takes DT and make sure that is 8-byte aligned by default:
> 
> Usage: mkimage [-D dtc_options] [-f fit-image.its|-f auto|-f auto-conf|-F] [-b <dtb> [-b <dtb>]] [-E] [-B size] [-i <ramdisk.cpio.gz>] fit-image
> -b => append the device tree binary to the FIT

The type flat_dt should likely always be implicitly aligned at minimum 
to 8 bytes , without -b or -B or -whatever flags.

-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list