#define CB_TAG_FORWARD 0x11
+struct cb_cbmem_ref {
+ u32 tag;
+ u32 size;
+ u64 cbmem_addr;
+};
+
+#define CB_TAG_CBMEM_CONSOLE 0x17
+
+struct cbmem_console {
+ u32 buffer_size;
+ u32 buffer_cursor;
+ u8 buffer_body[0];
+} PACKED;
+static struct cbmem_console *cbcon = NULL;
+
static u16
ipchksum(char *buf, int count)
{
// confuses grub. So, override it.
add_e820(0, 16*1024, E820_RAM);
+ struct cb_cbmem_ref *cbref = find_cb_subtable(cbh, CB_TAG_CBMEM_CONSOLE);
+ if (cbref) {
+ cbcon = (void*)(u32)cbref->cbmem_addr;
+ dprintf(1, "----- [ seabios log starts here ] -----\n");
+ dprintf(1, "Found coreboot cbmem console @ %llx\n", cbref->cbmem_addr);
+ }
+
struct cb_mainboard *cbmb = find_cb_subtable(cbh, CB_TAG_MAINBOARD);
if (cbmb) {
CBvendor = &cbmb->strings[cbmb->vendor_idx];
return;
}
+void debug_cbmem(char c)
+{
+ if (!CONFIG_COREBOOT)
+ return;
+ if (!cbcon)
+ return;
+ if (cbcon->buffer_cursor == cbcon->buffer_size)
+ return;
+ cbcon->buffer_body[cbcon->buffer_cursor++] = c;
+}
/****************************************************************
* BIOS table copying
if (CONFIG_DEBUG_IO && runningOnQEMU())
// Send character to debug port.
outb(c, GET_GLOBAL(DebugOutputPort));
+ if (!MODESEGMENT)
+ debug_cbmem(c);
if (c == '\n')
debug_serial('\r');
debug_serial(c);
// coreboot.c
extern const char *CBvendor, *CBpart;
struct cbfs_file;
+void debug_cbmem(char c);
void cbfs_run_payload(struct cbfs_file *file);
void coreboot_platform_setup(void);
void cbfs_payload_setup(void);