summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--payloads/libpayload/include/coreboot_tables.h1
-rw-r--r--payloads/libpayload/include/sysinfo.h1
-rw-r--r--payloads/libpayload/libc/coreboot.c9
3 files changed, 11 insertions, 0 deletions
diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h
index d77242a3a8..9e00c0ec47 100644
--- a/payloads/libpayload/include/coreboot_tables.h
+++ b/payloads/libpayload/include/coreboot_tables.h
@@ -206,6 +206,7 @@ struct cb_gpios {
#define CB_TAG_DMA 0x0022
#define CB_TAG_RAM_OOPS 0x0023
#define CB_TAG_MTC 0x002b
+#define CB_TAG_VPD 0x002c
struct lb_range {
uint32_t tag;
uint32_t size;
diff --git a/payloads/libpayload/include/sysinfo.h b/payloads/libpayload/include/sysinfo.h
index 2110d8803f..2e5a837b70 100644
--- a/payloads/libpayload/include/sysinfo.h
+++ b/payloads/libpayload/include/sysinfo.h
@@ -124,6 +124,7 @@ struct sysinfo_t {
uint64_t boot_media_size;
uint64_t mtc_start;
uint32_t mtc_size;
+ void *chromeos_vpd;
};
extern struct sysinfo_t lib_sysinfo;
diff --git a/payloads/libpayload/libc/coreboot.c b/payloads/libpayload/libc/coreboot.c
index 9fc6a692bd..10b801c5ed 100644
--- a/payloads/libpayload/libc/coreboot.c
+++ b/payloads/libpayload/libc/coreboot.c
@@ -228,6 +228,12 @@ static void cb_parse_boot_media_params(unsigned char *ptr,
info->boot_media_size = bmp->boot_media_size;
}
+static void cb_parse_vpd(void *ptr, struct sysinfo_t *info)
+{
+ struct cb_cbmem_tab *const cbmem = (struct cb_cbmem_tab *)ptr;
+ info->chromeos_vpd = phys_to_virt(cbmem->cbmem_tab);
+}
+
#if IS_ENABLED(CONFIG_LP_TIMER_RDTSC)
static void cb_parse_tsc_info(void *ptr, struct sysinfo_t *info)
{
@@ -398,6 +404,9 @@ int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
cb_parse_tsc_info(ptr, info);
break;
#endif
+ case CB_TAG_VPD:
+ cb_parse_vpd(ptr, info);
+ break;
default:
cb_parse_arch_specific(rec, info);
break;