summaryrefslogtreecommitdiff
path: root/payloads/libpayload/libc
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2019-09-27 00:02:25 -0700
committerPatrick Georgi <pgeorgi@google.com>2019-10-02 11:26:53 +0000
commit3d4923d85ab07f8ea2b30018763c6bef269e5796 (patch)
treeed919f5c64bfa6abf2059f31ea320e195d230051 /payloads/libpayload/libc
parent86cb421df68f8c22b3cc27fb9ef45a6633724bb6 (diff)
libpayload: Add fmap_cache to sysinfo_t
Now that FMAP is cached in CBMEM and its pointer is added to coreboot table for quick lookup, this change adds a new member "fmap_cache" to sysinfo_t that can be used by payloads to get to FMAP cache. BUG=b:141723751 Change-Id: If894c20c2de89a9d8564561bc7780c86f3f4135a Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/35640 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Shelley Chen <shchen@google.com> Reviewed-by: Patrick Rudolph <siro@das-labor.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'payloads/libpayload/libc')
-rw-r--r--payloads/libpayload/libc/coreboot.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/payloads/libpayload/libc/coreboot.c b/payloads/libpayload/libc/coreboot.c
index 03778b6d2a..e14b144ee4 100644
--- a/payloads/libpayload/libc/coreboot.c
+++ b/payloads/libpayload/libc/coreboot.c
@@ -239,6 +239,12 @@ static void cb_parse_vpd(void *ptr, struct sysinfo_t *info)
info->chromeos_vpd = phys_to_virt(cbmem->cbmem_tab);
}
+static void cb_parse_fmap_cache(void *ptr, struct sysinfo_t *info)
+{
+ struct cb_cbmem_tab *const cbmem = (struct cb_cbmem_tab *)ptr;
+ info->fmap_cache = phys_to_virt(cbmem->cbmem_tab);
+}
+
#if CONFIG(LP_TIMER_RDTSC)
static void cb_parse_tsc_info(void *ptr, struct sysinfo_t *info)
{
@@ -412,6 +418,9 @@ int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
case CB_TAG_VPD:
cb_parse_vpd(ptr, info);
break;
+ case CB_TAG_FMAP:
+ cb_parse_fmap_cache(ptr, info);
+ break;
default:
cb_parse_arch_specific(rec, info);
break;