[coreboot-gerrit] New patch to review for coreboot: b625ca8 elog: Do not attempt to init SPI
Marc Jones (marc.jones@se-eng.com)
gerrit at coreboot.org
Tue Dec 16 23:37:21 CET 2014
Marc Jones (marc.jones at se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7831
-gerrit
commit b625ca82bc00f8447f4b9be072627ce816c6d911
Author: David Hendricks <dhendrix at chromium.org>
Date: Sun Apr 13 16:45:31 2014 -0700
elog: Do not attempt to init SPI
This severs a dependency the eventlog code has on initializing
chipset/SoC SPI controller. Currently elog_init() calls spi_init()
as a catch-all. This worked for x86 since the SPI controller is only
used for one thing on existing platforms. As we add eventlogging
support to non-x86 platforms we need to consider the more generalized
case where the assumptions about how SPI works on x86 are no longer
valid.
BUG=none
BRANCH=none
Signed-off-by: David Hendricks <dhendrix at chromium.org>
TEST=built and booted on Link, Beltino and Rambi. See below for
"mosys eventlog list" output on Link showing boot and suspend/resume
events (including lid close/open) added successfully.
localhost ~ # mosys eventlog list
0 | 2014-04-14 13:52:44 | Log area cleared | 4096
1 | 2014-04-14 13:52:44 | System boot | 50
2 | 2014-04-14 13:52:44 | EC Event | Power Button
3 | 2014-04-14 13:52:44 | SUS Power Fail
4 | 2014-04-14 13:52:44 | System Reset
5 | 2014-04-14 13:52:44 | ACPI Wake | S5
6 | 2014-04-14 13:53:25 | ACPI Enter | S3
7 | 2014-04-14 13:53:35 | ACPI Wake | S3
8 | 2014-04-14 13:53:35 | Wake Source | RTC Alarm | 0
9 | 2014-04-14 13:53:49 | ACPI Enter | S3
10 | 2014-04-14 13:54:00 | EC Event | Lid Open
11 | 2014-04-14 13:54:00 | ACPI Wake | S3
12 | 2014-04-14 13:54:00 | Wake Source | GPIO | 15
Original-Change-Id: I26e25c0a856f7b8db5ab6b8e7e1acae291d2eadc
Original-Reviewed-on: https://chromium-review.googlesource.com/194526
Original-Reviewed-by: David Hendricks <dhendrix at chromium.org>
Original-Commit-Queue: David Hendricks <dhendrix at chromium.org>
Original-Tested-by: David Hendricks <dhendrix at chromium.org>
(cherry picked from commit 2971d20b6ebdd9803b05ccbbaeefe1bde1a21af4)
Signed-off-by: Marc Jones <marc.jones at se-eng.com>
Change-Id: Ia5f2913fd8e4fee6e741e6d1e39d32bb86525cb3
---
src/drivers/elog/elog.c | 3 +--
src/include/elog.h | 1 +
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/drivers/elog/elog.c b/src/drivers/elog/elog.c
index 059b089..94af16e 100644
--- a/src/drivers/elog/elog.c
+++ b/src/drivers/elog/elog.c
@@ -546,8 +546,7 @@ int elog_init(void)
elog_debug("elog_init()\n");
- /* Prepare SPI */
- spi_init();
+ /* Probe SPI chip. SPI controller must already be initialized. */
elog_spi = spi_flash_probe(CONFIG_BOOT_MEDIA_SPI_BUS, 0);
if (!elog_spi) {
printk(BIOS_ERR, "ELOG: Unable to find SPI flash\n");
diff --git a/src/include/elog.h b/src/include/elog.h
index 648ce42..7727545 100644
--- a/src/include/elog.h
+++ b/src/include/elog.h
@@ -148,6 +148,7 @@ struct elog_event_data_me_extended {
/* CPU Thermal Trip */
#define ELOG_TYPE_THERM_TRIP 0xa7
+/* Eventlog backing storage must be initialized before calling elog_init(). */
extern int elog_init(void);
extern int elog_clear(void);
extern void elog_add_event_raw(u8 event_type, void *data, u8 data_size);
More information about the coreboot-gerrit
mailing list