Compare commits

..

10 Commits
app ... app2

Author SHA1 Message Date
Simon Glass
261c780ba7 efi: Move FDT-filename discovery into lib/efi
Move efi_get_distro_fdt_name() into lib/efi so it can be used from the
app.

Series-to: u-boot
Series-cc: heinrich
Cover-letter:
efi: Move some efi-loader code into a new shared dir
Some functions provided in lib/efi_loader are actually useful for the
app as well. This series refactors the Kconfig and directories a little
so that code is easier to share.

As a starting point, it moves some filename and device-path functions to
the new directory.

The next step would be to move device-path code over, but this will need
some discussion.
END

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Series-version: 2
2025-05-23 14:42:08 +01:00
Simon Glass
e92dc10948 efi: Adjust copyright and mention constant source
While the file where the basename.c code came from is marked as Linaro
from 2020, commit [1] was based on Heinrich's email. Also, [2] and [3]
were my patches. Linaro is not the copyright holder and none of the code
is from 2020.

Update the file accordingly.

Link: https://lore.kernel.org/u-boot/2175cecb-a392-5107-b932-b099ec21d62c@gmx.de
[1] 4e65ca00f3 ("efi_loader: bootmgr: add booting from removable media")
[2] 3e18860e3f ("bootstd: Allow reading an EFI file from the network")
[3] 7506c15669 ("sandbox: Report host default-filename in native mode")

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-05-23 14:42:08 +01:00
Simon Glass
b44c3f683c efi: Move the base name and PXE info into lib/efi
Move efi_get_basename() and efi_get_pxe_arch() into lib/efi so they can
be used from the app.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-23 14:42:08 +01:00
Simon Glass
2ba49890b8 efi: Update maintainers for EFI_CLIENT
The 'EFI PAYLOAD' entry really refers to the EFI loader and EFI APP
refers to the app and the payload.

Rename 'EFI PAYLOAD' to 'EFI LOADER' and 'EFI APP' to 'EFI CLIENT'

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-23 14:42:08 +01:00
Simon Glass
218f2e834d efi: Create a new CONFIG_EFI
Create a Kconfig which indicates that EFI functionality is in use,
either as a client (EFI app / stub) or provider (EFI loader). This will
make it easier to share code between these two parts of U-Boot

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-23 14:42:08 +01:00
Simon Glass
b0151aa096 efi: Rename CONFIG_EFI to CONFIG_EFI_CLIENT
The generic name 'EFI' would be more useful for common EFI features. At
present it just refers to the EFI app and stub, which is confusing.

Rename it to EFI_CLIENT
2025-05-23 14:42:08 +01:00
Simon Glass
9b312abd70 efi: Rename the lib/efi directory
This directory was created when U-Boot gained the ability to run as an
EFI app in 2015. Since then the EFI-loader feature has been added.

The code in lib/efi is not actually used by the loader, so the name is
confusing.

Rename the directory to efi_client to indicate that it includes files
just for U-Boot being a client of EFI, i.e. the EFI app and stub.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-23 14:42:08 +01:00
Simon Glass
2a63efb5a2 efi: Rename END to EFI_DP_END
This exported symbol has a very generic name. Rename it to indicate that
it relates to EFI and device-paths.

Fix checkpatch warnings related to use of multiple assignments.

Series-changes: 2
- Fix EFI_DP_3 typo

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-05-23 14:41:59 +01:00
Simon Glass
f59bbf2f88 efi: Include device-path functions in the EFI API docs
Include these function so they can be browsed in the API docs. Exclude
END since it causes a warning, which becomes an error:

   ./include/efi_device_path.h:22: warning: cannot understand function
      prototype: 'const struct efi_device_path END; '

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2025-05-23 14:40:19 +01:00
Simon Glass
85dcb3a812 efi_loader: Separate device path into its own header
These functions are useful for the EFI app. As a first step towards
making these available outside lib/efi_loader, create a separate header
file and include it where needed. Add proper comments to the functions,
since many are missing at present.

Series-changes: 2
- Add a forward declaration for struct udevice

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-23 14:35:32 +01:00

View File

@@ -12,6 +12,7 @@
struct blk_desc;
struct efi_load_option;
struct udevice;
/*
* EFI_DP_END - Template end node for EFI device paths.
@@ -408,7 +409,7 @@ struct efi_device_path *search_gpt_dp_node(struct efi_device_path *device_path);
*
* Set the device path to an IPv4 path as provided by efi_dp_from_ipv4
* concatenated with a device path of subtype DEVICE_PATH_SUB_TYPE_MSG_URI,
* and an EFI_DP_3 node.
* and an EFI_DP_END node.
*
* @server: URI of remote server
* @dev: net udevice