soc/intel/cse: Move cse_store_rw_fw_version from cse_print_boot_partition_info

cse_store_rw_fw_version() stores CSE RW firmware version in global
variable or cbmem in romstage and ramstage respectively, based on the
stage it is called in. The call to this function is from the
cse_print_boot_partition_info() in cse_get_bp_info.

In the subsequent patches, the idea is to send the cse_get_bp_info early
in romstage and store in cbmem once memory is initialized. So when the
cse_fw_sync is called in early ramstage, the stored cse_bp_info_rsp is
used instead of sending the CSE get boot partition info command again.

To de-link the call to cse_store_rw_fw_version from cse_get_bp_info and
to ensure the CSE RW FW version is stored in all cases, moving the
function to do_cse_fw_sync.

BUG=b:273207144

Change-Id: I0add2c167c85cbddef2ecb4c019061a08562bbdf
Signed-off-by: Krishna Prasad Bhat <krishna.p.bhat.d@intel.com>
Signed-off-by: Rizwan Qureshi <rizwan.qureshi@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78051
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: sridhar siricilla <siricillasridhar@gmail.com>
This commit is contained in:
Krishna P Bhat D 2023-09-21 22:19:47 +05:30 committed by sridhar siricilla
parent c3c71c3783
commit 64ec6a77be
1 changed files with 8 additions and 5 deletions

View File

@ -278,8 +278,11 @@ static enum cse_fw_state get_cse_state(const struct fw_version *cur_cse_fw_ver,
* Helper function that stores current CSE firmware version to CBMEM memory,
* except during recovery mode.
*/
static void cse_store_rw_fw_version(const struct cse_bp_entry *cse_bp)
static void cse_store_rw_fw_version(void)
{
const struct cse_bp_entry *cse_bp;
cse_bp = cse_get_bp_entry(RW);
if (vboot_recovery_mode_enabled())
return;
@ -391,10 +394,6 @@ static void cse_print_boot_partition_info(void)
cse_bp->fw_ver.hotfix, cse_bp->fw_ver.build,
cse_bp->status, cse_bp->start_offset,
cse_bp->end_offset);
/* Store the CSE RW Firmware Version into CBMEM */
if (CONFIG(SOC_INTEL_STORE_CSE_FW_VERSION))
cse_store_rw_fw_version(cse_bp);
}
/*
@ -1282,6 +1281,10 @@ static void do_cse_fw_sync(void)
}
}
/* Store the CSE RW Firmware Version into CBMEM */
if (CONFIG(SOC_INTEL_STORE_CSE_FW_VERSION))
cse_store_rw_fw_version();
/*
* If system is in recovery mode, CSE Lite update has to be skipped but CSE
* sub-partitions like NPHY and IOM have to be updated. If CSE sub-partition update