2 * This file is part of the coreboot project.
4 * Copyright (C) 2014 The ChromiumOS Authors. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #include <bootstate.h>
17 #include <console/console.h>
19 #include <vboot/vboot_common.h>
21 static void elog_add_boot_reason(void *unused
)
23 int rec
= vboot_recovery_mode_enabled();
24 int dev
= vboot_developer_mode_enabled();
30 u8 reason
= vboot_check_recovery_request();
31 elog_add_event_byte(ELOG_TYPE_CROS_RECOVERY_MODE
, reason
);
32 printk(BIOS_DEBUG
, "%s: Logged recovery mode boot%s, "
33 "reason: 0x%02x\n", __func__
,
34 dev
? " (Dev-switch on)" : "", reason
);
38 elog_add_event(ELOG_TYPE_CROS_DEVELOPER_MODE
);
39 printk(BIOS_DEBUG
, "%s: Logged dev mode boot\n", __func__
);
43 BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE
, BS_ON_ENTRY
, elog_add_boot_reason
, NULL
);