Kyösti Mälkki (kyosti.malkki@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5157
-gerrit
commit ec996b4742a95459e5e61e466808857abc63b540 Author: Kyösti Mälkki kyosti.malkki@gmail.com Date: Tue Jan 28 10:02:53 2014 +0200
nvram: Add arch-agnostic get_option()
We should not have pc80/ includes in UARTs or generally in lib/.
Change-Id: Id7da732b1ea094be01f45f9dbb49142f4e78f095 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- src/console/console.c | 13 +------------ src/console/uart8250_console.c | 1 - src/console/uart8250mem_console.c | 1 - src/include/nvram.h | 19 +++++++++++++++++++ src/lib/uart8250.c | 2 +- src/lib/uart8250mem.c | 2 +- 6 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/src/console/console.c b/src/console/console.c index 38ac3e7..9d8f924 100644 --- a/src/console/console.c +++ b/src/console/console.c @@ -25,18 +25,7 @@ #ifndef __PRE_RAM__ #include <string.h> #include <types.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). - */ -#if CONFIG_USE_OPTION_TABLE -#include <pc80/mc146818rtc.h> -#else -static inline enum cb_err get_option(void *dest, const char *name) - { return CB_CMOS_OTABLE_DISABLED; } -#endif +#include <nvram.h>
/* initialize the console */ void console_init(void) diff --git a/src/console/uart8250_console.c b/src/console/uart8250_console.c index 330ed68..196412c 100644 --- a/src/console/uart8250_console.c +++ b/src/console/uart8250_console.c @@ -19,7 +19,6 @@
#include <console/console.h> #include <uart8250.h> -#include <pc80/mc146818rtc.h>
static void ttyS0_init(void) { diff --git a/src/console/uart8250mem_console.c b/src/console/uart8250mem_console.c index ed77237..3833e47 100644 --- a/src/console/uart8250mem_console.c +++ b/src/console/uart8250mem_console.c @@ -19,7 +19,6 @@
#include <console/console.h> #include <uart8250.h> -#include <pc80/mc146818rtc.h>
static u32 uart_bar = 0;
diff --git a/src/include/nvram.h b/src/include/nvram.h new file mode 100644 index 0000000..6b1bfe8 --- /dev/null +++ b/src/include/nvram.h @@ -0,0 +1,19 @@ +#ifndef _NVRAM_H_ +#define _NVRAM_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). + */ +#if CONFIG_USE_OPTION_TABLE +#include <pc80/mc146818rtc.h> +#else +#include <types.h> +static inline enum cb_err get_option(void *dest, const char *name) +{ + return CB_CMOS_OTABLE_DISABLED; +} +#endif + +#endif /* _NVRAM_H_ */ diff --git a/src/lib/uart8250.c b/src/lib/uart8250.c index aa18d2a..19acf7d 100644 --- a/src/lib/uart8250.c +++ b/src/lib/uart8250.c @@ -20,7 +20,7 @@
#include <arch/io.h> #include <uart8250.h> -#include <pc80/mc146818rtc.h> +#include <nvram.h> #include <trace.h>
#if CONFIG_USE_OPTION_TABLE diff --git a/src/lib/uart8250mem.c b/src/lib/uart8250mem.c index 1482142..2cb8ee8 100644 --- a/src/lib/uart8250mem.c +++ b/src/lib/uart8250mem.c @@ -20,7 +20,7 @@
#include <arch/io.h> #include <uart8250.h> -#include <pc80/mc146818rtc.h> +#include <nvram.h> #if CONFIG_USE_OPTION_TABLE #include "option_table.h" #endif