Krishna P Bhat D has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/75760?usp=email )
Change subject: elog: Add PSR backup eventlog messages ......................................................................
elog: Add PSR backup eventlog messages
Change-Id: I2459a2b941d28a87b6c78f75dbe8779d73328d7a Signed-off-by: Krishna Prasad Bhat krishna.p.bhat.d@intel.com --- M src/commonlib/bsd/include/commonlib/bsd/elog.h M src/soc/intel/common/block/cse/cse_lite.c 2 files changed, 18 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/75760/1
diff --git a/src/commonlib/bsd/include/commonlib/bsd/elog.h b/src/commonlib/bsd/include/commonlib/bsd/elog.h index 783557f..9ab5232 100644 --- a/src/commonlib/bsd/include/commonlib/bsd/elog.h +++ b/src/commonlib/bsd/include/commonlib/bsd/elog.h @@ -372,6 +372,13 @@ /* Only the 7-LSB are used for size */ #define ELOG_MAX_EVENT_SIZE 0x7F
+/* PSR Events */ +#define ELOG_TYPE_PSR_DATA_BACKUP 0xb9 +#define ELOG_PSR_DATA_BACKUP_SUCCESS 0 +#define ELOG_PSR_DATA_BACKUP_FAILED 1 + +#define ELOG_PSR_DATA_LOST 0xba + enum cb_err elog_verify_header(const struct elog_header *header); const struct event_header *elog_get_next_event(const struct event_header *event); const void *event_get_data(const struct event_header *event); diff --git a/src/soc/intel/common/block/cse/cse_lite.c b/src/soc/intel/common/block/cse/cse_lite.c index eff5bb7..1088acf 100644 --- a/src/soc/intel/common/block/cse/cse_lite.c +++ b/src/soc/intel/common/block/cse/cse_lite.c @@ -6,6 +6,7 @@ #include <commonlib/region.h> #include <console/console.h> #include <cpu/cpu.h> +#include <elog.h> #include <fmap.h> #include <intelbasecode/debug_feature.h> #include <intelblocks/cse.h> @@ -786,11 +787,18 @@ if (heci_send_receive(&req, sizeof(req), &backup_psr_resp, &resp_size, HECI_PSR_ADDR)) { printk(BIOS_ERR, "cse_lite: could not backup PSR data\n"); + elog_add_event_byte(ELOG_TYPE_PSR_DATA_BACKUP, ELOG_PSR_DATA_BACKUP_FAILED); } else { printk(BIOS_DEBUG, "cse_lite: PSR_HECI_FW_DOWNGRADE_BACKUP command sent\n"); - if (backup_psr_resp.status != PSR_STATUS_SUCCESS) + if (backup_psr_resp.status != PSR_STATUS_SUCCESS) { printk(BIOS_DEBUG, "cse_lite: PSR_HECI_FW_DOWNGRADE_BACKUP command" "returned %d\n", (int)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); + } }
/* We have sent PSR backup command. Update this info in CMOS */ @@ -806,6 +814,8 @@ if (status == CSE_UPDATE_DOWNGRADE) backup_psr_data(cse_bp_info);
+ if (status == CSE_UPDATE_CORRUPTED) + elog_add_event(ELOG_PSR_DATA_LOST); /* * To set CSE's operation mode to HMRFPO mode: * 1. Ensure CSE to boot from RO(BP1)