[coreboot] Patch set updated for coreboot: 23c0bdd make early serial console support more generic

David Hendricks (dhendrix@chromium.org) gerrit at coreboot.org
Wed Jan 2 23:15:15 CET 2013


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

-gerrit

commit 23c0bdd5bc9118401f510b2bee8fa38b6e4b6a46
Author: David Hendricks <dhendrix at chromium.org>
Date:   Mon Dec 31 17:28:43 2012 -0800

    make early serial console support more generic
    
    This patch makes pre-RAM serial init more generic, particularly for
    platforms which do not necessarily need cache-as-RAM in order to use
    the serial console and do not have a standard 8250 serial port.
    
    This adds a Kconfig variable to set romstage-* for very early serial
    console init. The current method assumes that cache-as-RAM should
    enable this, so to maintain compatibility selecting CACHE_AS_RAM will
    also select EARLY_SERIAL_CONSOLE.
    
    Change-Id: I089e7af633c227baf3c06c685f005e9d0e4b38ce
    Signed-off-by: David Hendricks <dhendrix at chromium.org>
---
 src/console/Kconfig      | 7 +++++++
 src/console/Makefile.inc | 2 +-
 src/console/console.c    | 4 +++-
 src/cpu/Kconfig          | 1 +
 src/include/uart.h       | 4 ----
 5 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/console/Kconfig b/src/console/Kconfig
index 117fdb8..a726c1f 100644
--- a/src/console/Kconfig
+++ b/src/console/Kconfig
@@ -5,6 +5,13 @@ config SERIAL_CONSOLE
 	help
 	  Send coreboot debug output to a serial port
 
+config EARLY_SERIAL_CONSOLE
+	bool
+	select SERIAL_CONSOLE
+	default n
+	help
+	  Use serial console during early boot stages (e.g. cache-as-RAM)
+
 config CONSOLE_SERIAL8250
 	bool "Serial port console output (I/O mapped, 8250-compatible)"
 	depends on SERIAL_CONSOLE
diff --git a/src/console/Makefile.inc b/src/console/Makefile.inc
index a712486..3c4777f 100644
--- a/src/console/Makefile.inc
+++ b/src/console/Makefile.inc
@@ -10,7 +10,7 @@ smm-y += vtxprintf.c
 smm-$(CONFIG_SMM_TSEG) += die.c
 
 romstage-y += vtxprintf.c
-romstage-$(CONFIG_CACHE_AS_RAM) += console.c
+romstage-$(CONFIG_EARLY_SERIAL_CONSOLE) += console.c
 romstage-y += post.c
 romstage-y += die.c
 
diff --git a/src/console/console.c b/src/console/console.c
index d5f25a5..e92dbf6 100644
--- a/src/console/console.c
+++ b/src/console/console.c
@@ -99,13 +99,15 @@ int console_tst_byte(void)
 
 #else // __PRE_RAM__   ^^^ NOT defined   vvv defined
 
+#include <uart.h>
+
 void console_init(void)
 {
 #if CONFIG_USBDEBUG
 	enable_usbdebug(CONFIG_USBDEBUG_DEFAULT_PORT);
 	early_usbdebug_init();
 #endif
-#if CONFIG_CONSOLE_SERIAL8250
+#if CONFIG_SERIAL_CONSOLE && !CONFIG_CONSOLE_SERIAL8250MEM
 	uart_init();
 #endif
 #if CONFIG_DRIVERS_OXFORD_OXPCIE && CONFIG_CONSOLE_SERIAL8250MEM
diff --git a/src/cpu/Kconfig b/src/cpu/Kconfig
index 383ba79..ddc46cf 100644
--- a/src/cpu/Kconfig
+++ b/src/cpu/Kconfig
@@ -16,6 +16,7 @@ source src/cpu/x86/Kconfig
 
 config CACHE_AS_RAM
 	bool
+	select EARLY_SERIAL_CONSOLE
 	default !ROMCC
 
 config DCACHE_RAM_BASE
diff --git a/src/include/uart.h b/src/include/uart.h
index 931d6dc..ea371c4 100644
--- a/src/include/uart.h
+++ b/src/include/uart.h
@@ -15,10 +15,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * FIXME(dhendrix): This file contains generic prototypes for UART functions.
- * The existing headers are too specific to the 8250, so we need a better
- * abstraction for use with non-8250 UARTs.
  */
 
 #ifndef UART_H



More information about the coreboot mailing list