summaryrefslogtreecommitdiffstats
path: root/src/commonlib/bsd/include/commonlib/bsd/elog.h
diff options
context:
space:
mode:
authorSubrata Banik <subratabanik@google.com>2022-07-04 07:33:49 +0000
committerSubrata Banik <subratabanik@google.com>2022-08-02 07:06:30 +0000
commit2d20b68b6e0bb2ca8c9072261c77beb33762f9c0 (patch)
tree5bab164318fb157ca05ab42da547f13fcd2326a5 /src/commonlib/bsd/include/commonlib/bsd/elog.h
parent8c2cef02ac9d10b596db5f3fe7c9660973fec125 (diff)
downloadcoreboot-2d20b68b6e0bb2ca8c9072261c77beb33762f9c0.tar.gz
coreboot-2d20b68b6e0bb2ca8c9072261c77beb33762f9c0.tar.bz2
coreboot-2d20b68b6e0bb2ca8c9072261c77beb33762f9c0.zip
vc/google/elog: Record vboot FW boot information into elog
This patch calls into vboot API (vb2api_get_fw_boot_info) to retrieve FW slot boot information like (tries count, current boot slot, previous boot slot, previous boot status and boot mode). Upon retrieval of the vboot information, elog callback from ramstage records the info into the eventlog. Additionally, this patch refactors the existing event logging mechanism to add newer APIs to record vboot firmware boot related information. BUG=b:215615970 TEST=Build and boot google/kano to ChromeOS and run below command to check the cbmem log: Scenario 1: localhost ~ # cbmem -c | grep VB2 [INFO ] VB2:vb2_check_recovery() Recovery reason from previous boot: 0x0 / 0x0 [INFO ] VB2:vb2api_fill_boot_config() boot_mode=`Developer boot` VB2:vb2api_get_fw_boot_info() fw_tried=`A` fw_try_count=0 fw_prev_tried=`A` fw_prev_result=`Success`. .... Scenario 2: localhost ~ # crossystem recovery_request=1 localhost ~ # cbmem -c | grep VB2 [INFO ] VB2:vb2api_fill_boot_config() boot_mode=`Manual recovery boot` VB2:vb2api_fill_boot_config() recovery_reason=0x13 / 0x00 VB2:vb2api_get_fw_boot_info() fw_tried=`A` fw_try_count=0 fw_prev_tried=`A` fw_prev_result=`Unknown`. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I6882cd1c4dbe5e24f6460388cd1af4e4a05fc4da Reviewed-on: https://review.coreboot.org/c/coreboot/+/65561 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/commonlib/bsd/include/commonlib/bsd/elog.h')
-rw-r--r--src/commonlib/bsd/include/commonlib/bsd/elog.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/commonlib/bsd/include/commonlib/bsd/elog.h b/src/commonlib/bsd/include/commonlib/bsd/elog.h
index 44f10519579d..63761ebf53e9 100644
--- a/src/commonlib/bsd/include/commonlib/bsd/elog.h
+++ b/src/commonlib/bsd/include/commonlib/bsd/elog.h
@@ -314,6 +314,11 @@ struct elog_event_extended_event {
uint32_t event_complement;
} __packed;
+/*
+ * Firmware boot related information retrieved from vboot and store as
+ * per `union vb2_fw_boot_info` data structure.
+ */
+#define ELOG_TYPE_FW_VBOOT_INFO 0xb7
/* Only the 7-LSB are used for size */
#define ELOG_MAX_EVENT_SIZE 0x7F