Hi,
two patches this time, one for cbv2, one for cbv3:
patch-20080628-1-baud-in-serial-cbv2 adds an entry to the serial port descriptor about the configured line speed. this is compatible, as the field size is stored with the entry, and data was only appended. so well-behaving clients that skip based on entry size (and not based on their own local idea of how large entries are) automatically do the right thing.
patch-20080628-2-consoles-in-cbv3-lbtable implements the console and serial lbtable entries compatible to cbv2+above patch for cbv3
Signed-off-bys are at the header of each patch.
Regards, Patrick Georgi
Signed-Off-By: Patrick Georgi patrick@georgi-clan.de
Index: src/include/boot/coreboot_tables.h =================================================================== --- src/include/boot/coreboot_tables.h (revision 3393) +++ src/include/boot/coreboot_tables.h (working copy) @@ -145,6 +145,7 @@ uint32_t tag; uint32_t size; uint16_t ioport; + uint32_t baud; };
#define LB_TAG_CONSOLE 0x0010 Index: src/arch/i386/boot/coreboot_table.c =================================================================== --- src/arch/i386/boot/coreboot_table.c (revision 3393) +++ src/arch/i386/boot/coreboot_table.c (working copy) @@ -84,6 +84,7 @@ serial->tag = LB_TAG_SERIAL; serial->size = sizeof(*serial); serial->ioport = TTYS0_BASE; + serial->baud = TTYS0_BAUD; return serial; #else return header;
Signed-Off-By: Patrick Georgi patrick@georgi-clan.de
Index: include/tables.h =================================================================== --- include/tables.h (revision 690) +++ include/tables.h (working copy) @@ -175,6 +175,28 @@ u32 dev_root_ptr; /* Pointer to the root device */ };
+#define LB_TAG_SERIAL 0x000f +struct lb_serial { + u32 tag; + u32 size; + u16 ioport; + u32 baud; +}; + +#define LB_TAG_CONSOLE 0x0010 +struct lb_console { + u32 tag; + u32 size; + u16 type; +}; + +#define LB_TAG_CONSOLE_SERIAL8250 0 +#define LB_TAG_CONSOLE_VGA 1 +#define LB_TAG_CONSOLE_BTEXT 2 +#define LB_TAG_CONSOLE_LOGBUF 3 +#define LB_TAG_CONSOLE_SROM 4 +#define LB_TAG_CONSOLE_EHCI 5 + /* The following structures are for the cmos definitions table */ #define LB_TAG_CMOS_OPTION_TABLE 200 /* cmos header record */ Index: arch/x86/coreboot_table.c =================================================================== --- arch/x86/coreboot_table.c (revision 690) +++ arch/x86/coreboot_table.c (working copy) @@ -25,6 +25,7 @@ #include <device/device.h> #include <tables.h> #include <mc146818rtc.h> +#include <uart8250.h> #include <lib.h> //#include <cpu/cpu.h> //#include <pirq_routing.h> @@ -98,6 +99,45 @@ return mem; }
+struct lb_serial *lb_serial(struct lb_header *header) +{ +#if defined(TTYSx_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 = TTYSx_BASE; + serial->baud = TTYSx_BAUD; + return serial; +#else + return header; +#endif +} + +void add_console(struct lb_header *header, u16 consoletype) +{ + struct lb_record *rec; + struct lb_console *console; + rec = lb_new_record(header); + console = (struct lb_console *)lb_new_record(header); + console->tag = LB_TAG_CONSOLE; + console->size = sizeof(*console); + console->type = consoletype; +} + +void lb_console(struct lb_header *header) +{ +#ifdef CONFIG_CONSOLE_SERIAL + add_console(header, LB_TAG_CONSOLE_SERIAL8250); +#endif +/* FIXME when we have a proper vga console ourself */ +#ifdef CONFIG_PCI_OPTION_ROM_RUN + add_console(header, LB_TAG_CONSOLE_VGA); +#endif +} + struct lb_mainboard *lb_mainboard(struct lb_header *header) { struct lb_record *rec; @@ -454,6 +494,12 @@ /* Record our motherboard */ lb_mainboard(head);
+ /* Record the serial port, if present */ + lb_serial(head); + + /* Record our console setup */ + lb_console(head); + /* Record our various random string information */ lb_strings(head);
Patrick Georgi wrote:
Hi,
two patches this time, one for cbv2, one for cbv3:
patch-20080628-1-baud-in-serial-cbv2 adds an entry to the serial port descriptor about the configured line speed. this is compatible, as the field size is stored with the entry, and data was only appended. so well-behaving clients that skip based on entry size (and not based on their own local idea of how large entries are) automatically do the right thing.
patch-20080628-2-consoles-in-cbv3-lbtable implements the console and serial lbtable entries compatible to cbv2+above patch for cbv3
Signed-off-bys are at the header of each patch.
Regards, Patrick Georgi Signed-Off-By: Patrick Georgi patrick@georgi-clan.de
Acked-by: Stefan Reinauer stepan@coresystems.de
Stefan Reinauer schrieb:
Patrick Georgi wrote:
Hi,
two patches this time, one for cbv2, one for cbv3:
patch-20080628-1-baud-in-serial-cbv2 adds an entry to the serial port descriptor about the configured line speed. this is compatible, as the field size is stored with the entry, and data was only appended. so well-behaving clients that skip based on entry size (and not based on their own local idea of how large entries are) automatically do the right thing.
patch-20080628-2-consoles-in-cbv3-lbtable implements the console and serial lbtable entries compatible to cbv2+above patch for cbv3
Signed-off-bys are at the header of each patch.
Regards, Patrick Georgi Signed-Off-By: Patrick Georgi patrick@georgi-clan.de
Acked-by: Stefan Reinauer stepan@coresystems.de
Thanks, r3396 (cbv2) and r691 (cbv3)