Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/45905 )
Change subject: drivers/intel/fsp2_0: Integrate FirmwareVersionInfo.h ......................................................................
drivers/intel/fsp2_0: Integrate FirmwareVersionInfo.h
From JSL FSP v2376 "FirmwareVersionInfo.h" header file is added and "FirmwareVersionInfoHob.h" is deprecated. This patch adds support to display firmware version information using "FirmwareVersionInfo.h" header file. Changes included in this patch: - Add Kconfig to select FirmwareVersionInfo.h - Add code change to display firmware version info using FirmwareVersionInfo.h header
No change in version info print format.
BUG=b:153038236 BRANCH=None TEST=Verify JSLRVP build with all the patch in relation chain and verify the version output prints no junk data observed. couple of lines from logs are as below.
Display FSP Version Info HOB Reference Code - CPU = 8.7.16.10 uCode Version = 0.0.0.1
Change-Id: I50f7cae9ed4fac60f91d86bdd3e884956627e4b5 Signed-off-by: Ronak Kanabar ronak.kanabar@intel.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/45905 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Subrata Banik subrata.banik@intel.com Reviewed-by: Maulik V Vaghela maulik.v.vaghela@intel.com --- M src/drivers/intel/fsp2_0/Kconfig.debug_blob M src/drivers/intel/fsp2_0/hand_off_block.c M src/drivers/intel/fsp2_0/include/fsp/soc_binding.h 3 files changed, 37 insertions(+), 5 deletions(-)
Approvals: build bot (Jenkins): Verified Subrata Banik: Looks good to me, approved Maulik V Vaghela: Looks good to me, approved
diff --git a/src/drivers/intel/fsp2_0/Kconfig.debug_blob b/src/drivers/intel/fsp2_0/Kconfig.debug_blob index 2b10c2d..14f502c 100644 --- a/src/drivers/intel/fsp2_0/Kconfig.debug_blob +++ b/src/drivers/intel/fsp2_0/Kconfig.debug_blob @@ -38,4 +38,11 @@ help Select this option to display Firmware version information.
+config DISPLAY_FSP_VERSION_INFO_2 + bool + default n + help + Select this option to display Firmware version information + using new header 'FirmwareVersionInfo.h'. + endif # PLATFORM_USES_FSP2_0 diff --git a/src/drivers/intel/fsp2_0/hand_off_block.c b/src/drivers/intel/fsp2_0/hand_off_block.c index 60ab7cb..fd8316e 100644 --- a/src/drivers/intel/fsp2_0/hand_off_block.c +++ b/src/drivers/intel/fsp2_0/hand_off_block.c @@ -209,26 +209,49 @@
static void display_fsp_version_info_hob(const void *hob) { +#if CONFIG(DISPLAY_FSP_VERSION_INFO) || CONFIG(DISPLAY_FSP_VERSION_INFO_2) + + int index, cnt, tcount; + char *str_ptr; + uint8_t vs; #if CONFIG(DISPLAY_FSP_VERSION_INFO) const FIRMWARE_VERSION_INFO *fvi; const FIRMWARE_VERSION_INFO_HOB *fvih = (FIRMWARE_VERSION_INFO_HOB *)hob; - int index, cnt; - char *str_ptr;
fvi = (void *)&fvih[1]; str_ptr = (char *)((uintptr_t)fvi + (fvih->Count * sizeof(FIRMWARE_VERSION_INFO))); + tcount = fvih->Count; +#elif CONFIG(DISPLAY_FSP_VERSION_INFO_2)
- for (index = 0; index < fvih->Count; index++) { + uint8_t *hobstart = (uint8_t *) hob; + hobstart += sizeof(EFI_HOB_GUID_TYPE); + + const SMBIOS_TABLE_TYPE_OEM_INTEL_FVI *stfvi = + (SMBIOS_TABLE_TYPE_OEM_INTEL_FVI *)hobstart; + const INTEL_FIRMWARE_VERSION_INFO *fvi; + + str_ptr = ((char *) &(stfvi->Fvi[0])) + + (stfvi->Count * sizeof(INTEL_FIRMWARE_VERSION_INFO)); + tcount = stfvi->Count; + fvi = &stfvi->Fvi[0]; +#endif + + for (index = 0; index < tcount; index++) { cnt = strlen(str_ptr);
+#if CONFIG(DISPLAY_FSP_VERSION_INFO) + vs = fvi[index].VersionStringIndex; +#elif CONFIG(DISPLAY_FSP_VERSION_INFO_2) + vs = fvi[index].VersionString; +#endif /* Don't show ingredient name and version if its all 0xFF */ if (fvi[index].Version.MajorVersion == 0xFF && fvi[index].Version.MinorVersion == 0xFF && fvi[index].Version.Revision == 0xFF && fvi[index].Version.BuildNumber == 0xFF && - fvi[index].VersionStringIndex == 0) { + vs == 0) { str_ptr = (char *)((uintptr_t)str_ptr + cnt + sizeof(uint8_t)); continue; @@ -241,7 +264,7 @@ */ printk(BIOS_DEBUG, "%s = ", str_ptr);
- if (!fvi[index].VersionStringIndex) + if (!vs) printk(BIOS_DEBUG, "%x.%x.%x.%x\n", fvi[index].Version.MajorVersion, fvi[index].Version.MinorVersion, diff --git a/src/drivers/intel/fsp2_0/include/fsp/soc_binding.h b/src/drivers/intel/fsp2_0/include/fsp/soc_binding.h index 8781bde..8392a03 100644 --- a/src/drivers/intel/fsp2_0/include/fsp/soc_binding.h +++ b/src/drivers/intel/fsp2_0/include/fsp/soc_binding.h @@ -29,6 +29,8 @@ #include <FspsUpd.h> #if CONFIG(DISPLAY_FSP_VERSION_INFO) #include <FirmwareVersionInfoHob.h> +#elif CONFIG(DISPLAY_FSP_VERSION_INFO_2) +#include <FirmwareVersionInfo.h> #endif
#pragma pack(pop)