[coreboot] [cbv2]Add serial port information to lbtable

Patrick Georgi patrick at georgi-clan.de
Tue Jan 22 21:43:35 CET 2008


Am Tue, 22 Jan 2008 20:37:59 +0100 schrieb Peter Stuge:
> Some kind of recovery, management, whatever. I can't think of all uses
> either, but I certianly do not want to impose an arbitrary limit like
> "coreboot only tells you about serial ports that are the console" - I
> like the generic serial tag.

Attached patch changes the following vs. the version as of yesterday:
 - fix comment (patch adds a serial port, not a console)
 - change tag ID to 0xf (0xe is already taken in v3)

Regards,
Patrick Georgi
-------------- next part --------------
This patch adds a new record type for lbtable to provide information
about a serial port. If a port is defined in the board configuration,
add it to lbtable.

Signed-off-by: Patrick Georgi <patrick at georgi-clan.de>

Index: src/include/boot/coreboot_tables.h
===================================================================
--- src/include/boot/coreboot_tables.h	(Revision 3066)
+++ src/include/boot/coreboot_tables.h	(Arbeitskopie)
@@ -138,6 +138,13 @@
 	uint8_t  string[0];
 };
 
+#define LB_TAG_SERIAL		0x000f
+struct lb_serial {
+	uint32_t tag;
+	uint32_t size;
+	uint16_t ioport;
+};
+
 /* The following structures are for the cmos definitions table */
 #define LB_TAG_CMOS_OPTION_TABLE 200
 /* cmos header record */
Index: src/arch/i386/boot/coreboot_table.c
===================================================================
--- src/arch/i386/boot/coreboot_table.c	(Revision 3066)
+++ src/arch/i386/boot/coreboot_table.c	(Arbeitskopie)
@@ -74,6 +74,22 @@
 	return mem;
 }
 
+struct lb_serial *lb_serial(struct lb_header *header)
+{
+#if defined(TTYS0_BASE)
+	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->ioport = TTYS0_BASE;
+	return serial;
+#else
+	return header;
+#endif
+}
+
 struct lb_mainboard *lb_mainboard(struct lb_header *header)
 {
 	struct lb_record *rec;
@@ -406,8 +422,10 @@
 	 * size of the coreboot table.
 	 */
 
-	/* Record our motheboard */
+	/* Record our motherboard */
 	lb_mainboard(head);
+	/* Record the serial port, if present */
+	lb_serial(head);
 	/* Record our various random string information */
 	lb_strings(head);
 


More information about the coreboot mailing list