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>
This commit is contained in:
Hsuan Ting Chen 2021-04-29 16:15:08 +08:00 committed by Felix Held
parent 6f811f6d5c
commit 54bbe2da20

View File

@ -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);