Commit Graph

15 Commits

Author SHA1 Message Date
Simon Glass
0f97a71491 efi: Add missing mmc and net checks from device_path
The MMC and network subsystems must be present to use device paths for
them. Add the missing checks.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
2025-11-12 08:40:05 -07:00
Simon Glass
e7b305014e efi: Add definitions for the absolute-pointer protocol
Add these definitions to the API so that we can make use of this feature
in drivers, etc.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-10-07 09:55:12 -06:00
Simon Glass
5d802fc523 efi: Add the simple-pointer protocol
Add definitions for the simple-pointer protocol so that it can be used
in drivers.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-15 03:26:58 -06:00
Simon Glass
27f066d157 efi: Add a command to help with shim
Shim is a program which normally comes before U-Boot in the boot
process. But when the app runs first, it can sometimes chain Shim since
that is what is contained within the bootaa64.efi file, for example.

Add a simple command for dealing with shim. For now it only supports
enabling verbosity.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-28 05:21:49 -06:00
Simon Glass
e6f9a0ae58 boot: Show the device path for EFI bootflows
If the bootflow relates to the EFI bootmeth, show the device path along
with the other info.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-28 05:21:49 -06:00
Simon Glass
af0299b9de efi: Convert a device-path to a uclass and name
Add a function which looks through a device path and tries to figure out
the corresponding name (e.g. 'nvme' and uclass ID. This can be useful
for showing a short summary of the device path.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-27 17:08:45 -06:00
Simon Glass
b0341ef417 efi: Move guid used for variables to common files
Move efi_guid_image_security_database to a common file so that it can be
used by the app.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-22 08:23:17 -06:00
Simon Glass
cea7a888bf efi: Add device-path support for EFI media devices
Add proper device-path handling for UCLASS_EFI_MEDIA devices in both
dp_size() and dp_fill() functions. This enables EFI applications to use
firmware device-paths for media devices accessed through the EFI block
I/O protocol.

Add some debugging while we are here.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 10:07:17 -06:00
Simon Glass
2d2b8cff43 efi: Add the component-name2 protocol to efidebug dh
Add the GUID and API for this protocol so that we can use it in the
'efidebug dh' command.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 10:07:17 -06:00
Simon Glass
f06ec4fbcd efi: Move driver-binding guid to a common file
Move efi_guid_driver_binding_protocol to lib/efi so that it can be used
from the app.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 10:07:17 -06:00
Simon Glass
712bd388ef efi: Move FDT and global-variable GUIDs to common files
The global-variable GUID is already set in the common device_path.c file
but its declaration is only in the efi_loader header.

Move it and also move over the FDT GUIDs.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 09:05:49 -06:00
Simon Glass
8bc5cf50ff efi: Update path_uefi() to avoid allowed_unaligned()
This call seems to have been added in an unrelated commit, likely to fix
a bug:

  046fe7b507 ("efi_loader: efi_dp_from_file() expect UTF-8 path")

With standard boot we don't need to call efi_set_bootdev(). Also this
function is not available in the EFI app.

So for now, add a condition, to avoid a build error in the x86 app when
CONFIG_EFI_BINARY_EXEC is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 09:05:49 -06:00
Simon Glass
ddb6d94b03 efi: Add missing break to dp_fill()
While this doesn't really affect anything in practice, it is better to
deal with an incorrect use of this function (calling it with a UCLASS
which is not enabled).

Add a break after the UCLASS_BLK case, to help this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: a48a8929de ("efi: Move most of efi_device_path into lib/efi")
2025-08-20 09:05:49 -06:00
Simon Glass
6a54b56015 efi: Add missing break statements in dp_size()
The conversion to using a size variable was missing a break statement
for the BLK case. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: ffde1a3922 ("efi: Use variables in dp_size()")
2025-08-20 09:05:49 -06:00
Simon Glass
a48a8929de efi: Move most of efi_device_path into lib/efi
Most of these utility functions are useful for the app, so move them
into the common directory.

Move the GUIDs used by this file from their various other location, so
they are available to the app, even if it doesn't enabled EFI_LOADER

Fix the rather large number of checkpath warnings in this file, except
for the lwip one, best left to the maintainer to sort out.

One noteable change is adding a return value to dp_fill() for the case
where an option is not enabled but its uclass is referenced. This
presuambly never happens during execution, since if the uclass is not
supported there can be no device in that uclass and therefore nothing
will ever request its path. So just handle this like an invalid device.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 16:59:10 -06:00