[coreboot] [PATCH][cbv2]Add serial port information to lbtable
Patrick Georgi
patrick at georgi-clan.de
Wed Jan 16 12:34:14 CET 2008
Hi,
the attached patch makes cbv2 add information about the serial port to
lbtable. For this, a new record type is created. Payloads can then parse
lbtable to figure out where to find the serial port (which is usually
used by lb as console already).
A patch for grub2 exists, too, and I'll implement a compatible change
for cbv3 once the record format (and overall design etc) is stable.
Regards,
Patrick Georgi
-------------- next part --------------
Signed-off-by: Patrick Georgi <patrick at georgi-clan.de>
Index: src/include/boot/linuxbios_tables.h
===================================================================
--- src/include/boot/linuxbios_tables.h (Revision 3049)
+++ src/include/boot/linuxbios_tables.h (Arbeitskopie)
@@ -138,6 +138,13 @@
uint8_t string[0];
};
+#define LB_TAG_SERIAL 0x000e
+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/linuxbios_table.c
===================================================================
--- src/arch/i386/boot/linuxbios_table.c (Revision 3049)
+++ src/arch/i386/boot/linuxbios_table.c (Arbeitskopie)
@@ -74,6 +74,18 @@
return mem;
}
+struct lb_serial *lb_serial(struct lb_header *header)
+{
+ 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;
+}
+
struct lb_mainboard *lb_mainboard(struct lb_header *header)
{
struct lb_record *rec;
@@ -406,8 +418,10 @@
* size of the linuxbios table.
*/
- /* Record our motheboard */
+ /* Record our motherboard */
lb_mainboard(head);
+ /* Record our console */
+ lb_serial(head);
/* Record our various random string information */
lb_strings(head);
More information about the coreboot
mailing list