Re-installation of device-tree as EFI configuration table
Heinrich Schuchardt
xypron.glpk at gmx.de
Fri Feb 28 11:53:28 CET 2025
On 28.02.25 11:34, Sughosh Ganu wrote:
> hi,
> The logic in efi_install_fdt() is such that with the
> EFI_FDT_USE_INTERNAL passed as a parameter to the function, the EFI
> configuration table is first checked to see if a device-tree(DT) has
> already been installed as the configuration table, and in case a table
> is found, the function returns without any other changes. However,
> there might be scenarios where the earlier installed configuration
> table might not be up-to-date, and in need of modification. One such
> scenario is that of adding a pmem node to the DT that is to be passed
> on to the OS. There could thus be a scenario where a DT that is
> installed as a configuration table does not have the pmem node, or it
> might have the wrong/stale values for the pmem node. Should there be
> some logic to indicate that the configuration table needs to be
> re-installed afresh so that these scenarios can be handled. Thoughts?
>
> -sughosh
Hello Sughosh,
The logic dates back to
6182495e101f ("efi_loader: need either ACPI table or device tree")
There are more scenarios where keeping the prior device-tree may be wrong:
We could have a first boot option specifying a device-tree where the EFI
binary returns to U-Boot and a second boot option tried afterwards that
comes without device-tree.
So we should always install a new device-tree.
I wonder if in copy_fdt() we should avoid a memory leak by keeping track
of a prior allocation by copy_fdt() in a static variable.
Do you intend to send a patch?
Best regards
Heinrich
More information about the U-Boot
mailing list