Hello Andrey Petrov, Patrick Rudolph, Łukasz Siudut, Paul Menzel, Hung-Te Lin, build bot (Jenkins), Patrick Georgi, Huang Jin, David Hendricks, Philipp Deppenwiese, Nico Huber, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34634
to look at the new patch set (#19).
Change subject: drivers/vpd: add framework to search VPD in romstage ......................................................................
drivers/vpd: add framework to search VPD in romstage
Summary: Added a framework to search VPD in romstage before memory is avilable. vpd_cbmem.c and vpd_premem.c are added for code specific for premem environment and for environment that cbmem can be used.
Since global variable is forbidden in romstage. A CAR_GLOBAL variable is defined in vpd.c. This variable holds VPD binary blobs' base address and size from memory mapped flash.
The overall flow is: * The CAR variable g_vpd_blob is initialized if it was not, either at romstage (before FSP-M execution in case of FSP UPD customization), or at ramstage. * At ramstage, during CBMEM_INIT, the VPD binary blob contents are copied into CBMEM. * At vpd_find() which may be called at romstage or at ramstage, it sets storage for a local struct vpd_blob variable. * The variable gets contents duplicated from g_vpd_blob, if vpd_find() is called at romstage. * The variable gets contents obtained from CBMEM, if vpd_find() is called at ramstage.
Added a call vpd_get_bool(). Given a key/value pair in VPD binary blob, and name of a bool type variable, set the variable value if there is a match. Several checks are in place: * The key/value length needs to be correct. * The key name needs to match. * THe value is either '1' or '0'.
Test Plan: * Build an OCP MonoLake coreboot image, flash and run.
Tags: Signed-off-by: Jonathan Zhang jonzhang@fb.com Change-Id: Iebdba59419a555147fc40391cf17cc6879d9e1b2 --- M src/drivers/vpd/Makefile.inc M src/drivers/vpd/vpd.c M src/drivers/vpd/vpd.h A src/drivers/vpd/vpd_cbmem.c A src/drivers/vpd/vpd_premem.c 5 files changed, 243 insertions(+), 93 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/34634/19