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>
This commit is contained in:
David Hendricks 2012-11-30 19:16:50 -08:00 committed by Ronald G. Minnich
parent dab4238d10
commit 0f5caa26cb
1 changed files with 10 additions and 0 deletions

View File

@ -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)