From 64ec6a77be361c748e646af0967d14bdc0c52815 Mon Sep 17 00:00:00 2001 From: Krishna P Bhat D Date: Thu, 21 Sep 2023 22:19:47 +0530 Subject: 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 Signed-off-by: Rizwan Qureshi Reviewed-on: https://review.coreboot.org/c/coreboot/+/78051 Tested-by: build bot (Jenkins) Reviewed-by: sridhar siricilla --- src/soc/intel/common/block/cse/cse_lite.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/soc/intel/common/block/cse') diff --git a/src/soc/intel/common/block/cse/cse_lite.c b/src/soc/intel/common/block/cse/cse_lite.c index 6a5d55bd34..140a56d06f 100644 --- a/src/soc/intel/common/block/cse/cse_lite.c +++ b/src/soc/intel/common/block/cse/cse_lite.c @@ -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 -- cgit v1.2.3