Use coreboot smbios table if found.
[seabios.git] / src / coreboot.c
index 6e22919658db967190febcd549ed9dc62b3370ac..ee9dd8b4b4d91171440f949673e062574c2f504f 100644 (file)
@@ -117,6 +117,7 @@ find_cb_subtable(struct cb_header *cbh, u32 tag)
 }
 
 static struct cb_memory *CBMemTable;
+const char *CBvendor, *CBpart;
 
 // Populate max ram and e820 map info by scanning for a coreboot table.
 static void
@@ -168,11 +169,9 @@ coreboot_fill_map(void)
 
     struct cb_mainboard *cbmb = find_cb_subtable(cbh, CB_TAG_MAINBOARD);
     if (cbmb) {
-        const char *vendor = &cbmb->strings[cbmb->vendor_idx];
-        const char *part = &cbmb->strings[cbmb->part_idx];
-        dprintf(1, "Found mainboard %s %s\n", vendor, part);
-
-        vgahook_setup(vendor, part);
+        CBvendor = &cbmb->strings[cbmb->vendor_idx];
+        CBpart = &cbmb->strings[cbmb->part_idx];
+        dprintf(1, "Found mainboard %s %s\n", CBvendor, CBpart);
     }
 
     return;
@@ -202,6 +201,7 @@ scan_tables(u32 start, u32 size)
         copy_pir(p);
         copy_mptable(p);
         copy_acpi_rsdp(p);
+        copy_smbios(p);
     }
 }
 
@@ -222,9 +222,9 @@ coreboot_copy_biostable(void)
             scan_tables(m->start, m->size);
     }
 
-    // XXX - just create dummy smbios table for now - should detect if
-    // smbios/dmi table is found from coreboot and use that instead.
-    smbios_init();
+    // XXX - create a dummy smbios table for now.
+    if (!SMBiosAddr)
+        smbios_init();
 }