From 6a18443e706cfa02f62526c0801e88c703490bb8 Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Thu, 12 Dec 2013 10:43:58 -0800 Subject: [PATCH] libpayload: Parse CBMEM ACPI GNVS pointer Pull the ACPI GNVS pointer from CBMEM and expose it in the sysinfo structure for use by payloads. BUG=chrome-os-partner:24380 BRANCH=none TEST=build and boot rambi with emmc in ACPI mode Change-Id: I47c358f33c464a4a01080268fb553705218c940c Signed-off-by: Duncan Laurie Reviewed-on: https://chromium-review.googlesource.com/179900 Reviewed-by: Aaron Durbin --- payloads/libpayload/arch/x86/coreboot.c | 9 +++++++++ payloads/libpayload/include/coreboot_tables.h | 1 + payloads/libpayload/include/sysinfo.h | 1 + 3 files changed, 11 insertions(+) diff --git a/payloads/libpayload/arch/x86/coreboot.c b/payloads/libpayload/arch/x86/coreboot.c index d513bb7844..d1946872d9 100644 --- a/payloads/libpayload/arch/x86/coreboot.c +++ b/payloads/libpayload/arch/x86/coreboot.c @@ -135,6 +135,12 @@ static void cb_parse_mrc_cache(unsigned char *ptr, struct sysinfo_t *info) info->mrc_cache = phys_to_virt(cbmem->cbmem_tab); } +static void cb_parse_acpi_gnvs(unsigned char *ptr, struct sysinfo_t *info) +{ + struct cb_cbmem_tab *const cbmem = (struct cb_cbmem_tab *)ptr; + info->acpi_gnvs = phys_to_virt(cbmem->cbmem_tab); +} + #ifdef CONFIG_LP_NVRAM static void cb_parse_optiontable(void *ptr, struct sysinfo_t *info) { @@ -288,6 +294,9 @@ static int cb_parse_header(void *addr, int len, struct sysinfo_t *info) case CB_TAG_MRC_CACHE: cb_parse_mrc_cache(ptr, info); break; + case CB_TAG_ACPI_GNVS: + cb_parse_acpi_gnvs(ptr, info); + break; case CB_TAG_X86_ROM_MTRR: cb_parse_x86_rom_var_mtrr(ptr, info); break; diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h index 2b78e5e13b..6eff8cce33 100644 --- a/payloads/libpayload/include/coreboot_tables.h +++ b/payloads/libpayload/include/coreboot_tables.h @@ -198,6 +198,7 @@ struct cb_range { #define CB_TAG_TIMESTAMPS 0x0016 #define CB_TAG_CBMEM_CONSOLE 0x0017 #define CB_TAG_MRC_CACHE 0x0018 +#define CB_TAG_ACPI_GNVS 0x0024 struct cb_cbmem_tab { uint32_t tag; uint32_t size; diff --git a/payloads/libpayload/include/sysinfo.h b/payloads/libpayload/include/sysinfo.h index ef36681a8e..92b8dcabf0 100644 --- a/payloads/libpayload/include/sysinfo.h +++ b/payloads/libpayload/include/sysinfo.h @@ -107,6 +107,7 @@ struct sysinfo_t { void *tstamp_table; void *cbmem_cons; void *mrc_cache; + void *acpi_gnvs; }; extern struct sysinfo_t lib_sysinfo;