summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2016-08-08 16:18:28 -0700
committerJulius Werner <jwerner@chromium.org>2016-08-10 02:54:21 +0200
commita46ee4d34d6b7ce7d47882779c7fb36270ccbda1 (patch)
treecb8bea702a1a3b342d4c178b682605112fb96369 /src
parenteec1c28bd424ece0b60abda21912c4e8f51ff3ba (diff)
downloadcoreboot-a46ee4d34d6b7ce7d47882779c7fb36270ccbda1.tar.gz
coreboot-a46ee4d34d6b7ce7d47882779c7fb36270ccbda1.tar.bz2
coreboot-a46ee4d34d6b7ce7d47882779c7fb36270ccbda1.zip
elog: Ensure eventlog will always get initialized when configured in
Commit 0d9cd92e (chromeos: Clean up elog handling) removed the individual elog_init() calls from mainboards that did them and automated adding certain events through the boot state machine. Unfortunately, the new code would sometimes not log any specific event at all, and thereby also never call elog_init() (through elog_add_event()) which adds the "System boot" event. We can assume that any board that configures the eventlog at all actually wants to use it, so let's just add another call to elog_init() to the boot state machine so we can ensure it gets called at least once. BRANCH=None BUG=chrome-os-partner:56001 TEST=Booted Kevin, confirmed that eventlog code runs again. Change-Id: Ibe7bfc94b3e3d11ba881399a39f9915991c89d8c Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/16118 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src')
-rw-r--r--src/drivers/elog/elog.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/drivers/elog/elog.c b/src/drivers/elog/elog.c
index 0981d777cce0..0c2bc04dc5c3 100644
--- a/src/drivers/elog/elog.c
+++ b/src/drivers/elog/elog.c
@@ -16,6 +16,7 @@
#if CONFIG_HAVE_ACPI_RESUME == 1
#include <arch/acpi.h>
#endif
+#include <bootstate.h>
#include <cbmem.h>
#include <console/console.h>
#if CONFIG_ARCH_X86
@@ -885,3 +886,7 @@ int elog_add_event_wake(u8 source, u32 instance)
};
return elog_add_event_raw(ELOG_TYPE_WAKE_SOURCE, &wake, sizeof(wake));
}
+
+/* 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);