[coreboot] Patch set updated for coreboot: 2fd6df0 If the memory mapped UART isn't present, leave it out of the cb tables.

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Fri Mar 9 02:22:56 CET 2012


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/729

-gerrit

commit 2fd6df0f261f0f9d587de15cb9e5861c3ff6811a
Author: Gabe Black <gabeblack at google.com>
Date:   Wed Oct 5 01:57:03 2011 -0700

    If the memory mapped UART isn't present, leave it out of the cb tables.
    
    This way u-boot won't try to use a UART that isn't plugged in.
    
    Change-Id: I9a3a0d074dd03add8afbd4dad836c4c6a05abe6f
    Signed-off-by: Gabe Black <gabeblack at google.com>
---
 src/arch/x86/boot/coreboot_table.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/src/arch/x86/boot/coreboot_table.c b/src/arch/x86/boot/coreboot_table.c
index 59cf174..a9ff6f0 100644
--- a/src/arch/x86/boot/coreboot_table.c
+++ b/src/arch/x86/boot/coreboot_table.c
@@ -118,16 +118,20 @@ static struct lb_serial *lb_serial(struct lb_header *header)
 	serial->baud = CONFIG_TTYS0_BAUD;
 	return serial;
 #elif CONFIG_CONSOLE_SERIAL8250MEM
-	struct lb_record *rec;
-	struct lb_serial *serial;
-	rec = lb_new_record(header);
-	serial = (struct lb_serial *)rec;
-	serial->tag = LB_TAG_SERIAL;
-	serial->size = sizeof(*serial);
-	serial->type = LB_SERIAL_TYPE_MEMORY_MAPPED;
-	serial->baseaddr = uartmem_getbaseaddr();
-	serial->baud = CONFIG_TTYS0_BAUD;
-	return serial;
+	if (uartmem_getbaseaddr()) {
+		struct lb_record *rec;
+		struct lb_serial *serial;
+		rec = lb_new_record(header);
+		serial = (struct lb_serial *)rec;
+		serial->tag = LB_TAG_SERIAL;
+		serial->size = sizeof(*serial);
+		serial->type = LB_SERIAL_TYPE_MEMORY_MAPPED;
+		serial->baseaddr = uartmem_getbaseaddr();
+		serial->baud = CONFIG_TTYS0_BAUD;
+		return serial;
+	} else {
+		return NULL;
+	}
 #else
 	return NULL;
 #endif




More information about the coreboot mailing list