[PATCH v3 0/6] Add support for DT overlays handoff

Abbarapu, Venkatesh venkatesh.abbarapu at amd.com
Wed Aug 20 07:15:02 CEST 2025


[AMD Official Use Only - AMD Internal Distribution Only]

Hi @Raymond Mao,
I was trying to test these patches with the transfer list binary which contains tl.bin(dtb+dtbo) inside it. Facing issue with the dtbo address and fdt_check_header(*blob) from fdtdec_apply_dto_blob() gets the invalid magic num.
fdt_magic=0x38 fdt_chk_version=0x1

Attaching the log with details. Let me know if you need any other information.

Thanks
Venkatesh

> -----Original Message-----
> From: Raymond Mao <raymond.mao at linaro.org>
> Sent: Friday, July 18, 2025 7:46 PM
> To: u-boot at lists.denx.de
> Cc: Simek, Michal <michal.simek at amd.com>; Abbarapu, Venkatesh
> <venkatesh.abbarapu at amd.com>; Raymond Mao <raymond.mao at linaro.org>;
> Tom Rini <trini at konsulko.com>; Tuomas Tynkkynen <tuomas.tynkkynen at iki.fi>;
> Liviu Dudau <liviu.dudau at foss.arm.com>; Simon Glass <sjg at chromium.org>; Ilias
> Apalodimas <ilias.apalodimas at linaro.org>; Dan Carpenter
> <dan.carpenter at linaro.org>; Patrick Rudolph <patrick.rudolph at 9elements.com>;
> Andrew Goodbody <andrew.goodbody at linaro.org>; Harrison Mutai
> <harrison.mutai at arm.com>; Jerome Forissier <jerome.forissier at linaro.org>;
> Heinrich Schuchardt <xypron.glpk at gmx.de>; Evgeny Bachinin
> <EABachinin at salutedevices.com>; Matthias Brugger <mbrugger at suse.com>; Lad
> Prabhakar <prabhakar.mahadev-lad.rj at bp.renesas.com>
> Subject: [PATCH v3 0/6] Add support for DT overlays handoff
>
> The series include refactoring on bloblist and fdtdec to support handoff of multiple
> DT overlays and applying them into the DT base during setup.
> All changes are aligned to the spec update for supporting DT overlay handoff[1].
>
> Notes for testing:
>
> Currently DT overlay is not yet enabled in TF-A, but with the test patches I provided
> for TF-A and OP-TEE build, importing a DT overlay blob file from QEMU to TF-A
> reserved memory is supported.
> Follow below instructions to build and run for test:
> $ repo init -u https://github.com/OP-TEE/manifest.git -m qemu_v8.xml Replace your
> local qemu_v8.xml with [2], which contains all necessary changes in both TF-A and
> OP-TEE build.
> $ repo sync
> $ cd build
> $ make toolchains
> $ make ARM_FIRMWARE_HANDOFF=y all
> Copy and rename your DT overlay blob as 'qemu_v8.dtb' into out/bin $ make
> ARM_FIRMWARE_HANDOFF=y run-only
>
> [1] Add Transfer Entry for Devicetree Overlay
> https://github.com/FirmwareHandoff/firmware_handoff/pull/74
>
> [2]
> https://github.com/raymo200915/optee_manifest/blob/dt_overlay_handoff/qemu_v8.x
> ml
>
> Raymond Mao (6):
>   bloblist: add blob type for DT overlay
>   bloblist: add helper functions
>   bloblist: fix a potential negative size for memmove
>   bloblist: add API for applying blobs with specified tag
>   fdtdec: apply DT overlays from bloblist
>   configs: Select OF_LIBFDT_OVERLAY to hand over DTO via bloblist
>
>  common/bloblist.c                       | 67 ++++++++++++++++++++-
>  configs/qemu_arm64_defconfig            |  1 +
>  configs/vexpress_fvp_bloblist_defconfig |  1 +
>  include/bloblist.h                      | 34 ++++++++++-
>  lib/fdtdec.c                            | 80 +++++++++++++++++++++++++
>  5 files changed, 181 insertions(+), 2 deletions(-)
>
> --
> 2.25.1

-------------- next part --------------
TF-A log with the transfer list dump:
======================================
INFO:    Dump transfer list:
INFO:    signature  0x4a0fb10b
INFO:    checksum   0xbd
INFO:    version    0x1
INFO:    hdr_size   0x18
INFO:    alignment  0x3
INFO:    size       0xd700
INFO:    max_size   0x600000
INFO:    flags      0x1
INFO:    Entry 0:
INFO:    tag_id     0x102
INFO:    hdr_size   0x8
INFO:    data_size  0x58
INFO:    data_addr  0x1000020
INFO:    Entry 1:
INFO:    tag_id     0x102
INFO:    hdr_size   0x8
INFO:    data_size  0x58
INFO:    data_addr  0x1000080
INFO:    Entry 2:
INFO:    tag_id     0x1
INFO:    hdr_size   0x8
INFO:    data_size  0xd3d2
INFO:    data_addr  0x10000e0
INFO:    Entry 3:
INFO:    tag_id     0x7
INFO:    hdr_size   0x8
INFO:    data_size  0x240
INFO:    data_addr  0x100d4c0
INFO:    Transfer list version is valid for all operations
===========================================================

UBOOT LOG:
============================================================
==========start of bloblist_show_list=======
bloblist_show_list: hdr=0x1000000
Address       Size   Tag Name
01000020        58   102 invalid
bloblist_next_blob: hdr=0x1000000
bloblist_blob_end_ofs: offset=0x18 rec->size=0x58
bloblist_blob_end_ofs: 2:offset=0x78 rec->size=0x58
bloblist_blob_end_ofs: 3:offset=0x80 rec->size=0x58
bloblist_next_blob: offset=0x78
01000080        58   102 invalid
bloblist_next_blob: hdr=0x1000000
bloblist_blob_end_ofs: offset=0x78 rec->size=0x58
bloblist_blob_end_ofs: 2:offset=0xd8 rec->size=0x58
bloblist_blob_end_ofs: 3:offset=0xe0 rec->size=0x58
bloblist_next_blob: offset=0xd8
010000e0      d3d2     1 Control FDT
bloblist_next_blob: hdr=0x1000000
bloblist_blob_end_ofs: offset=0xd8 rec->size=0xd3d2
bloblist_blob_end_ofs: 2:offset=0xd4b2 rec->size=0xd3d2
bloblist_blob_end_ofs: 3:offset=0xd4c0 rec->size=0xd3d2
bloblist_next_blob: offset=0xd4b8
0100d4c0       240     7 DT overlay
bloblist_next_blob: hdr=0x1000000
bloblist_blob_end_ofs: offset=0xd4b8 rec->size=0x240
bloblist_blob_end_ofs: 2:offset=0xd700 rec->size=0x240
bloblist_blob_end_ofs: 3:offset=0xd708 rec->size=0x240
bloblist_next_blob: offset=0xd700
==========end of bloblist_show_list=====================

The above dump is from the function bloblist_init() and enabled the DEBUG option and the dtbo overlay is at 0x100d4c0 which is perfect.


From the fdtdec_setup() function the fdtdec_apply_bloblist_dtos() because of padded_size the dtbo address is extended
to 0x10104c8 and which inturn failing at fdt_check_header().


fdtdec_apply_bloblist_dtos: live_fdt=0x10000e0
fdtdec_apply_bloblist_dtos: blob_size=0xd3d2 max_size=0x5ffcd2 padded_size=0x103d2
bloblist_next_blob: hdr=0x1000000
bloblist_blob_end_ofs: offset=0x18 rec->size=0x58
bloblist_blob_end_ofs: 2:offset=0x78 rec->size=0x58
bloblist_blob_end_ofs: 3:offset=0x80 rec->size=0x58
bloblist_next_blob: offset=0x78
bloblist_next_blob: hdr=0x1000000
bloblist_blob_end_ofs: offset=0x78 rec->size=0x58
bloblist_blob_end_ofs: 2:offset=0xd8 rec->size=0x58
bloblist_blob_end_ofs: 3:offset=0xe0 rec->size=0x58
bloblist_next_blob: offset=0xd8
bloblist_blob_end_ofs: offset=0xd8 rec->size=0xd3d2
bloblist_blob_end_ofs: 2:offset=0xd4b2 rec->size=0xd3d2
bloblist_blob_end_ofs: 3:offset=0xd4c0 rec->size=0xd3d2


============bloblist_apply_blobs: hdr=0x1000000 tag=07
bloblist_next_blob: hdr=0x1000000
bloblist_blob_end_ofs: offset=0x18 rec->size=0x58
bloblist_blob_end_ofs: 2:offset=0x78 rec->size=0x58
bloblist_blob_end_ofs: 3:offset=0x80 rec->size=0x58
bloblist_next_blob: offset=0x78
bloblist_next_blob: hdr=0x1000000
bloblist_blob_end_ofs: offset=0x78 rec->size=0x58
bloblist_blob_end_ofs: 2:offset=0xd8 rec->size=0x58
bloblist_blob_end_ofs: 3:offset=0xe0 rec->size=0x58
bloblist_next_blob: offset=0xd8
bloblist_next_blob: hdr=0x1000000
bloblist_blob_end_ofs: offset=0xd8 rec->size=0x103d2
bloblist_blob_end_ofs: 2:offset=0x104b2 rec->size=0x103d2
bloblist_blob_end_ofs: 3:offset=0x104c0 rec->size=0x103d2
bloblist_next_blob: offset=0x104b8
bloblist_apply_blobs: tag=7 blob=0x10104c0
bloblist_apply_blobs: dat_off of dtbo=0x8
bloblist_apply_blobs: blob_datoffset=0x10104c8 rec_size=0x240
===============fdtdec_apply_dto_blob: size=0x238
=========fdt_check_header====fdt=0x10104c8
fdt_magic=0x38 fdt_chk_version=0x1


More information about the U-Boot mailing list