[coreboot] Patch set updated for coreboot: 3a7e42f Conditionally include mc146818rtc in console.c

David Hendricks (dhendrix@chromium.org) gerrit at coreboot.org
Wed Dec 5 05:05:12 CET 2012

David Hendricks (dhendrix at chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1962


commit 3a7e42f9090e91695d2fd9181c944fd224d813f8
Author: David Hendricks <dhendrix at chromium.org>
Date:   Fri Nov 30 19:16:50 2012 -0800

    Conditionally include mc146818rtc in console.c
    get_option() is used to get a config option (debug loglevel) from
    CMOS. However, not all machines have CMOS, so define a dummy inline
    function that will return an error code so the caller (console_init())
    will use the default loglevel.
    Change-Id: I6adf371d79164178f40a83f7608289a6a7673357
    Signed-off-by: David Hendricks <dhendrix at chromium.org>
 src/console/console.c          | 10 ++++++++++
 src/include/pc80/mc146818rtc.h |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/src/console/console.c b/src/console/console.c
index 8f60f04..d5f25a5 100644
--- a/src/console/console.c
+++ b/src/console/console.c
@@ -24,7 +24,17 @@
 #ifndef __PRE_RAM__
 #include <string.h>
+ * FIXME: get_option() needs to be abstracted better so that other non-volatile
+ * storage can be used. This will benefit machines without CMOS as well as those
+ * without a battery-backed CMOS (e.g. some laptops).
+ */
 #include <pc80/mc146818rtc.h>
+static inline int get_option(void *dest, const char *name) { return -1; }
 /* initialize the console */
 void console_init(void)
diff --git a/src/include/pc80/mc146818rtc.h b/src/include/pc80/mc146818rtc.h
index ee1473b..15d35bb 100644
--- a/src/include/pc80/mc146818rtc.h
+++ b/src/include/pc80/mc146818rtc.h
@@ -167,6 +167,8 @@ static inline void cmos_write32(u8 offset, u32 value)
+#define get_option(a,b) -1
 #if !defined(__ROMCC__)
 void rtc_init(int invalid);
 void rtc_check_update_cmos_date(u8 has_century);

More information about the coreboot mailing list