summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hendricks <dhendrix@chromium.org>2012-11-30 19:16:50 -0800
committerRonald G. Minnich <rminnich@gmail.com>2012-12-05 05:26:31 +0100
commit0f5caa26cb0b25ae452a14aedc71f5c137850a4e (patch)
tree3d922fa03403f7f35718f0ec1abf70c0b6cd3325
parentdab4238d102724c3d050e6bcf05887813dee5949 (diff)
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@chromium.org> Reviewed-on: http://review.coreboot.org/1962 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
-rw-r--r--src/console/console.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/console/console.c b/src/console/console.c
index 8f60f04d4c..d5f25a5fee 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).
+ */
+#ifdef HAVE_CMOS_DEFAULT
#include <pc80/mc146818rtc.h>
+#else
+static inline int get_option(void *dest, const char *name) { return -1; }
+#endif
/* initialize the console */
void console_init(void)