summaryrefslogtreecommitdiff
path: root/src/vendorcode/google
diff options
context:
space:
mode:
authorHsuan Ting Chen <roccochen@chromium.org>2021-04-29 16:15:08 +0800
committerFelix Held <felix-coreboot@felixheld.de>2022-01-11 23:44:51 +0000
commit54bbe2da20dcb70f76a16c21dffe0780d1f6bac3 (patch)
tree31400c6ed90e4d79a1be437ab58e6882dcc3bed9 /src/vendorcode/google
parent6f811f6d5c3f61ac54927a2aa660f35c7538de6b (diff)
chromeos: Add an elog for Chrome OS diagnostic boot
Add an elog type 0xb6 for Chrome OS diagnostics related events and log the message while booting the diagnostic tool: __func__: Logged diagnostic boot BRANCH=none BUG=b:185551931, b:177196147 TEST=emerge-volteer coreboot vboot_reference Change-Id: Icb675fc431d4c45e4f432b2d12cac6dcfb2d5e3a Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/54948 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/vendorcode/google')
-rw-r--r--src/vendorcode/google/chromeos/elog.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/vendorcode/google/chromeos/elog.c b/src/vendorcode/google/chromeos/elog.c
index dff75204a5..b7f7c8d8fc 100644
--- a/src/vendorcode/google/chromeos/elog.c
+++ b/src/vendorcode/google/chromeos/elog.c
@@ -4,6 +4,7 @@
#include <bootstate.h>
#include <console/console.h>
#include <elog.h>
+#include <security/vboot/misc.h>
#include <security/vboot/vboot_common.h>
static void elog_add_boot_reason(void *unused)
@@ -20,10 +21,16 @@ static void elog_add_boot_reason(void *unused)
/* 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__);
+ }
}
BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_ENTRY, elog_add_boot_reason, NULL);