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>
This commit is contained in:
Krishna Prasad Bhat 2023-08-07 10:24:37 +05:30 committed by Felix Held
parent 055b874658
commit 93be5d5d07
1 changed files with 14 additions and 0 deletions

View File

@ -166,6 +166,8 @@ static void eventlog_print_type(const struct event_header *event)
{ELOG_TYPE_CROS_DIAGNOSTICS, "Diagnostics Mode"}, {ELOG_TYPE_CROS_DIAGNOSTICS, "Diagnostics Mode"},
{ELOG_TYPE_FW_VBOOT_INFO, "Firmware vboot info"}, {ELOG_TYPE_FW_VBOOT_INFO, "Firmware vboot info"},
{ELOG_TYPE_FW_EARLY_SOL, "Early Sign of Life"}, {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"}, {ELOG_TYPE_EOL, "End of log"},
}; };
@ -472,6 +474,12 @@ static int eventlog_print_data(const struct event_header *event)
{0, NULL}, {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[] = { size_t elog_type_to_min_size[] = {
[ELOG_TYPE_LOG_CLEAR] = sizeof(uint16_t), [ELOG_TYPE_LOG_CLEAR] = sizeof(uint16_t),
[ELOG_TYPE_BOOT] = sizeof(uint32_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_CROS_DIAGNOSTICS] = sizeof(uint8_t),
[ELOG_TYPE_FW_VBOOT_INFO] = sizeof(uint16_t), [ELOG_TYPE_FW_VBOOT_INFO] = sizeof(uint16_t),
[ELOG_TYPE_FW_EARLY_SOL] = sizeof(uint8_t), [ELOG_TYPE_FW_EARLY_SOL] = sizeof(uint8_t),
[ELOG_TYPE_PSR_DATA_BACKUP] = sizeof(uint8_t),
[0xff] = 0, [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)); eventlog_printf("%s", val2str(*sol_event, early_sol_path_types));
break; 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: default:
break; break;
} }