[PATCH v2] scripts/dtc: Update to upstream version v1.7.2-35-g52f07dcca47c
Jamie.Gibbons at microchip.com
Jamie.Gibbons at microchip.com
Tue Jan 20 11:45:14 CET 2026
Hi Marek,
On Mon, 2026-01-19 at 20:48 +0100, Marek Vasut wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
>
> On 1/19/26 6:12 PM, Jamie.Gibbons at microchip.com wrote:
>
> Hello Jamie,
>
> > > > The error is: failed on fdt_open_into for DTO, i.e. overlay
> > > > application
> > > > fdt error. This was introduced by 0535e46d55d scripts/dtc:
> > > > Update
> > > > to
> > > > upstream version v1.7.2-35-g52f07dcca47c, i.e. this patch.
> > > > Please
> > > > see
> > > > the attached log which includes a `printenv` attached.
> > > Does this fix your problem ?
> > >
> > > diff --git a/boot/image-fit.c b/boot/image-fit.c
> > > index 2d040e38d97..1163e837d7e 100644
> > > --- a/boot/image-fit.c
> > > +++ b/boot/image-fit.c
> > > @@ -2491,7 +2491,7 @@ int boot_get_fdt_fit(struct bootm_headers
> > > *images,
> > > ulong addr,
> > > ov = map_sysmem(ovload, ovlen);
> > >
> > > ovcopylen = ALIGN(fdt_totalsize(ov), SZ_4K);
> > > - ovcopy = malloc(ovcopylen);
> > > + ovcopy = memalign(8, ovcopylen);
> > > if (!ovcopy) {
> > > printf("failed to duplicate DTO before
> > > application\n");
> > > fdt_noffset = -ENOMEM;
> > >
> > Apologies for the delayed response. The above proposed solution did
> > not
> > change/fix the issue. Any other suggestions would be greatly
> > appreciated.
> Look at this piece of code in boot/image-fit.c :
>
> 2489 debug("%s loaded at 0x%08lx len=0x%08lx\n",
> 2490 uname, ovload, ovlen);
> 2491 ov = map_sysmem(ovload, ovlen);
> 2492
> 2493 ovcopylen = ALIGN(fdt_totalsize(ov), SZ_4K);
> 2494 ovcopy = memalign(8, ovcopylen);
> 2495 if (!ovcopy) {
> 2496 printf("failed to duplicate DTO before
> application\n");
> 2497 fdt_noffset = -ENOMEM;
> 2498 goto out;
> 2499 }
> 2500
> 2501 err = fdt_open_into(ov, ovcopy, ovcopylen);
> 2502 if (err < 0) {
> 2503 printf("failed on fdt_open_into for
> DTO\n");
>
> This is where it fails. Is $ov or $ovcopy 4-byte aligned ? Enable the
> debug() print at the beginning (or #define DEBUG at the beginning of
> this file) to find out.
>
> If $ov is 4-byte aligned, try to generate your fitImage with "mkimage
> ... -E -B 8 ..." , does that make any difference ?
Thank you for your suggestions.
I followed your advice and investigated the alignment of the overlay
buffer. The error code returned by fdt_open_into was FDT_ERR_ALIGNMENT
(-19), confirming that the overlay was not sufficiently aligned for the
updated libfdt.
I modified our Buildroot post-image.sh script to generate the FIT image
using the suggested arguments. With the -B 8 option, all blobs in the
FIT image are now 8-byte aligned. This resolved the alignment error,
and device tree overlays are now applied successfully in U-Boot.
Thanks again for your help.
Regards,
Jamie.
More information about the U-Boot
mailing list