summaryrefslogtreecommitdiff
path: root/src/soc/intel/common
diff options
context:
space:
mode:
authorKrishna Prasad Bhat <krishna.p.bhat.d@intel.com>2023-06-12 15:04:08 +0530
committerSubrata Banik <subratabanik@google.com>2023-10-04 05:51:31 +0000
commitb58fd2de04bbf330d26ad42cdaa43b17e7cde876 (patch)
treee4add2e9bead66102173056e294d3ee8dc751d89 /src/soc/intel/common
parenta2d10bb029e7da6d18f50cc694b9da54deb462b2 (diff)
soc/intel/cse: Add entries to eventlog on PSR backup events
This patch adds eventlog entries for the below scenarios: 1. To indicate success or failure of PSR data back-up command 2. To indicate the loss of PSR data when CSE update is corrupted, and data clear command is issued to clear the data. 3. To indicate the loss of PSR data when CSE boot partition info response is corrupted and data back-up is not initiated. BRANCH=None BUG=b:273207144 TEST=Verify elog event added after PSR data backup command is sent cse_lite: PSR_HECI_FW_DOWNGRADE_BACKUP command sent ... ELOG: Event(B9) added with size 10 at 2023-06-27 06:44:49 UTC Change-Id: I2459a2b941d28a87b6c78f75dbe8779d73328d7a 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/+/75760 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anil Kumar K <anil.kumar.k@intel.com> Reviewed-by: Subrata Banik <subratabanik@google.com>
Diffstat (limited to 'src/soc/intel/common')
-rw-r--r--src/soc/intel/common/block/cse/cse_lite.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/soc/intel/common/block/cse/cse_lite.c b/src/soc/intel/common/block/cse/cse_lite.c
index d968bff474..bd06bbf0ba 100644
--- a/src/soc/intel/common/block/cse/cse_lite.c
+++ b/src/soc/intel/common/block/cse/cse_lite.c
@@ -7,6 +7,7 @@
#include <console/console.h>
#include <cpu/cpu.h>
#include <crc_byte.h>
+#include <elog.h>
#include <fmap.h>
#include <intelbasecode/debug_feature.h>
#include <intelblocks/cse.h>
@@ -986,6 +987,8 @@ static enum csme_failure_reason cse_update_rw(const void *cse_cbfs_rw, const siz
static enum cb_err cse_prep_for_rw_update(enum cse_update_status status)
{
+ if (status == CSE_UPDATE_CORRUPTED)
+ elog_add_event(ELOG_TYPE_PSR_DATA_LOST);
/*
* To set CSE's operation mode to HMRFPO mode:
* 1. Ensure CSE to boot from RO(BP1)
@@ -1095,9 +1098,10 @@ static void backup_psr_data(void)
{
printk(BIOS_DEBUG, "cse_lite: Initiate PSR data backup flow\n");
/* Switch CSE to RW to send PSR_HECI_FW_DOWNGRADE_BACKUP command */
- if (cse_boot_to_rw() != CB_SUCCESS)
+ if (cse_boot_to_rw() != CB_SUCCESS) {
+ elog_add_event(ELOG_TYPE_PSR_DATA_LOST);
goto update_and_exit;
-
+ }
/*
* The function to check for PSR feature support can only be called after
* switching to RW partition. The command MKHI_FWCAPS_GET_FW_FEATURE_STATE
@@ -1116,6 +1120,7 @@ static void backup_psr_data(void)
if (!cse_is_hfs1_cws_normal() || !cse_is_hfs1_com_normal()) {
printk(BIOS_DEBUG, "cse_lite: PSR_HECI_FW_DOWNGRADE_BACKUP command "
"prerequisites not met!\n");
+ elog_add_event(ELOG_TYPE_PSR_DATA_LOST);
goto update_and_exit;
}
@@ -1138,18 +1143,27 @@ static void backup_psr_data(void)
printk(BIOS_DEBUG, "cse_lite: Send PSR_HECI_FW_DOWNGRADE_BACKUP command\n");
if (heci_send_receive(&req, sizeof(req),
- &backup_psr_resp, &resp_size, HECI_PSR_ADDR))
+ &backup_psr_resp, &resp_size, HECI_PSR_ADDR)) {
printk(BIOS_ERR, "cse_lite: could not backup PSR data\n");
- else
- if (backup_psr_resp.status != PSR_STATUS_SUCCESS)
+ elog_add_event_byte(ELOG_TYPE_PSR_DATA_BACKUP, ELOG_PSR_DATA_BACKUP_FAILED);
+ } else {
+ if (backup_psr_resp.status != PSR_STATUS_SUCCESS) {
printk(BIOS_ERR, "cse_lite: PSR_HECI_FW_DOWNGRADE_BACKUP command "
"returned %u\n", backup_psr_resp.status);
+ elog_add_event_byte(ELOG_TYPE_PSR_DATA_BACKUP,
+ ELOG_PSR_DATA_BACKUP_FAILED);
+ } else {
+ elog_add_event_byte(ELOG_TYPE_PSR_DATA_BACKUP,
+ ELOG_PSR_DATA_BACKUP_SUCCESS);
+ }
+ }
update_and_exit:
/*
* An attempt to send PSR back-up command has been made. Update this info in CMOS and
* send success once backup_psr_data() has been called. We do not want to put the system
* into recovery for PSR data backup command pre-requisites not being met.
+ * We cannot do much if CSE fails to backup the PSR data, except create an event log.
*/
update_psr_backup_status(PSR_BACKUP_DONE);
return;