[coreboot-gerrit] Patch set updated for coreboot: d8526c8 option: Add arch-agnostic get_option()

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Wed Feb 12 05:26:01 CET 2014


Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5157

-gerrit

commit d8526c8b8bfbd1cacaab685962df7db0e0bc59d4
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Tue Jan 28 10:02:53 2014 +0200

    option: 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 at gmail.com>
---
 src/console/console.c                  | 13 +------------
 src/console/uart8250_console.c         |  1 -
 src/console/uart8250mem_console.c      |  1 -
 src/include/option.h                   | 19 +++++++++++++++++++
 src/lib/uart8250.c                     |  2 +-
 src/lib/uart8250mem.c                  |  2 +-
 src/mainboard/intel/jarrell/watchdog.c |  1 +
 7 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/src/console/console.c b/src/console/console.c
index 38ac3e7..081113c 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 <option.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/option.h b/src/include/option.h
new file mode 100644
index 0000000..83f3a84
--- /dev/null
+++ b/src/include/option.h
@@ -0,0 +1,19 @@
+#ifndef _OPTION_H_
+#define _OPTION_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 /* _OPTION_H_ */
diff --git a/src/lib/uart8250.c b/src/lib/uart8250.c
index aa18d2a..b253ea4 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 <option.h>
 #include <trace.h>
 
 #if CONFIG_USE_OPTION_TABLE
diff --git a/src/lib/uart8250mem.c b/src/lib/uart8250mem.c
index 1482142..c2298a8 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 <option.h>
 #if CONFIG_USE_OPTION_TABLE
 #include "option_table.h"
 #endif
diff --git a/src/mainboard/intel/jarrell/watchdog.c b/src/mainboard/intel/jarrell/watchdog.c
index f7c42ca..7f7a039 100644
--- a/src/mainboard/intel/jarrell/watchdog.c
+++ b/src/mainboard/intel/jarrell/watchdog.c
@@ -1,4 +1,5 @@
 #include <device/pnp_def.h>
+#include <pc80/mc146818rtc.h>
 
 #define NSC_WD_DEV PNP_DEV(0x2e, 0xa)
 #define NSC_WDBASE 0x600



More information about the coreboot-gerrit mailing list