-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drivers/efi: add optional ESRT-friently coreboot table tag
New CONFIG_DRIVERS_EFI_FW_INFO is off by default, enabling it adds DRIVERS_EFI_FW_{GUID,VERSION,LSV} to be used to specify firmware version/update information. Existing forms of versions woudn't be sufficient because there is no universal way of conversion to 32-bit unsigned integers and there are no GUIDs or lowest supported versions. Change-Id: Ic1b768d7bed43edf7ca8e41552087734054de033 Signed-off-by: Sergii Dmytruk <[email protected]>
- Loading branch information
1 parent
51f3e3a
commit 00bebe0
Showing
6 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-only */ | ||
|
||
#include <boot/coreboot_tables.h> | ||
#include <console/console.h> | ||
#include <stdint.h> | ||
#include <string.h> | ||
#include <uuid.h> | ||
|
||
void lb_efi_fw_info(struct lb_header *header) | ||
{ | ||
uint8_t guid[16]; | ||
struct lb_efi_fw_info *fw_info; | ||
|
||
if (parse_uuid(guid, CONFIG_DRIVERS_EFI_FW_GUID)) { | ||
printk(BIOS_ERR, "%s(): failed to parse firmware's GUID: '%s'\n", __func__, | ||
CONFIG_DRIVERS_EFI_FW_GUID); | ||
return; | ||
} | ||
|
||
fw_info = (struct lb_efi_fw_info *)lb_new_record(header); | ||
fw_info->tag = LB_TAG_EFI_FW_INFO; | ||
fw_info->size = sizeof(*fw_info); | ||
|
||
memcpy(fw_info->guid, guid, sizeof(guid)); | ||
fw_info->version = CONFIG_DRIVERS_EFI_FW_VERSION; | ||
fw_info->lowest_supported_version = CONFIG_DRIVERS_EFI_FW_LSV; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters