[PATCH v3 0/9] efi_loader: improve device-tree loading

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Mon Jun 10 16:00:21 CEST 2024


On 10.06.24 15:53, Simon Glass wrote:
> Hi Heinrich,
> 
> On Mon, 10 Jun 2024 at 03:11, Heinrich Schuchardt
> <heinrich.schuchardt at canonical.com> wrote:
>>
>> In U-Boot EFI boot options can already specify both an EFI binary and
>> an initrd. With this series we can additionally define the matching
>> device-tree to be loaded in the boot option.
>>
>> With the last patch the boot manager will fall back the device-tree
>> specified by $fdtfile in directories '/dtb/', '/', or '/dtb/current/'
>> on the boot device if no device-tree is specified in the boot
>> option or via a bootefi command parameter.
>>
>> v3:
>>          Add missing '@' in EFI_LP_DP_PART_FDT description.
>>          Use calloc() instead of malloc() in load_fdt_from_load_option().
>>          Add missing '@' in load_fdt_from_load_option function description
>>          Rename struct efi_initrd_dp to efi_lo_dp_prefix.
>>
>> v2:
>>          Update efi_dp_concat() instead of new function efi_dp_merge().
>>          Carve out a function efi_load_option_dp_join() which we can
>>          use both for the eficonfig and the efidebug command.
>>          Rename variables id_dp, final_dp_size.
>>          Rename create_initrd_dp() to create_lo_dp_part().
>>          Use enum as parameter for create_lo_dp_part().
>>          Put all related changes into one patch.
>>
>> Heinrich Schuchardt (8):
>>    efi_loader: allow concatenation with contained end node
>>    cmd: eficonfig: add support for setting fdt
>>    cmd: efidebug: add support for setting fdt
>>    efi_loader: load device-tree specified in boot option
>>    efi_loader: move distro_efi_get_fdt_name()
>>    efi_loader: return binary from efi_dp_from_lo()
>>    efi_loader: export efi_load_image_from_path
>>    efi_loader: load distro dtb in bootmgr
>>
>>   boot/bootmeth_efi.c                        |  60 +---------
>>   cmd/eficonfig.c                            |  83 +++++++++----
>>   cmd/efidebug.c                             | 130 +++++++++++++++------
>>   include/efi_loader.h                       |  24 +++-
>>   lib/efi_loader/Makefile                    |   1 +
>>   lib/efi_loader/efi_bootbin.c               |   2 +-
>>   lib/efi_loader/efi_bootmgr.c               |  75 +++++++++++-
>>   lib/efi_loader/efi_boottime.c              |   3 +-
>>   lib/efi_loader/efi_device_path.c           |  40 ++++---
>>   lib/efi_loader/efi_device_path_utilities.c |   2 +-
>>   lib/efi_loader/efi_fdt.c                   | 117 +++++++++++++++++++
>>   lib/efi_loader/efi_helper.c                |  44 +++++++
>>   12 files changed, 445 insertions(+), 136 deletions(-)
>>   create mode 100644 lib/efi_loader/efi_fdt.c
>>
> 
> Somewhat related, what work has been done to support FIT, or to locate
> a DT using the compatible string?

CONFIG_BOOTM_EFI allows booting a FIT image containing an EFI binary and 
optionally a device-tree. You can manually select a configuration when 
invoking the bootm command. I am not aware of any automation for this 
selection.

Best regards

Heinrich


More information about the U-Boot mailing list