x86: coreboot: add SMBIOS cbmem entry parsing
[oweals/u-boot.git] / arch / x86 / cpu / coreboot / tables.c
index 0f04c4f8e91c7094e9954dde81eeaa32cd005d78..a5d31d1deab2d5b6dd27584e5ffe1d6ce9981b87 100644 (file)
@@ -69,6 +69,17 @@ static void cb_parse_vbnv(unsigned char *ptr, struct sysinfo_t *info)
        info->vbnv_size = vbnv->vbnv_size;
 }
 
+static void cb_parse_cbmem_entry(unsigned char *ptr, struct sysinfo_t *info)
+{
+       struct cb_cbmem_entry *entry = (struct cb_cbmem_entry *)ptr;
+
+       if (entry->id != CBMEM_ID_SMBIOS)
+               return;
+
+       info->smbios_start = entry->address;
+       info->smbios_size = entry->entry_size;
+}
+
 static void cb_parse_gpios(unsigned char *ptr, struct sysinfo_t *info)
 {
        int i;
@@ -206,6 +217,9 @@ static int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
                case CB_TAG_VBNV:
                        cb_parse_vbnv(ptr, info);
                        break;
+               case CB_TAG_CBMEM_ENTRY:
+                       cb_parse_cbmem_entry(ptr, info);
+                       break;
                default:
                        cb_parse_unhandled(rec->tag, ptr);
                        break;