summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrishna Prasad Bhat <krishna.p.bhat.d@intel.com>2023-08-07 10:24:37 +0530
committerFelix Held <felix-coreboot@felixheld.de>2023-08-25 14:40:40 +0000
commit93be5d5d078ba84a6256cae7f6ac1ac773b86d7d (patch)
tree9c01ff70be31ad85f7fe0e899e79b10ca613b813
parent055b8746580c4957c05ec51b147495200eeb319e (diff)
util/cbfstool: Add eventlog support for PSR data backup status
In order to support logging of events for PSR data backup command status during CSE firmware downgrade, add support for ELOG_TYPE_PSR_DATA_BACKUP and ELOG_TYPE_PSR_DATA_LOST types. BRANCH=None BUG=b:273207144 TEST=Verify event shows in eventlog after CSE firmware downgrade Change-Id: Ibb78ac8d420bb7a64328ce009ddcb99030519ec6 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/+/77005 Reviewed-by: Sridhar Siricilla <sridhar.siricilla@intel.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anil Kumar K <anil.kumar.k@intel.com>
-rw-r--r--util/cbfstool/eventlog.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/util/cbfstool/eventlog.c b/util/cbfstool/eventlog.c
index 237360e109..604eb35ceb 100644
--- a/util/cbfstool/eventlog.c
+++ b/util/cbfstool/eventlog.c
@@ -166,6 +166,8 @@ static void eventlog_print_type(const struct event_header *event)
{ELOG_TYPE_CROS_DIAGNOSTICS, "Diagnostics Mode"},
{ELOG_TYPE_FW_VBOOT_INFO, "Firmware vboot info"},
{ELOG_TYPE_FW_EARLY_SOL, "Early Sign of Life"},
+ {ELOG_TYPE_PSR_DATA_BACKUP, "PSR data backup"},
+ {ELOG_TYPE_PSR_DATA_LOST, "PSR data lost"},
{ELOG_TYPE_EOL, "End of log"},
};
@@ -472,6 +474,12 @@ static int eventlog_print_data(const struct event_header *event)
{0, NULL},
};
+ static const struct valstr psr_data_backup_statuses[] = {
+ {ELOG_PSR_DATA_BACKUP_SUCCESS, "Success"},
+ {ELOG_PSR_DATA_BACKUP_FAILED, "Fail"},
+ {0, NULL},
+ };
+
size_t elog_type_to_min_size[] = {
[ELOG_TYPE_LOG_CLEAR] = sizeof(uint16_t),
[ELOG_TYPE_BOOT] = sizeof(uint32_t),
@@ -491,6 +499,7 @@ static int eventlog_print_data(const struct event_header *event)
[ELOG_TYPE_CROS_DIAGNOSTICS] = sizeof(uint8_t),
[ELOG_TYPE_FW_VBOOT_INFO] = sizeof(uint16_t),
[ELOG_TYPE_FW_EARLY_SOL] = sizeof(uint8_t),
+ [ELOG_TYPE_PSR_DATA_BACKUP] = sizeof(uint8_t),
[0xff] = 0,
};
@@ -647,6 +656,11 @@ static int eventlog_print_data(const struct event_header *event)
eventlog_printf("%s", val2str(*sol_event, early_sol_path_types));
break;
}
+ case ELOG_TYPE_PSR_DATA_BACKUP: {
+ const uint8_t *psr_backup_event = event_get_data(event);
+ eventlog_printf("%s", val2str(*psr_backup_event, psr_data_backup_statuses));
+ break;
+ }
default:
break;
}