diff options
author | Tom Rini <trini@konsulko.com> | 2022-01-29 21:50:19 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-01-29 21:50:19 +0300 |
commit | c7d042f315d89ab2f0122920829f18a8f8897a05 (patch) | |
tree | 380446358ad24e2ed24e1696d898b019d82eb6cd /lib | |
parent | 98a90b2730696c1ba773359b7944f6685ae13344 (diff) | |
parent | 5ee900c14ff57b8c9201d7d42f018b33df3ea42a (diff) | |
download | u-boot-c7d042f315d89ab2f0122920829f18a8f8897a05.tar.xz |
Merge tag 'efi-2022-04-rc1-3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request for efi-2022-04-rc1-3
Documentation:
* update Nokia RX-51 documentation and move it to rst
* describe boot switch settings for HiFive Unmatched board
UEFI:
* fix the checking of images hashes and signatures
* provide the RISCV_EFI_BOOT_PROTOCOL
Diffstat (limited to 'lib')
45 files changed, 219 insertions, 98 deletions
diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 24f9a2bb75..e5e35fe51f 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -369,4 +369,14 @@ config EFI_ESRT help Enabling this option creates the ESRT UEFI system table. +config EFI_RISCV_BOOT_PROTOCOL + bool "RISCV_EFI_BOOT_PROTOCOL support" + default y + depends on RISCV + help + The EFI_RISCV_BOOT_PROTOCOL is used to transfer the boot hart ID + to the next boot stage. It should be enabled as it is meant to + replace the transfer via the device-tree. The latter is not + possible on systems using ACPI. + endif diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile index fd344cea29..b2c664d108 100644 --- a/lib/efi_loader/Makefile +++ b/lib/efi_loader/Makefile @@ -62,6 +62,7 @@ obj-$(CONFIG_GENERATE_ACPI_TABLE) += efi_acpi.o obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += efi_smbios.o obj-$(CONFIG_EFI_RNG_PROTOCOL) += efi_rng.o obj-$(CONFIG_EFI_TCG2_PROTOCOL) += efi_tcg2.o +obj-$(CONFIG_EFI_RISCV_BOOT_PROTOCOL) += efi_riscv.o obj-$(CONFIG_EFI_LOAD_FILE2_INITRD) += efi_load_initrd.o obj-$(CONFIG_EFI_SIGNATURE_SUPPORT) += efi_signature.o diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c index 9aa003096c..7a7077e6d0 100644 --- a/lib/efi_loader/efi_file.c +++ b/lib/efi_loader/efi_file.c @@ -1084,7 +1084,7 @@ static const struct efi_file_handle efi_file_handle_protocol = { * efi_file_from_path() - open file via device path * * @fp: device path - * @return: EFI_FILE_PROTOCOL for the file or NULL + * Return: EFI_FILE_PROTOCOL for the file or NULL */ struct efi_file_handle *efi_file_from_path(struct efi_device_path *fp) { diff --git a/lib/efi_loader/efi_freestanding.c b/lib/efi_loader/efi_freestanding.c index bd0dff162f..c85df026f0 100644 --- a/lib/efi_loader/efi_freestanding.c +++ b/lib/efi_loader/efi_freestanding.c @@ -97,8 +97,8 @@ void *memset(void *s, int c, size_t n) * * We do nothing here. * - * @param func_ptr Pointer to function being entered - * @param caller Pointer to function which called this function + * func_ptr: Pointer to function being entered + * caller: Pointer to function which called this function */ void __attribute__((no_instrument_function)) __cyg_profile_func_enter(void *func_ptr, void *caller) @@ -113,8 +113,8 @@ __cyg_profile_func_enter(void *func_ptr, void *caller) * * We do nothing here. * - * @param func_ptr Pointer to function being entered - * @param caller Pointer to function which called this function + * func_ptr: Pointer to function being entered + * caller: Pointer to function which called this function */ void __attribute__((no_instrument_function)) __cyg_profile_func_exit(void *func_ptr, void *caller) diff --git a/lib/efi_loader/efi_gop.c b/lib/efi_loader/efi_gop.c index 7683a34a96..2c81859807 100644 --- a/lib/efi_loader/efi_gop.c +++ b/lib/efi_loader/efi_gop.c @@ -407,7 +407,7 @@ out: * @width: width of rectangle * @height: height of rectangle * @delta: length in bytes of a line in the pixel buffer (optional) - * @return: status code + * Return: status code */ efi_status_t EFIAPI gop_blt(struct efi_gop *this, struct efi_gop_pixel *buffer, u32 operation, efi_uintn_t sx, diff --git a/lib/efi_loader/efi_image_loader.c b/lib/efi_loader/efi_image_loader.c index 255613eb72..f43dfb3d57 100644 --- a/lib/efi_loader/efi_image_loader.c +++ b/lib/efi_loader/efi_image_loader.c @@ -545,13 +545,13 @@ static bool efi_image_unsigned_authenticate(struct efi_image_regions *regs) } /* try black-list first */ - if (efi_signature_lookup_digest(regs, dbx)) { + if (efi_signature_lookup_digest(regs, dbx, true)) { EFI_PRINT("Image is not signed and its digest found in \"dbx\"\n"); goto out; } /* try white-list */ - if (efi_signature_lookup_digest(regs, db)) + if (efi_signature_lookup_digest(regs, db, false)) ret = true; else EFI_PRINT("Image is not signed and its digest not found in \"db\" or \"dbx\"\n"); @@ -633,7 +633,7 @@ static bool efi_image_authenticate(void *efi, size_t efi_size) goto err; } - if (efi_signature_lookup_digest(regs, dbx)) { + if (efi_signature_lookup_digest(regs, dbx, true)) { EFI_PRINT("Image's digest was found in \"dbx\"\n"); goto err; } @@ -734,7 +734,7 @@ static bool efi_image_authenticate(void *efi, size_t efi_size) EFI_PRINT("Signature was not verified by \"db\"\n"); - if (efi_signature_lookup_digest(regs, db)) { + if (efi_signature_lookup_digest(regs, db, false)) { ret = true; break; } diff --git a/lib/efi_loader/efi_riscv.c b/lib/efi_loader/efi_riscv.c new file mode 100644 index 0000000000..bccfefd8fb --- /dev/null +++ b/lib/efi_loader/efi_riscv.c @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Defines APIs that allow an OS to interact with UEFI firmware to query + * information about the boot hart ID. + * + * Copyright (c) 2022, Ventana Micro Systems Inc + */ + +#define LOG_CATEGORY LOGC_EFI +#include <common.h> +#include <efi_loader.h> +#include <efi_variable.h> +#include <log.h> +#include <asm/global_data.h> +#include <efi_riscv.h> + +DECLARE_GLOBAL_DATA_PTR; + +static const efi_guid_t efi_guid_riscv_boot_protocol = RISCV_EFI_BOOT_PROTOCOL_GUID; + +/** + * efi_riscv_get_boot_hartid() - return boot hart ID + * @this: RISCV_EFI_BOOT_PROTOCOL instance + * @boot_hartid: caller allocated memory to return boot hart id + * Return: status code + */ +static efi_status_t EFIAPI +efi_riscv_get_boot_hartid(struct riscv_efi_boot_protocol *this, + efi_uintn_t *boot_hartid) +{ + EFI_ENTRY("%p, %p", this, boot_hartid); + + if (this != &riscv_efi_boot_prot || !boot_hartid) + return EFI_INVALID_PARAMETER; + + *boot_hartid = gd->arch.boot_hart; + + return EFI_EXIT(EFI_SUCCESS); +} + +struct riscv_efi_boot_protocol riscv_efi_boot_prot = { + .revision = RISCV_EFI_BOOT_PROTOCOL_REVISION, + .get_boot_hartid = efi_riscv_get_boot_hartid +}; + +/** + * efi_riscv_register() - register RISCV_EFI_BOOT_PROTOCOL + * + * Return: status code + */ +efi_status_t efi_riscv_register(void) +{ + efi_status_t ret = EFI_SUCCESS; + + ret = efi_add_protocol(efi_root, &efi_guid_riscv_boot_protocol, + (void *)&riscv_efi_boot_prot); + if (ret != EFI_SUCCESS) + log_err("Cannot install RISCV_EFI_BOOT_PROTOCOL\n"); + return ret; +} diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c index 49172e3579..380adc15c8 100644 --- a/lib/efi_loader/efi_setup.c +++ b/lib/efi_loader/efi_setup.c @@ -247,6 +247,12 @@ efi_status_t efi_init_obj_list(void) goto out; } + if (IS_ENABLED(CONFIG_EFI_RISCV_BOOT_PROTOCOL)) { + ret = efi_riscv_register(); + if (ret != EFI_SUCCESS) + goto out; + } + /* Secure boot */ ret = efi_init_secure_boot(); if (ret != EFI_SUCCESS) diff --git a/lib/efi_loader/efi_signature.c b/lib/efi_loader/efi_signature.c index 3243e2c60d..1bd1fdc95f 100644 --- a/lib/efi_loader/efi_signature.c +++ b/lib/efi_loader/efi_signature.c @@ -147,9 +147,34 @@ static bool efi_hash_regions(struct image_region *regs, int count, } /** + * hash_algo_supported - check if the requested hash algorithm is supported + * @guid: guid of the algorithm + * + * Return: true if supported false otherwise + */ +static bool hash_algo_supported(const efi_guid_t guid) +{ + int i; + const efi_guid_t unsupported_hashes[] = { + EFI_CERT_SHA1_GUID, + EFI_CERT_SHA224_GUID, + EFI_CERT_SHA384_GUID, + EFI_CERT_SHA512_GUID, + }; + + for (i = 0; i < ARRAY_SIZE(unsupported_hashes); i++) { + if (!guidcmp(&unsupported_hashes[i], &guid)) + return false; + } + + return true; +} + +/** * efi_signature_lookup_digest - search for an image's digest in sigdb * @regs: List of regions to be authenticated * @db: Signature database for trusted certificates + * @dbx Caller needs to set this to true if he is searching dbx * * A message digest of image pointed to by @regs is calculated and * its hash value is compared to entries in signature database pointed @@ -158,13 +183,16 @@ static bool efi_hash_regions(struct image_region *regs, int count, * Return: true if found, false if not */ bool efi_signature_lookup_digest(struct efi_image_regions *regs, - struct efi_signature_store *db) + struct efi_signature_store *db, + bool dbx) + { struct efi_signature_store *siglist; struct efi_sig_data *sig_data; void *hash = NULL; size_t size = 0; bool found = false; + bool hash_done = false; EFI_PRINT("%s: Enter, %p, %p\n", __func__, regs, db); @@ -172,17 +200,27 @@ bool efi_signature_lookup_digest(struct efi_image_regions *regs, goto out; for (siglist = db; siglist; siglist = siglist->next) { - /* TODO: support other hash algorithms */ - if (guidcmp(&siglist->sig_type, &efi_guid_sha256)) { - EFI_PRINT("Digest algorithm is not supported: %pUs\n", - &siglist->sig_type); - break; - } + /* + * if the hash algorithm is unsupported and we get an entry in + * dbx reject the image + */ + if (dbx && !hash_algo_supported(siglist->sig_type)) { + found = true; + continue; + }; + /* + * Only support sha256 for now, that's what + * hash-to-efi-sig-list produces + */ + if (guidcmp(&siglist->sig_type, &efi_guid_sha256)) + continue; - if (!efi_hash_regions(regs->reg, regs->num, &hash, &size)) { + if (!hash_done && + !efi_hash_regions(regs->reg, regs->num, &hash, &size)) { EFI_PRINT("Digesting an image failed\n"); break; } + hash_done = true; for (sig_data = siglist->sig_data_list; sig_data; sig_data = sig_data->next) { diff --git a/lib/efi_loader/helloworld.c b/lib/efi_loader/helloworld.c index 3f215e2a46..33e4fbc7c8 100644 --- a/lib/efi_loader/helloworld.c +++ b/lib/efi_loader/helloworld.c @@ -133,7 +133,7 @@ efi_status_t print_device_path(struct efi_device_path *device_path, * * @handle: handle of the loaded image * @systab: system table - * @return: status code + * Return: status code */ efi_status_t EFIAPI efi_main(efi_handle_t handle, struct efi_system_table *systab) diff --git a/lib/efi_selftest/dtbdump.c b/lib/efi_selftest/dtbdump.c index ed3b985cab..6e1eaa4ef0 100644 --- a/lib/efi_selftest/dtbdump.c +++ b/lib/efi_selftest/dtbdump.c @@ -495,7 +495,7 @@ efi_status_t do_save(u16 *filename) * * @handle: handle of the loaded image * @systab: system table - * @return: status code + * Return: status code */ efi_status_t EFIAPI efi_main(efi_handle_t image_handle, struct efi_system_table *systab) diff --git a/lib/efi_selftest/efi_selftest.c b/lib/efi_selftest/efi_selftest.c index 3da34b1d46..474a8b8728 100644 --- a/lib/efi_selftest/efi_selftest.c +++ b/lib/efi_selftest/efi_selftest.c @@ -149,7 +149,7 @@ static int teardown(struct efi_unit_test *test, unsigned int *failures) * Check that a test requiring reset exists. * * @testname: name of the test - * @return: test, or NULL if not found + * Return: test, or NULL if not found */ static bool need_reset(const u16 *testname) { @@ -170,7 +170,7 @@ static bool need_reset(const u16 *testname) * Check that a test exists. * * @testname: name of the test - * @return: test, or NULL if not found + * Return: test, or NULL if not found */ static struct efi_unit_test *find_test(const u16 *testname) { diff --git a/lib/efi_selftest/efi_selftest_bitblt.c b/lib/efi_selftest/efi_selftest_bitblt.c index fb33150c4b..1def843505 100644 --- a/lib/efi_selftest/efi_selftest_bitblt.c +++ b/lib/efi_selftest/efi_selftest_bitblt.c @@ -94,7 +94,7 @@ static void EFIAPI notify(struct efi_event *event, void *context) * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -198,7 +198,7 @@ static int setup(const efi_handle_t handle, /* * Tear down unit test. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int teardown(void) { @@ -225,7 +225,7 @@ static int teardown(void) /* * Execute unit test. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_block_device.c b/lib/efi_selftest/efi_selftest_block_device.c index ad53dac796..62b3e04db8 100644 --- a/lib/efi_selftest/efi_selftest_block_device.c +++ b/lib/efi_selftest/efi_selftest_block_device.c @@ -180,7 +180,7 @@ static efi_handle_t disk_handle; * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -240,7 +240,7 @@ static int setup(const efi_handle_t handle, /* * Tear down unit test. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int teardown(void) { @@ -292,7 +292,7 @@ static efi_uintn_t dp_size(struct efi_device_path *dp) /* * Execute unit test. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_config_table.c b/lib/efi_selftest/efi_selftest_config_table.c index 2bf12b5bb6..1961e29934 100644 --- a/lib/efi_selftest/efi_selftest_config_table.c +++ b/lib/efi_selftest/efi_selftest_config_table.c @@ -68,7 +68,7 @@ static int check_table(const void *table) * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -85,7 +85,7 @@ static int setup(const efi_handle_t handle, * A table is installed, updated, removed. The table entry and the * triggering of events is checked. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_console.c b/lib/efi_selftest/efi_selftest_console.c index 3187e104c4..fd2b3d09ab 100644 --- a/lib/efi_selftest/efi_selftest_console.c +++ b/lib/efi_selftest/efi_selftest_console.c @@ -274,7 +274,7 @@ void efi_st_printc(int color, const char *fmt, ...) /* * Reads an Unicode character from the input device. * - * @return: Unicode character + * Return: Unicode character */ u16 efi_st_get_key(void) { diff --git a/lib/efi_selftest/efi_selftest_crc32.c b/lib/efi_selftest/efi_selftest_crc32.c index 19153c759a..f2be35314a 100644 --- a/lib/efi_selftest/efi_selftest_crc32.c +++ b/lib/efi_selftest/efi_selftest_crc32.c @@ -68,7 +68,7 @@ static int check_table(const void *table) * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -112,7 +112,7 @@ static int setup(const efi_handle_t handle, * * Check tables after ExitBootServices() * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_devicepath_util.c b/lib/efi_selftest/efi_selftest_devicepath_util.c index c846e057d3..1801e30756 100644 --- a/lib/efi_selftest/efi_selftest_devicepath_util.c +++ b/lib/efi_selftest/efi_selftest_devicepath_util.c @@ -49,7 +49,7 @@ static int setup(const efi_handle_t img_handle, * * @length: length of the media device node * @dp: device path - * @return: status code + * Return: status code */ static int create_single_node_device_path(unsigned int length, struct efi_device_path **dp) diff --git a/lib/efi_selftest/efi_selftest_esrt.c b/lib/efi_selftest/efi_selftest_esrt.c index 99793dee72..922ff253c7 100644 --- a/lib/efi_selftest/efi_selftest_esrt.c +++ b/lib/efi_selftest/efi_selftest_esrt.c @@ -108,7 +108,7 @@ static void *lib_test_get_esrt(void) * @esrt: pointer to the ESRT * @img_info: an image_info_descriptor output by the FMP get_image_info * - * @return: true if matching ESRT entry is found and if all the ESRT entry fields match the + * Return: true if matching ESRT entry is found and if all the ESRT entry fields match the * corresponding @img_info fields. */ static bool lib_test_check_uuid_entry(struct efi_system_resource_table *esrt, @@ -168,7 +168,7 @@ static bool lib_test_check_uuid_entry(struct efi_system_resource_table *esrt, * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -185,7 +185,7 @@ static int setup(const efi_handle_t handle, * * Uninstall the test FMP. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int teardown(void) { diff --git a/lib/efi_selftest/efi_selftest_event_groups.c b/lib/efi_selftest/efi_selftest_event_groups.c index 6dcde50648..7a6d9fb162 100644 --- a/lib/efi_selftest/efi_selftest_event_groups.c +++ b/lib/efi_selftest/efi_selftest_event_groups.c @@ -38,7 +38,7 @@ static void EFIAPI notify(struct efi_event *event, void *context) * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -54,7 +54,7 @@ static int setup(const efi_handle_t handle, * Create multiple events in an event group. Signal each event once and check * that all events are notified once in each round. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_events.c b/lib/efi_selftest/efi_selftest_events.c index 1077cbdf9e..90071536a2 100644 --- a/lib/efi_selftest/efi_selftest_events.c +++ b/lib/efi_selftest/efi_selftest_events.c @@ -39,7 +39,7 @@ static void EFIAPI notify(struct efi_event *event, void *context) * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -69,7 +69,7 @@ static int setup(const efi_handle_t handle, * * Close the events created in setup. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int teardown(void) { @@ -103,7 +103,7 @@ static int teardown(void) * Run a 100 ms single shot timer and check that it is called once * while waiting for 100 ms periodic timer for two periods. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_exception.c b/lib/efi_selftest/efi_selftest_exception.c index d86228a892..dca7f7d343 100644 --- a/lib/efi_selftest/efi_selftest_exception.c +++ b/lib/efi_selftest/efi_selftest_exception.c @@ -99,7 +99,7 @@ static efi_status_t decompress(u8 **image) * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -118,7 +118,7 @@ static int setup(const efi_handle_t handle, * * Load and start the application image. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_exitbootservices.c b/lib/efi_selftest/efi_selftest_exitbootservices.c index 59ab15407a..f5e0d9da89 100644 --- a/lib/efi_selftest/efi_selftest_exitbootservices.c +++ b/lib/efi_selftest/efi_selftest_exitbootservices.c @@ -63,7 +63,7 @@ static void EFIAPI ebs_notify(struct efi_event *event, void *context) * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -101,7 +101,7 @@ static int setup(const efi_handle_t handle, * Call ExitBootServices again and check that the notification function is * not called again. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_fdt.c b/lib/efi_selftest/efi_selftest_fdt.c index 739f029b8c..70fe06e0c4 100644 --- a/lib/efi_selftest/efi_selftest_fdt.c +++ b/lib/efi_selftest/efi_selftest_fdt.c @@ -165,7 +165,7 @@ static void *efi_st_get_config_table(const efi_guid_t *guid) * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t img_handle, const struct efi_system_table *systable) @@ -192,7 +192,7 @@ static int setup(const efi_handle_t img_handle, /* * Execute unit test. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_gop.c b/lib/efi_selftest/efi_selftest_gop.c index d64294ac79..e500752fda 100644 --- a/lib/efi_selftest/efi_selftest_gop.c +++ b/lib/efi_selftest/efi_selftest_gop.c @@ -18,7 +18,7 @@ static struct efi_gop *gop; * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -39,7 +39,7 @@ static int setup(const efi_handle_t handle, /* * Tear down unit test. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int teardown(void) { @@ -49,7 +49,7 @@ static int teardown(void) /* * Execute unit test. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_hii.c b/lib/efi_selftest/efi_selftest_hii.c index f4b70f7950..66ccec1e3f 100644 --- a/lib/efi_selftest/efi_selftest_hii.c +++ b/lib/efi_selftest/efi_selftest_hii.c @@ -28,7 +28,7 @@ static struct efi_hii_string_protocol *hii_string_protocol; * @handle: handle of the loaded image * @systable: system table * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -1033,7 +1033,7 @@ static int test_hii_string_protocol(void) /* * Execute unit test. * - * @return: EFI_ST_SUCCESS for success, EFI_ST_FAILURE for failure + * Return: EFI_ST_SUCCESS for success, EFI_ST_FAILURE for failure */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_load_file.c b/lib/efi_selftest/efi_selftest_load_file.c index bf955cbf66..bac0e6b61d 100644 --- a/lib/efi_selftest/efi_selftest_load_file.c +++ b/lib/efi_selftest/efi_selftest_load_file.c @@ -284,7 +284,7 @@ static struct efi_load_file_protocol lf2_prot = {load_file2}; * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int efi_st_load_file_setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -326,7 +326,7 @@ static int efi_st_load_file_setup(const efi_handle_t handle, /* * Tear down unit test. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int efi_st_load_file_teardown(void) { @@ -377,7 +377,7 @@ static int efi_st_load_file_teardown(void) * Try loading an image via the EFI_LOAD_FILE_PROTOCOL and the * EFI_LOAD_FILE2_PROTOCOL. Finally execute the image. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int efi_st_load_file_execute(void) { diff --git a/lib/efi_selftest/efi_selftest_loadimage.c b/lib/efi_selftest/efi_selftest_loadimage.c index 4975d80ff1..72c8d51687 100644 --- a/lib/efi_selftest/efi_selftest_loadimage.c +++ b/lib/efi_selftest/efi_selftest_loadimage.c @@ -411,7 +411,7 @@ static efi_status_t decompress(u8 **image) * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -447,7 +447,7 @@ static int setup(const efi_handle_t handle, * * Uninstall protocols and free memory. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int teardown(void) { @@ -486,7 +486,7 @@ static int teardown(void) * * Load and start the application image. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_miniapp_exit.c b/lib/efi_selftest/efi_selftest_miniapp_exit.c index 6b5cfb01cf..2ea19f20ed 100644 --- a/lib/efi_selftest/efi_selftest_miniapp_exit.c +++ b/lib/efi_selftest/efi_selftest_miniapp_exit.c @@ -21,7 +21,7 @@ static efi_guid_t loaded_image_protocol_guid = EFI_LOADED_IMAGE_PROTOCOL_GUID; * * @image_handle: handle of the loaded image * @systable: system table - * @return: status code + * Return: status code */ static efi_status_t EFIAPI check_loaded_image_protocol (efi_handle_t image_handle, struct efi_system_table *systable) @@ -60,7 +60,7 @@ static efi_status_t EFIAPI check_loaded_image_protocol * * @handle: handle of the loaded image * @systable: system table - * @return: status code + * Return: status code */ efi_status_t EFIAPI efi_main(efi_handle_t handle, struct efi_system_table *systable) diff --git a/lib/efi_selftest/efi_selftest_reset.c b/lib/efi_selftest/efi_selftest_reset.c index 8b6ac24cb1..f888054894 100644 --- a/lib/efi_selftest/efi_selftest_reset.c +++ b/lib/efi_selftest/efi_selftest_reset.c @@ -17,7 +17,7 @@ static struct efi_runtime_services *runtime; * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -29,7 +29,7 @@ static int setup(const efi_handle_t handle, /* * Execute unit test. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_rng.c b/lib/efi_selftest/efi_selftest_rng.c index fca9749d07..007d1c82e9 100644 --- a/lib/efi_selftest/efi_selftest_rng.c +++ b/lib/efi_selftest/efi_selftest_rng.c @@ -20,7 +20,7 @@ static efi_guid_t efi_rng_guid = EFI_RNG_PROTOCOL_GUID; * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -35,7 +35,7 @@ static int setup(const efi_handle_t handle, * Retrieve available RNG algorithms. * Retrieve two random values and compare them. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_rtc.c b/lib/efi_selftest/efi_selftest_rtc.c index 6f7035dee6..e9e47e96c4 100644 --- a/lib/efi_selftest/efi_selftest_rtc.c +++ b/lib/efi_selftest/efi_selftest_rtc.c @@ -19,7 +19,7 @@ static struct efi_runtime_services *runtime; * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -35,7 +35,7 @@ static int setup(const efi_handle_t handle, * Set a new value and read it back. * Set the real time clock back the current time. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_set_virtual_address_map.c b/lib/efi_selftest/efi_selftest_set_virtual_address_map.c index 8e2e8ba172..d28ed83eb3 100644 --- a/lib/efi_selftest/efi_selftest_set_virtual_address_map.c +++ b/lib/efi_selftest/efi_selftest_set_virtual_address_map.c @@ -73,7 +73,7 @@ static void EFIAPI notify(struct efi_event *event, void *context) * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -176,7 +176,7 @@ static int setup(const efi_handle_t handle, * The triggering of the EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event is checked via * the call count of the notification function. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_snp.c b/lib/efi_selftest/efi_selftest_snp.c index 818cbfcacd..15af8d3e18 100644 --- a/lib/efi_selftest/efi_selftest_snp.c +++ b/lib/efi_selftest/efi_selftest_snp.c @@ -77,7 +77,7 @@ static unsigned int net_ip_id; * * @buf: IP header * @len: length of header in bytes - * @return: checksum + * Return: checksum */ static unsigned int efi_ip_checksum(const void *buf, size_t len) { @@ -175,7 +175,7 @@ static efi_status_t send_dhcp_discover(void) * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -282,7 +282,7 @@ static int setup(const efi_handle_t handle, * A DHCP discover message is sent. The test is successful if a * DHCP reply is received within 10 seconds. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { @@ -422,7 +422,7 @@ received: * Close the timer event created in setup. * Shut down the network adapter. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int teardown(void) { diff --git a/lib/efi_selftest/efi_selftest_startimage_exit.c b/lib/efi_selftest/efi_selftest_startimage_exit.c index 5d4c0a6972..b65a10b7a4 100644 --- a/lib/efi_selftest/efi_selftest_startimage_exit.c +++ b/lib/efi_selftest/efi_selftest_startimage_exit.c @@ -79,7 +79,7 @@ static efi_status_t decompress(u8 **image) * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -96,7 +96,7 @@ static int setup(const efi_handle_t handle, /* * Tear down unit test. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int teardown(void) { @@ -117,7 +117,7 @@ static int teardown(void) * * Load and start the application image. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_startimage_return.c b/lib/efi_selftest/efi_selftest_startimage_return.c index 44c23644ea..3e0c5a9ffb 100644 --- a/lib/efi_selftest/efi_selftest_startimage_return.c +++ b/lib/efi_selftest/efi_selftest_startimage_return.c @@ -79,7 +79,7 @@ static efi_status_t decompress(u8 **image) * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -96,7 +96,7 @@ static int setup(const efi_handle_t handle, /* * Tear down unit test. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int teardown(void) { @@ -117,7 +117,7 @@ static int teardown(void) * * Load and start the application image. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_tcg2.c b/lib/efi_selftest/efi_selftest_tcg2.c index 2eed588eea..a2b4a79e9b 100644 --- a/lib/efi_selftest/efi_selftest_tcg2.c +++ b/lib/efi_selftest/efi_selftest_tcg2.c @@ -612,7 +612,7 @@ static efi_status_t setup_smbios_table(const struct efi_system_table *systable) * * @handle: handle of the loaded image * @systable: system table - * @return: status code + * Return: status code */ static int efi_st_tcg2_setup(const efi_handle_t img_handle, const struct efi_system_table *systable) @@ -949,7 +949,7 @@ static int efi_st_tcg2_execute(void) /* * efi_st_tcg2_teardown() - Tear down unit test * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int efi_st_tcg2_teardown(void) { diff --git a/lib/efi_selftest/efi_selftest_textinput.c b/lib/efi_selftest/efi_selftest_textinput.c index b90671cdd2..141856a4cf 100644 --- a/lib/efi_selftest/efi_selftest_textinput.c +++ b/lib/efi_selftest/efi_selftest_textinput.c @@ -21,7 +21,7 @@ static struct efi_boot_services *boottime; * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -34,7 +34,7 @@ static int setup(const efi_handle_t handle, /* * Execute unit test. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_textinputex.c b/lib/efi_selftest/efi_selftest_textinputex.c index de44224ce1..bd221d6254 100644 --- a/lib/efi_selftest/efi_selftest_textinputex.c +++ b/lib/efi_selftest/efi_selftest_textinputex.c @@ -45,7 +45,7 @@ static efi_status_t EFIAPI efi_key_notify_function * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -93,7 +93,7 @@ static int setup(const efi_handle_t handle, * * Unregister notify function. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int teardown(void) { @@ -112,7 +112,7 @@ static int teardown(void) /* * Execute unit test. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_textoutput.c b/lib/efi_selftest/efi_selftest_textoutput.c index a87f65e197..450fe97e62 100644 --- a/lib/efi_selftest/efi_selftest_textoutput.c +++ b/lib/efi_selftest/efi_selftest_textoutput.c @@ -15,7 +15,7 @@ /* * Execute unit test. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_tpl.c b/lib/efi_selftest/efi_selftest_tpl.c index 0c0e412ae2..f4e467267e 100644 --- a/lib/efi_selftest/efi_selftest_tpl.c +++ b/lib/efi_selftest/efi_selftest_tpl.c @@ -37,7 +37,7 @@ static void EFIAPI notify(struct efi_event *event, void *context) * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -68,7 +68,7 @@ static int setup(const efi_handle_t handle, * * Close the events created in setup. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int teardown(void) { @@ -106,7 +106,7 @@ static int teardown(void) * Lower the TPL level and check that the queued notification * function is called. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_unaligned.c b/lib/efi_selftest/efi_selftest_unaligned.c index 1802948e67..6fce110b76 100644 --- a/lib/efi_selftest/efi_selftest_unaligned.c +++ b/lib/efi_selftest/efi_selftest_unaligned.c @@ -19,7 +19,7 @@ struct aligned_buffer { * occurs. * * @addr: address to read - * @return: value at the address + * Return: value at the address */ static inline u32 deref(u32 *addr) { @@ -37,7 +37,7 @@ static inline u32 deref(u32 *addr) * Execute unit test. * An unaligned memory access is executed. The result is checked. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/efi_selftest_watchdog.c b/lib/efi_selftest/efi_selftest_watchdog.c index cbc6761721..a352d4a5ad 100644 --- a/lib/efi_selftest/efi_selftest_watchdog.c +++ b/lib/efi_selftest/efi_selftest_watchdog.c @@ -65,7 +65,7 @@ static void EFIAPI notify(struct efi_event *event, void *context) * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup(const efi_handle_t handle, const struct efi_system_table *systable) @@ -98,7 +98,7 @@ static int setup(const efi_handle_t handle, * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup_timer(const efi_handle_t handle, const struct efi_system_table *systable) @@ -112,7 +112,7 @@ static int setup_timer(const efi_handle_t handle, * * @handle: handle of the loaded image * @systable: system table - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int setup_reboot(const efi_handle_t handle, const struct efi_system_table *systable) @@ -126,7 +126,7 @@ static int setup_reboot(const efi_handle_t handle, * * Close the events created in setup. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int teardown(void) { @@ -166,7 +166,7 @@ static int teardown(void) * Run a 1350 ms single shot timer and check that the 600ms timer has * been called 2 times. * - * @return: EFI_ST_SUCCESS for success + * Return: EFI_ST_SUCCESS for success */ static int execute(void) { diff --git a/lib/efi_selftest/initrddump.c b/lib/efi_selftest/initrddump.c index 325951b498..efdcf0dd50 100644 --- a/lib/efi_selftest/initrddump.c +++ b/lib/efi_selftest/initrddump.c @@ -405,7 +405,7 @@ out: * * @handle: handle of the loaded image * @systab: system table - * @return: status code + * Return: status code */ efi_status_t EFIAPI efi_main(efi_handle_t image_handle, struct efi_system_table *systab) diff --git a/lib/uuid.c b/lib/uuid.c index 24571ef5fb..284f8113ff 100644 --- a/lib/uuid.c +++ b/lib/uuid.c @@ -220,7 +220,13 @@ static const struct { "TCG2 Final Events Table", EFI_TCG2_FINAL_EVENTS_TABLE_GUID, }, +#ifdef CONFIG_EFI_RISCV_BOOT_PROTOCOL + { + "RISC-V Boot", + RISCV_EFI_BOOT_PROTOCOL_GUID, + }, #endif +#endif /* CONFIG_CMD_EFIDEBUG */ #ifdef CONFIG_CMD_NVEDIT_EFI /* signature database */ { |