summaryrefslogtreecommitdiffstats
path: root/src/vendorcode/google/chromeos/elog.c
diff options
context:
space:
mode:
authorSubrata Banik <subratabanik@google.com>2022-08-02 11:42:49 +0000
committerSubrata Banik <subratabanik@google.com>2022-08-06 14:06:33 +0000
commit151dcf49a67d5422a99be484c583e6cdbb094292 (patch)
treee5b90da7728f957183f78f94d735d3e8b47902cf /src/vendorcode/google/chromeos/elog.c
parent3a53da16321fcf9c31b657d0951b7c46851fd016 (diff)
downloadcoreboot-151dcf49a67d5422a99be484c583e6cdbb094292.tar.gz
coreboot-151dcf49a67d5422a99be484c583e6cdbb094292.tar.bz2
coreboot-151dcf49a67d5422a99be484c583e6cdbb094292.zip
util/elogtool: Mark redundant boot mode event type as `deprecated`
This patch adds `_DEPRECATED_` tag to ChromeOS boot mode related event logging types as below: * ELOG_TYPE_CROS_RECOVERY_MODE <---- to record recovery boot reason while booting into recovery mode * ELOG_TYPE_CROS_DEVELOPER_MODE <--- if the platform is booted into developer mode. * ELOG_TYPE_CROS_DIAGNOSTICS <---- if the platform is booted into diagnostic mode. Drop static structure `cros_deprecated_recovery_reasons` as it has been replaced by vb2_get_recovery_reason_string() function. ELOG_TYPE_FW_BOOT_INFO event type is now used to record all those related fw boot info along with ChromeOS boot mode/reason etc. BUG=b:215615970 TEST=Build and boot google/kano to ChromeOS. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I932952ce32337e2d54473667ce17582a90882da8 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65802 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/vendorcode/google/chromeos/elog.c')
-rw-r--r--src/vendorcode/google/chromeos/elog.c38
1 files changed, 2 insertions, 36 deletions
diff --git a/src/vendorcode/google/chromeos/elog.c b/src/vendorcode/google/chromeos/elog.c
index d8304f8b30c1..4d3fc4053741 100644
--- a/src/vendorcode/google/chromeos/elog.c
+++ b/src/vendorcode/google/chromeos/elog.c
@@ -8,33 +8,7 @@
#include <security/vboot/vboot_common.h>
#include <vb2_api.h>
-static void elog_add_boot_reason(void)
-{
- const int rec = vboot_recovery_mode_enabled();
- const int dev = vboot_developer_mode_enabled();
-
- if (rec) {
- const u8 reason = vboot_check_recovery_request();
- elog_add_event_byte(ELOG_TYPE_CROS_RECOVERY_MODE, reason);
- printk(BIOS_DEBUG, "%s: Logged recovery mode boot%s, reason: 0x%02x\n",
- __func__, dev ? " (Dev-switch on)" : "", reason);
- }
-
- /* Skip logging developer mode in ACPI resume path */
- if (dev && !acpi_is_wakeup_s3()) {
- elog_add_event(ELOG_TYPE_CROS_DEVELOPER_MODE);
- printk(BIOS_DEBUG, "%s: Logged dev mode boot\n", __func__);
- }
-
- /* Diagnostic boot if requested */
- if (vboot_get_context()->boot_mode == VB2_BOOT_MODE_DIAGNOSTICS) {
- elog_add_event_byte(ELOG_TYPE_CROS_DIAGNOSTICS,
- ELOG_CROS_LAUNCH_DIAGNOSTICS);
- printk(BIOS_DEBUG, "%s: Logged diagnostic boot\n", __func__);
- }
-}
-
-static void elog_add_vboot_info(void)
+static void elog_add_vboot_info(void *unused)
{
/* Skip logging boot info in ACPI resume path */
if (acpi_is_wakeup_s3())
@@ -50,12 +24,4 @@ static void elog_add_vboot_info(void)
elog_add_event_raw(ELOG_TYPE_FW_VBOOT_INFO, &data, width);
}
-static void elog_add_boot_records(void *unused)
-{
- /* Log boot reason into the eventlog */
- elog_add_boot_reason();
- /* Log fw vboot info into the eventlog */
- elog_add_vboot_info();
-}
-
-BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_ENTRY, elog_add_boot_records, NULL);
+BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_ENTRY, elog_add_vboot_info, NULL);