EFI System Resource Table (ESRT) is an informational structure that reports basic details about current system or device firmware. This is chiefly used to perform firmware updates. 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 wouldn't be sufficient because there is no universal way of converting string versions to 32-bit unsigned integers and there are no GUIDs or lowest supported versions. Change-Id: Ic1b768d7bed43edf7ca8e41552087734054de033 Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/83421 Reviewed-by: Christian Walter <christian.walter@9elements.com> Reviewed-by: coreboot org <coreboot.org@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
29 lines
800 B
C
29 lines
800 B
C
/* 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_MAIN_FW_GUID)) {
|
|
printk(BIOS_ERR, "%s(): failed to parse firmware's GUID: '%s'\n", __func__,
|
|
CONFIG_DRIVERS_EFI_MAIN_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_MAIN_FW_VERSION;
|
|
fw_info->lowest_supported_version = CONFIG_DRIVERS_EFI_MAIN_FW_LSV;
|
|
fw_info->fw_size = CONFIG_ROM_SIZE;
|
|
}
|