Attention is currently required from: Rizwan Qureshi.
Hello Rizwan Qureshi,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/77070?usp=email
to review the following change.
Change subject: soc/intel/cse: Make cse_bp_info response global ......................................................................
soc/intel/cse: Make cse_bp_info response global
PSR data is created and stored in CSE data partition. In platforms that employ CSE Lite SKU firmware, a firmware downgrade involves clearing of CSE data partition which results in PSR data being lost.
CSE Lite SKU firmware supports a command to backup PSR data before initiating a firmware downgrade. PSR data backup command works only after memory has been initialized post FSP-M.
We are introducing a flow to support CSE switch from RO to RW and CSE firmware upgrade early in the romstage and downgrade post FSP-M in romstage in order to backup PSR data post DRAM initialization. A new function to do this on CBMEM_CREATION event will be added in subsequent patches. Hence make cse_bp_info response global so that we do not have to send GET_BOOT_PARTITION_INFO command again to get the boot partition info. The same data can be accessed later in the romstage.
BUG=b:273207144 TEST=Verify cse_bp_info_rsp holds value across romstage.
Change-Id: I0ee050b49fcae574882378b94329c36a228e6815 Signed-off-by: Krishna Prasad Bhat krishna.p.bhat.d@intel.com Signed-off-by: Rizwan Qureshi rizwan.qureshi@intel.com --- M src/soc/intel/common/block/cse/cse_lite.c 1 file changed, 9 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/70/77070/1
diff --git a/src/soc/intel/common/block/cse/cse_lite.c b/src/soc/intel/common/block/cse/cse_lite.c index 6203baa..d3b1222 100644 --- a/src/soc/intel/common/block/cse/cse_lite.c +++ b/src/soc/intel/common/block/cse/cse_lite.c @@ -132,6 +132,8 @@ struct cse_bp_info bp_info; } __packed;
+static struct get_bp_info_rsp cse_bp_info_rsp; + static const char * const cse_regions[] = {"RO", "RW"};
void cse_log_ro_write_protection_info(bool mfg_mode) @@ -1091,8 +1093,6 @@
static void do_cse_fw_sync(void) { - static struct get_bp_info_rsp cse_bp_info; - /* * If system is in recovery mode, skip CSE Lite update if CSE sub-partition update * is not enabled and continue to update CSE sub-partitions. @@ -1108,7 +1108,7 @@ return; }
- if (cse_get_bp_info(&cse_bp_info) != CB_SUCCESS) { + if (cse_get_bp_info(&cse_bp_info_rsp) != CB_SUCCESS) { printk(BIOS_ERR, "cse_lite: Failed to get CSE boot partition info\n");
/* If system is in recovery mode, don't trigger recovery again */ @@ -1127,7 +1127,7 @@ * fails during recovery, just continue to boot. */ if (CONFIG(SOC_INTEL_CSE_SUB_PART_UPDATE) && vboot_recovery_mode_enabled()) { - if (cse_sub_part_fw_update(&cse_bp_info.bp_info) == + if (cse_sub_part_fw_update(&cse_bp_info_rsp.bp_info) == CSE_LITE_SKU_PART_UPDATE_SUCCESS) { cse_board_reset(); do_global_reset(); @@ -1137,7 +1137,7 @@ return; }
- if (cse_fix_data_failure_err(&cse_bp_info.bp_info) != CB_SUCCESS) + if (cse_fix_data_failure_err(&cse_bp_info_rsp.bp_info) != CB_SUCCESS) cse_trigger_vboot_recovery(CSE_LITE_SKU_DATA_WIPE_ERROR);
/* @@ -1147,18 +1147,18 @@ */ if (is_cse_fw_update_enabled()) { uint8_t rv; - rv = cse_fw_update(&cse_bp_info.bp_info); + rv = cse_fw_update(&cse_bp_info_rsp.bp_info); if (rv) cse_trigger_vboot_recovery(rv); }
if (CONFIG(SOC_INTEL_CSE_SUB_PART_UPDATE)) - cse_sub_part_fw_update(&cse_bp_info.bp_info); + cse_sub_part_fw_update(&cse_bp_info_rsp.bp_info);
- if (!cse_is_rw_bp_status_valid(&cse_bp_info.bp_info)) + if (!cse_is_rw_bp_status_valid(&cse_bp_info_rsp.bp_info)) cse_trigger_vboot_recovery(CSE_LITE_SKU_RW_JUMP_ERROR);
- if (cse_boot_to_rw(&cse_bp_info.bp_info) != CB_SUCCESS) { + if (cse_boot_to_rw(&cse_bp_info_rsp.bp_info) != CB_SUCCESS) { printk(BIOS_ERR, "cse_lite: Failed to switch to RW\n"); cse_trigger_vboot_recovery(CSE_LITE_SKU_RW_SWITCH_ERROR); }