Recent libfdt updates (commit 0535e46d55d7 "scripts/dtc: Update to
upstream version v1.7.2-35-g52f07dcca47c") enforce strict 8-byte
alignment for device tree blobs, as required by the device tree
specification. This causes failures on platforms using
CONFIG_SPL_MULTI_DTB_FIT, where DTBs were not properly aligned.

The alignment issue occurs at two levels:

1. DTBs embedded within the multidtb.fit FIT image may not be 8-byte
   aligned, even though the FIT image itself starts at an aligned
   address. This causes -FDT_ERR_ALIGNMENT failures when
   setup_multi_dtb_fit() tries to locate and use these DTBs.

2. The FIT image is concatenated to u-boot-spl-nodtb.bin at a boundary
   determined by the OMAP2 linker script. Currently, the linker only
   advances the location counter for alignment without padding the
   binary, causing the FIT image to be appended an unaligned offset.

This series addresses both issues:

Patch 1 adds the -B 0x8 flag to mkimage, ensuring all DTB entries
within the FIT image are 8-byte aligned.

Patch 2 fixes the linker script to include padding in the binary
by placing an alignment directive inside the __u_boot_list section,
ensuring the FIT image is appended at an 8-byte aligned boundary.

v2: Changelog:
1. Remove extra ALIGN() directive, add a comment instead.
2. Add R/B, Reported-by and Fixes: tags.

Link to v1:
https://lore.kernel.org/all/[email protected]/

Testing done:
1. Boot tested on all TI K3 platforms.

Beleswar Padhi (2):
  scripts/Makefile.xpl: Align filtered DTB to 8-byte within multidtb.fit
  ARM: OMAP2+: Pad SPL binary to 8-byte alignment before DTB

 arch/arm/mach-omap2/u-boot-spl.lds | 6 +++++-
 scripts/Makefile.xpl               | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

-- 
2.34.1

Reply via email to