[U-Boot] [PATCH 2/4] efi_loader: add udevice to EFI device-path mapping

Alexander Graf agraf at suse.de
Tue Jul 25 16:46:46 UTC 2017



On 25.07.17 15:57, Rob Clark wrote:
> So the static bootefi_device_obj is making things slightly awkward for
> efi_load_image() from a file-path.  And really it should just go away,
> and instead we should plug in the appropriate diskobj (or netobj) to
> the loaded_image_obj at boot time.  Also we should nuke
> bootefi_device_path.  And since we need to construct a new
> loaded_image_obj in efi_load_image(), probably split out a helper to
> fill that out properly and plug in the correct boot device-path, etc,
> etc, so we don't have too many different places constructing the same
> sort of object and forgetting to install some protocols in one place
> or another.
> 
> And since there are a lot of places we need to map to device-path and
> back, I'm starting to thing the sane way to do all this without
> breaking legacy (!CONFIG_DM) is to introduce a efi_device_path.c and
> efi_device_path_legacy.c.  Move all the hacky stuff of current
> devicepath construction into efi_device_path_legacy.c.  Add some
> device-path parsing/matching stuff to efi_device_path_util.c (which
> probably just be efi_device_path_to_text.c renamed and then spiffed
> out with some more device-path helpers), which would be shared in
> common in legacy and CONFIG_DM cases.
> 
> Sound semi-reasonable?  I'm not sure if this intersects too badly with

Sounds reasonable to me :).

> other stuff Heinrich is working on?

I don't know - I'll let him comment.

> 
> (Also, small logistical question.. anyone know how to do
> "obj-$(!CONFIG_DM) += efi_boot_device_legacy.o"?)

I would do

ifeq ($(CONFIG_DM),y)
   obj-y += efi_boot_device_dm.o
else
   obj-y += efi_boot_device_nodm.o
endif


Alex


More information about the U-Boot mailing list