From 5044dc48f34dfd7f0ff08363b2155e27b2f71830 Mon Sep 17 00:00:00 2001 From: Tarun Tuli Date: Tue, 31 Jan 2023 18:24:38 +0000 Subject: [PATCH] util/cbfstool: Add eventLog support for ELOG_TYPE_FW_EARLY_SOL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to support logging events for when we show early signs of life to the user during CSE FW syncs and MRC trainings add support for the ELOG_TYPE_FW_EARLY_SOL type. BUG=b:266113626 TEST=verify event shows in eventlog CSE sync/MRC training Change-Id: I3913cb8501de9a2605266cf9988a7195576cb91d Signed-off-by: Tarun Tuli Reviewed-on: https://review.coreboot.org/c/coreboot/+/71296 Reviewed-by: Jérémy Compostella Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik Reviewed-by: Nick Vaccaro Reviewed-by: Julius Werner --- util/cbfstool/eventlog.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/util/cbfstool/eventlog.c b/util/cbfstool/eventlog.c index 0ab8930548..058a3f7c0d 100644 --- a/util/cbfstool/eventlog.c +++ b/util/cbfstool/eventlog.c @@ -159,7 +159,7 @@ static void eventlog_print_type(const struct event_header *event) {ELOG_TYPE_EXTENDED_EVENT, "Extended 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_EOL, "End of log"}, }; @@ -460,6 +460,12 @@ static int eventlog_print_data(const struct event_header *event) {0, NULL}, }; + static const struct valstr early_sol_path_types[] = { + {ELOG_FW_EARLY_SOL_CSE_SYNC, "CSE Sync Early SOL Screen Shown"}, + {ELOG_FW_EARLY_SOL_MRC, "MRC Early SOL Screen Shown"}, + {0, NULL}, + }; + size_t elog_type_to_min_size[] = { [ELOG_TYPE_LOG_CLEAR] = sizeof(uint16_t), [ELOG_TYPE_BOOT] = sizeof(uint32_t), @@ -478,6 +484,7 @@ static int eventlog_print_data(const struct event_header *event) [ELOG_TYPE_EXTENDED_EVENT] = sizeof(struct elog_event_extended_event), [ELOG_TYPE_CROS_DIAGNOSTICS] = sizeof(uint8_t), [ELOG_TYPE_FW_VBOOT_INFO] = sizeof(uint16_t), + [ELOG_TYPE_FW_EARLY_SOL] = sizeof(uint8_t), [0xff] = 0, }; @@ -629,6 +636,11 @@ static int eventlog_print_data(const struct event_header *event) eventlog_printf("fw_prev_result=%s", vb2_result_string(info->prev_result)); break; } + case ELOG_TYPE_FW_EARLY_SOL: { + const uint8_t *sol_event = event_get_data(event); + eventlog_printf("%s", val2str(*sol_event, early_sol_path_types)); + break; + } default: break; }