Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35640 )
Change subject: libpayload: Add fmap_cache to sysinfo_t ......................................................................
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 --- M payloads/libpayload/include/coreboot_tables.h M payloads/libpayload/include/sysinfo.h M payloads/libpayload/libc/coreboot.c 3 files changed, 13 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/35640/1
diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h index bf2cf02..c24d6ac 100644 --- a/payloads/libpayload/include/coreboot_tables.h +++ b/payloads/libpayload/include/coreboot_tables.h @@ -78,6 +78,7 @@ CB_TAG_VBOOT_WORKBUF = 0x0034, CB_TAG_MMC_INFO = 0x0035, CB_TAG_TCPA_LOG = 0x0036, + CB_TAG_FMAP = 0x0037, CB_TAG_CMOS_OPTION_TABLE = 0x00c8, CB_TAG_OPTION = 0x00c9, CB_TAG_OPTION_ENUM = 0x00ca, diff --git a/payloads/libpayload/include/sysinfo.h b/payloads/libpayload/include/sysinfo.h index 50f0e39..c05be7c 100644 --- a/payloads/libpayload/include/sysinfo.h +++ b/payloads/libpayload/include/sysinfo.h @@ -128,6 +128,9 @@ uint32_t mtc_size; void *chromeos_vpd; int mmc_early_wake_status; + + /* Pointer to FMAP cache in CBMEM */ + void *fmap_cache; };
extern struct sysinfo_t lib_sysinfo; diff --git a/payloads/libpayload/libc/coreboot.c b/payloads/libpayload/libc/coreboot.c index 03778b6..e14b144 100644 --- a/payloads/libpayload/libc/coreboot.c +++ b/payloads/libpayload/libc/coreboot.c @@ -239,6 +239,12 @@ 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 @@ 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;
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35640 )
Change subject: libpayload: Add fmap_cache to sysinfo_t ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35640/1/payloads/libpayload/libc/co... File payloads/libpayload/libc/coreboot.c:
https://review.coreboot.org/c/coreboot/+/35640/1/payloads/libpayload/libc/co... PS1, Line 244: struct cb_cbmem_tab *const cbmem = (struct cb_cbmem_tab *)ptr; : info->fmap_cache = phys_to_virt(cbmem->cbmem_tab); This pattern is getting repeated in multiple places. I should add a helper function for it as a follow up.
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35640 )
Change subject: libpayload: Add fmap_cache to sysinfo_t ......................................................................
Patch Set 1: Code-Review+2
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35640 )
Change subject: libpayload: Add fmap_cache to sysinfo_t ......................................................................
Patch Set 1: Code-Review+2
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35640 )
Change subject: libpayload: Add fmap_cache to sysinfo_t ......................................................................
Patch Set 1: Code-Review+1
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35640 )
Change subject: libpayload: Add fmap_cache to sysinfo_t ......................................................................
Patch Set 1: Code-Review+2
Shelley Chen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35640 )
Change subject: libpayload: Add fmap_cache to sysinfo_t ......................................................................
Patch Set 3: Code-Review+2
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35640 )
Change subject: libpayload: Add fmap_cache to sysinfo_t ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35640/1/payloads/libpayload/libc/co... File payloads/libpayload/libc/coreboot.c:
https://review.coreboot.org/c/coreboot/+/35640/1/payloads/libpayload/libc/co... PS1, Line 244: struct cb_cbmem_tab *const cbmem = (struct cb_cbmem_tab *)ptr; : info->fmap_cache = phys_to_virt(cbmem->cbmem_tab);
This pattern is getting repeated in multiple places. […]
Ack
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/35640 )
Change subject: libpayload: Add fmap_cache to sysinfo_t ......................................................................
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 --- M payloads/libpayload/include/coreboot_tables.h M payloads/libpayload/include/sysinfo.h M payloads/libpayload/libc/coreboot.c 3 files changed, 13 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Paul Menzel: Looks good to me, but someone else must approve Aaron Durbin: Looks good to me, approved Patrick Rudolph: Looks good to me, approved Arthur Heymans: Looks good to me, approved Shelley Chen: Looks good to me, approved
diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h index bf2cf02..c24d6ac 100644 --- a/payloads/libpayload/include/coreboot_tables.h +++ b/payloads/libpayload/include/coreboot_tables.h @@ -78,6 +78,7 @@ CB_TAG_VBOOT_WORKBUF = 0x0034, CB_TAG_MMC_INFO = 0x0035, CB_TAG_TCPA_LOG = 0x0036, + CB_TAG_FMAP = 0x0037, CB_TAG_CMOS_OPTION_TABLE = 0x00c8, CB_TAG_OPTION = 0x00c9, CB_TAG_OPTION_ENUM = 0x00ca, diff --git a/payloads/libpayload/include/sysinfo.h b/payloads/libpayload/include/sysinfo.h index 50f0e39..c05be7c 100644 --- a/payloads/libpayload/include/sysinfo.h +++ b/payloads/libpayload/include/sysinfo.h @@ -128,6 +128,9 @@ uint32_t mtc_size; void *chromeos_vpd; int mmc_early_wake_status; + + /* Pointer to FMAP cache in CBMEM */ + void *fmap_cache; };
extern struct sysinfo_t lib_sysinfo; diff --git a/payloads/libpayload/libc/coreboot.c b/payloads/libpayload/libc/coreboot.c index 03778b6..e14b144 100644 --- a/payloads/libpayload/libc/coreboot.c +++ b/payloads/libpayload/libc/coreboot.c @@ -239,6 +239,12 @@ 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 @@ 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;
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35640 )
Change subject: libpayload: Add fmap_cache to sysinfo_t ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35640/1/payloads/libpayload/libc/co... File payloads/libpayload/libc/coreboot.c:
https://review.coreboot.org/c/coreboot/+/35640/1/payloads/libpayload/libc/co... PS1, Line 244: struct cb_cbmem_tab *const cbmem = (struct cb_cbmem_tab *)ptr; : info->fmap_cache = phys_to_virt(cbmem->cbmem_tab);
Ack
See CB:35756