summaryrefslogtreecommitdiff
path: root/src/drivers/elog/elog.c
diff options
context:
space:
mode:
authorRichard Spiegel <richard.spiegel@amd.corp-partner.google.com>2018-08-20 13:51:30 -0700
committerMartin Roth <martinroth@google.com>2018-08-22 15:35:47 +0000
commite6809907e7ea2dcecb8f94222dfde9f2d52de688 (patch)
tree50341201ade49e4b9783ce7b0e2c7b525b94a9de /src/drivers/elog/elog.c
parenta07366c9f90a623081adfb426920cd8cf6d81f61 (diff)
downloadcoreboot-e6809907e7ea2dcecb8f94222dfde9f2d52de688.tar.xz
drivers/elog/elog.c: Create extended event
For debug reasons, sometimes you not only want to log an event, but also some extra information that would help debugging. Create an extended event reporting event type with a dword complement, and define extended events for failing to enter S3 due to pending wake event (one for pm1 and one for gpe0). BUG=b:111100312 TEST=Add a fake pending wake event, build and boot grunt, see the event in eventlog.txt. Change-Id: I3e8df0953db09197d6d8145b0fc1e583379deaa5 Signed-off-by: Richard Spiegel <richard.spiegel@silverbackltd.com> Reviewed-on: https://review.coreboot.org/28246 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/drivers/elog/elog.c')
-rw-r--r--src/drivers/elog/elog.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/drivers/elog/elog.c b/src/drivers/elog/elog.c
index 6fc4053a4f..d3c01c2d58 100644
--- a/src/drivers/elog/elog.c
+++ b/src/drivers/elog/elog.c
@@ -933,6 +933,17 @@ int elog_add_event_wake(u8 source, u32 instance)
return elog_add_event_raw(ELOG_TYPE_WAKE_SOURCE, &wake, sizeof(wake));
}
+int elog_add_extended_event(u8 type, u32 complement)
+{
+ struct elog_event_extended_event event = {
+ .event_type = type,
+ .event_complement = complement
+ };
+ return elog_add_event_raw(ELOG_TYPE_EXTENDED_EVENT,
+ &event,
+ sizeof(event));
+}
+
/* Make sure elog_init() runs at least once to log System Boot event. */
static void elog_bs_init(void *unused) { elog_init(); }
BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_ENTRY, elog_bs_init, NULL);