[PATCH v2 1/4] qemu: overlay signature nodes
Ludwig Nussel
ludwig.nussel at siemens.com
Tue May 5 14:35:59 CEST 2026
On 5/4/26 14:26, Simon Glass wrote:
> On 2026-04-30T12:25:59, Ludwig Nussel <ludwig.nussel at siemens.com> wrote:
>> qemu: overlay signature nodes
>>
>> The keys trusted for FIT signature verification are supposed to be
>> embedded in the device tree built into u-boot. When running in Qemu it's
>> convenient to use the device tree provided by the VM which doesn't know
>> about signatures though. So merge the signature nodes at run time.
>>
>> Needs
>> CONFIG_OF_OMIT_DTB=n
>> CONFIG_OF_LIBFDT_OVERLAY=y
>>
>> Signed-off-by: Ludwig Nussel <ludwig.nussel at siemens.com>
>>
>> board/emulation/qemu-arm/qemu-arm.c | 33 ++++++++++++++++++++++++++++++++-
>> 1 file changed, 32 insertions(+), 1 deletion(-)
>
>> diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c
>> @@ -147,7 +147,38 @@ int dram_init_banksize(void)
>> int board_fdt_blob_setup(void **fdtp)
>> {
>> /* QEMU loads a generated DTB for us at the start of RAM. */
>> - *fdtp = (void *)CFG_SYS_SDRAM_BASE;
>> + void *qemu_fdt = (void *)CFG_SYS_SDRAM_BASE;
>> + int ret;
>> +
>> + if (!*fdtp)
>> + goto out;
>
> This runs the opposite direction to qemu-sbsa, which uses the U-Boot
> DT as the base and overlays the QEMU DT onto it (see
> fdtdec_board_setup() in board/emulation/qemu-sbsa/qemu-sbsa.c). Done
> this way, any node in U-Boot's built-in DT that shares a name with a
> QEMU node (/cpus, /memory, /chosen, ...) will have its properties
> merged into QEMU's, potentially clobbering the hardware description.
> If this is correct, please explain in the commit message why the merge
> runs in this direction.
Unfortunately I didn't take notes why I went with this direction in the
end. I remember trying both. Might have been issues with relocation. Too
many lose ends :-) Have to check again.
qemu-sbsa also does some fixups to the qemu device tree. I wonder
whether that also makes sense here. If so, the code could maybe just be
reused.
cu
Ludwig
--
Ludwig Nussel
Siemens AG
www.siemens.com
More information about the U-Boot
mailing list