drivers/intel/fsp2_0: Add support for FSP_ERROR_INFO_HOB

Add a new Kconfig CONFIG_ENABLE_FSP_ERROR_INFO option to enable
retrieval of FSP_ERROR_INFO_HOB from HobList created by FSP.
Such a HOB could be generated by Intel SPR-SP FSP.
This HOB data is defined in Intel®Firmware Support Package
External Architecture Specification v2.1 Doc#611786-2.1.

Change-Id: I812d1c22c1bbe5146630948ca6ca12c46ffd5504
Signed-off-by: Ray Han Lim, Ng <ray.han.lim.ng@intel.com>
Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71949
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
This commit is contained in:
Ray Han Lim, Ng 2022-01-21 14:33:11 +08:00 committed by Lean Sheng Tan
parent 3b3012fa7d
commit 65b7219bd3
6 changed files with 55 additions and 0 deletions

View File

@ -45,6 +45,16 @@ config DISPLAY_FSP_VERSION_INFO_2
Select this option to display Firmware version information
using new header 'FirmwareVersionInfo.h'.
config ENABLE_FSP_ERROR_INFO
bool "Enable FSP Error Information"
default n
depends on PLATFORM_USES_FSP2_1
help
Select this option to enable FSP Error information. FSP detects certain errors
and notifies coreboot of a fatal error occurring during the execution of the FSP.
Although it's defined in FSP v2.1 but has only been verified on Intel Xeon-SP
Sapphire Rapids.
config HAVE_GPIO_SNAPSHOT_VERIFY_SUPPORT
bool
default n

View File

@ -15,6 +15,7 @@ romstage-y += util.c
romstage-y += memory_init.c
romstage-$(CONFIG_MMA) += mma_core.c
romstage-y += cbmem.c
romstage-$(CONFIG_ENABLE_FSP_ERROR_INFO) += fsp_error_info_hob.c
ramstage-y += debug.c
ramstage-$(CONFIG_FSP_USES_CB_DEBUG_EVENT_HANDLER) += fsp_debug_event.c
@ -31,6 +32,7 @@ ramstage-$(CONFIG_DISPLAY_UPD_DATA) += upd_display.c
ramstage-y += util.c
ramstage-$(CONFIG_CACHE_MRC_SETTINGS) += save_mrc_data.c
ramstage-$(CONFIG_MMA) += mma_core.c
ramstage-$(CONFIG_ENABLE_FSP_ERROR_INFO) += fsp_error_info_hob.c
ifneq ($(CONFIG_NO_FSP_TEMP_RAM_EXIT),y)
postcar-$(CONFIG_FSP_CAR) += temp_ram_exit.c

View File

@ -0,0 +1,14 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <console/console.h>
#include <fsp/util.h>
void display_fsp_error_info_hob(const void *hob)
{
const FSP_ERROR_INFO_HOB *fsp_error_info_hob = (FSP_ERROR_INFO_HOB *)hob;
printk(BIOS_ERR, "FspErrorInfoHob->CallerId = ");
fsp_print_guid(BIOS_CRIT, &fsp_error_info_hob->CallerId);
printk(BIOS_ERR, "\nFspErrorInfoHob->ErrorType = ");
fsp_print_guid(BIOS_CRIT, &fsp_error_info_hob->ErrorType);
printk(BIOS_ERR, "\nFspErrorInfoHob->Status = %x\n", fsp_error_info_hob->Status);
}

View File

@ -32,6 +32,11 @@ const uint8_t fsp_nv_storage_guid[16] = {
0xb3, 0xdc, 0x27, 0x0b, 0x7b, 0xa9, 0xe4, 0xb0
};
const uint8_t fsp_error_info_guid[16] = {
0x88, 0x6a, 0x1e, 0x61, 0xb7, 0xad, 0x01, 0x43,
0x93, 0xff, 0xe4, 0x73, 0x04, 0xb4, 0x3d, 0xa6
};
static const uint8_t uuid_fv_info[16] = {
0x2e, 0x72, 0x8e, 0x79, 0xb2, 0x15, 0x13, 0x4e,
0x8a, 0xe9, 0x6b, 0xa3, 0x0f, 0xf7, 0xf1, 0x67
@ -356,3 +361,21 @@ void fsp_find_bootloader_tolum(struct range_entry *re)
if (fsp_find_range_hob(re, fsp_bootloader_tolum_guid))
die("9.3: FSP_BOOTLOADER_TOLUM_HOB missing!\n");
}
bool fsp_display_error_info(void)
{
if (!CONFIG(ENABLE_FSP_ERROR_INFO))
return false;
const struct hob_header *hob;
size_t size;
hob = (const struct hob_header *)fsp_find_extension_hob_by_guid(
fsp_error_info_guid, &size);
if (hob != NULL) {
display_fsp_error_info_hob(hob);
return true;
}
return false;
}

View File

@ -33,6 +33,10 @@
#include <FirmwareVersionInfo.h>
#endif
#if CONFIG(ENABLE_FSP_ERROR_INFO)
#include <FspErrorInfoHob.h>
#endif
#pragma pack(pop)
#endif

View File

@ -137,6 +137,8 @@ const struct hob_resource *fsp_hob_header_to_resource(
const struct hob_header *fsp_next_hob(const struct hob_header *parent);
bool fsp_guid_compare(const uint8_t guid1[16], const uint8_t guid2[16]);
void fsp_find_bootloader_tolum(struct range_entry *re);
bool fsp_display_error_info(void);
void display_fsp_error_info_hob(const void *hob);
void fsp_get_version(char *buf);
/* fsp_verify_upd_header_signature calls die() on signature mismatch */
void fsp_verify_upd_header_signature(uint64_t upd_signature, uint64_t expected_signature);