summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_esrt.c
AgeCommit message (Collapse)Author
2025-10-18efi_loader: Use ESRT_FW_TYPE_SYSTEMFIRMWARE instead of ESRT_FW_TYPE_UNKNOWNIlias Apalodimas
We currently set the firmware image type to ESRT_FW_TYPE_UNKNOWN. The spec defines the following: ESRT_FW_TYPE_UNKNOWN 0x00000000 ESRT_FW_TYPE_SYSTEMFIRMWARE 0x00000001 ESRT_FW_TYPE_DEVICEFIRMWARE 0x00000002 ESRT_FW_TYPE_UEFIDRIVER 0x00000003 Since we don't support updating DEVICEFIRMWARE or UEFIDRIVER types, let's switch over to SYSTEMFIRMWARE which seems more appropriate. Suggested-by: Michal Simek <[email protected]> Signed-off-by: Ilias Apalodimas <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2025-01-26efi_loader: use LOGC_EFI consistentlyHeinrich Schuchardt
The log category should be LOGC_EFI all over the EFI sub-system. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]>
2024-01-13efi_loader: fix iteration of FMP protocolsMasahisa Kojima
If one of the FMP protocols fails when calling GetImageInfo(), populating the ESRT ends up with failure and other FMP protocols are not added to the ESRT. We should still add all other FMP protocols to the ESRT. With this commit, iteration of all FMP protocols continues even though one of the FMP protocols fails. Signed-off-by: Masahisa Kojima <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Tested-by: Ilias Apalodimas <[email protected]>
2023-12-21efi_loader: Remove <common.h>Tom Rini
We largely do not need <common.h> in these files, so drop it. The only exception here is that efi_freestanding.c needs <linux/types.h> and had been getting that via <common.h>. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-01-27efi_loader: fix comment in ESRT codeHeinrich Schuchardt
There is no variable num_pages in function efi_esrt_allocate_install(). Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]>
2022-01-19efi_loader: use %pUs for printing GUIDsHeinrich Schuchardt
For printing GUIDs with macro EFI_ENTRY use %pUs instead of %pUl to provide readable debug output. Signed-off-by: Heinrich Schuchardt <[email protected]>
2021-04-17efi_loader: esrt: Remove incorrect invocations of EFI_CALL macroSughosh Ganu
Remove function invocations using the EFI_CALL macro for those functions that do not have an EFI_ENTRY call in their definition. Such functions can use u-boot api's which rely on u-boot global data(gd) pointer. The Arm and RiscV architectures maintain a separate gd pointer, one for u-boot, and a separate gd for the efi application. Calling a function through the EFI_CALL macro changes the gd pointer to that used for the efi application, with u-boot gd being unavailable. Any function then trying to dereference u-boot's gd will result in an abort. Fix this issue by removing the EFI_CALL macro for all of such functions which do not begin by an EFI_ENTRY function call. Signed-off-by: Sughosh Ganu <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2021-04-10efi_loader: esrt: wrong type for LocateHandleBuffer()Heinrich Schuchardt
efi_locate_handle_buffer() expects no_handles to be of type efi_uintn_t *. Signed-off-by: Heinrich Schuchardt <[email protected]>
2021-04-10efi_loader: use correct printf codesHeinrich Schuchardt
For printing u32 use %u not %d. Signed-off-by: Heinrich Schuchardt <[email protected]>
2021-04-10efi_loader: efi_esrt: Fix the build warning for 32 bit systemsSughosh Ganu
Fix the build warning when building for 32 bit systems by using the length modifier for size_t. lib/efi_loader/efi_esrt.c: In function ‘efi_esrt_populate’: include/efi_loader.h:126:8: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 8 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] Signed-off-by: Sughosh Ganu <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2021-03-25efi: Add ESRT to the EFI system tableJose Marinho
The ESRT is initialised during efi_init_objlist after efi_initialize_system_table(). The ESRT is recreated from scratch at the following events: - successful UpdateCapsule; - FMP instance install. The code ensures that every ESRT entry has a unique fw_class value. Limitations: - The ESRT is not updated if an FMP instance is uninstalled; - the fields image_type and flags are in the current implementation left undefined. Setting these values will require a per-platform function that returns the image_type/flags as a function of the image fw_class. CC: Heinrich Schuchardt <[email protected]> CC: Sughosh Ganu <[email protected]> CC: AKASHI Takahiro <[email protected]> CC: Ilias Apalodimas <[email protected]> CC: Andre Przywara <[email protected]> CC: Alexander Graf <[email protected]> CC: [email protected] Signed-off-by: Jose Marinho <[email protected]> Remove two EFI_CALL() indirections. Move ESRT GUID in efidebug's list of GUIDs. Reviewed-by: Heinrich Schuchardt <[email protected]>