Compare commits

..

10 Commits
app2 ... app

Author SHA1 Message Date
Simon Glass
d3222e508c 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>
2025-05-23 13:41:53 +01:00
Simon Glass
93ff0f7f89 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 13:41:53 +01:00
Simon Glass
03b92904ff 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 13:41:53 +01:00
Simon Glass
1933478e62 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 13:41:53 +01:00
Simon Glass
7437239135 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 13:41:53 +01:00
Simon Glass
85ccb904a2 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 13:41:51 +01:00
Simon Glass
83dfa3eac1 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 13:41:07 +01:00
Simon Glass
8232ac1eb0 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.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-05-23 13:40:57 +01:00
Simon Glass
c0c437490b 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 13:00:50 +01:00
Simon Glass
528a2486c5 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.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-23 12:59:21 +01:00

View File

@@ -12,7 +12,6 @@
struct blk_desc;
struct efi_load_option;
struct udevice;
/*
* EFI_DP_END - Template end node for EFI device paths.
@@ -409,7 +408,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_END node.
* and an EFI_DP_3 node.
*
* @server: URI of remote server
* @dev: net udevice