{driver, soc/intel/cmn/cse}: Refactor ISH FW Version implementation

This patch uses the CSE firmware specific data to store Intel
ISH firmware related information. Sending an ISH partition version
information command on every boot cycle would impact the overall boot
performance.

This information is used by the auto-test framework to ensure the ISH
firmware update is proper for in-field devices.

BUG=b:285405031
TEST=Able to build and boot google/rex. Verified ISH FW version is
getting displayed across warm resets without impacting the boot time.

Change-Id: I0242c26dd90d834815799f54740d8147ff9d45b7
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77176
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Subrata Banik 2023-08-17 15:44:52 +00:00
parent c8a0417574
commit 88512b00ad
2 changed files with 14 additions and 10 deletions

View File

@ -50,15 +50,15 @@ static void intel_ish_enable(struct device *dev)
static void intel_ish_get_version(void) static void intel_ish_get_version(void)
{ {
struct cse_fw_partition_info *version = cbmem_find(CBMEM_ID_CSE_PARTITION_VERSION); struct cse_specific_info *info = cbmem_find(CBMEM_ID_CSE_INFO);
if (version == NULL) if (info == NULL)
return; return;
printk(BIOS_DEBUG, "ISH version: %d.%d.%d.%d\n", printk(BIOS_DEBUG, "ISH version: %d.%d.%d.%d\n",
version->ish_partition_info.cur_ish_fw_version.major, info->cse_fwp_version.ish_partition_info.cur_ish_fw_version.major,
version->ish_partition_info.cur_ish_fw_version.minor, info->cse_fwp_version.ish_partition_info.cur_ish_fw_version.minor,
version->ish_partition_info.cur_ish_fw_version.hotfix, info->cse_fwp_version.ish_partition_info.cur_ish_fw_version.hotfix,
version->ish_partition_info.cur_ish_fw_version.build); info->cse_fwp_version.ish_partition_info.cur_ish_fw_version.build);
} }
static void intel_ish_final(struct device *dev) static void intel_ish_final(struct device *dev)

View File

@ -1333,12 +1333,13 @@ static void store_ish_version(void)
if (vboot_recovery_mode_enabled()) if (vboot_recovery_mode_enabled())
return; return;
struct cse_fw_partition_info *version; struct cse_specific_info *info = cbmem_find(CBMEM_ID_CSE_INFO);
size_t size = sizeof(struct fw_version); if (info == NULL)
version = cbmem_find(CBMEM_ID_CSE_PARTITION_VERSION);
if (version == NULL)
return; return;
struct cse_fw_partition_info *version = &(info->cse_fwp_version);
size_t size = sizeof(struct fw_version);
/* /*
* Compare if stored cse version (from the previous boot) is same as current * Compare if stored cse version (from the previous boot) is same as current
* running cse version. * running cse version.
@ -1360,6 +1361,9 @@ static void store_ish_version(void)
/* Since cse version has been updated, ish version needs to be updated. */ /* Since cse version has been updated, ish version needs to be updated. */
memcpy(&(version->ish_partition_info.cur_ish_fw_version), memcpy(&(version->ish_partition_info.cur_ish_fw_version),
&(resp.manifest_data.version), size); &(resp.manifest_data.version), size);
/* Update the CRC */
cbmem_store_cse_info_crc(info);
} }
} }
} }