ELOG: Fix reporting of developer/recovery modes

Recent changes in EC/Vboot/U-boot have completely broken
the logging of developer and recovery modes.

Recovery mode may not be in VBNV, so if that is zero and
yet we are in recovery mode then assume it is there because
the button/key was pressed.

Since there may not be any actual developer mode switch
we look if option rom is loaded and the system is not
in recovery mode and consider that as developer mode.

Change-Id: I70104877b24de477217e1ff5b3a019aef22343ec
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/1346
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
Duncan Laurie 2012-07-16 12:47:45 -07:00 committed by Ronald G. Minnich
parent c1c9435863
commit 8de884424c
2 changed files with 7 additions and 3 deletions

View File

@ -104,6 +104,7 @@ struct elog_event_data_wake {
/* Chrome OS related events */ /* Chrome OS related events */
#define ELOG_TYPE_CROS_DEVELOPER_MODE 0xa0 #define ELOG_TYPE_CROS_DEVELOPER_MODE 0xa0
#define ELOG_TYPE_CROS_RECOVERY_MODE 0xa1 #define ELOG_TYPE_CROS_RECOVERY_MODE 0xa1
#define ELOG_CROS_RECOVERY_MODE_BUTTON 0x02
/* Management Engine Events */ /* Management Engine Events */
#define ELOG_TYPE_MANAGEMENT_ENGINE 0xa2 #define ELOG_TYPE_MANAGEMENT_ENGINE 0xa2

View File

@ -37,11 +37,14 @@ void chromeos_init_vboot(chromeos_acpi_t *chromeos)
memcpy(vboot_data->mehh, me_hash_saved, sizeof(vboot_data->mehh)); memcpy(vboot_data->mehh, me_hash_saved, sizeof(vboot_data->mehh));
#if CONFIG_ELOG #if CONFIG_ELOG
if (developer_mode_enabled()) if (developer_mode_enabled() ||
(vboot_wants_oprom() && !recovery_mode_enabled()))
elog_add_event(ELOG_TYPE_CROS_DEVELOPER_MODE); elog_add_event(ELOG_TYPE_CROS_DEVELOPER_MODE);
if (recovery_mode_enabled()) if (recovery_mode_enabled()) {
int reason = get_recovery_mode_from_vbnv();
elog_add_event_byte(ELOG_TYPE_CROS_RECOVERY_MODE, elog_add_event_byte(ELOG_TYPE_CROS_RECOVERY_MODE,
get_recovery_mode_from_vbnv()); reason ? reason : ELOG_CROS_RECOVERY_MODE_BUTTON);
}
#endif #endif
} }