coreboot-kgpe-d16/src/drivers
Jonathan Zhang b5392f930d 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
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34634
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2019-09-02 06:38:29 +00:00
..
amd/agesa arch/x86: Add <arch/romstage.h> 2019-08-22 02:50:35 +00:00
ams
asmedia
aspeed drivers/aspeed/ast2050: Remove variable set but not used 2019-06-03 13:29:26 +00:00
crb drivers/crb: Add support for PTT 2019-08-06 12:08:21 +00:00
dec/21143 device/pci: Fix PCI accessor headers 2019-03-01 20:32:15 +00:00
elog drivers/elog: Fix ELOG_GSMI dependency 2019-07-13 13:18:43 +00:00
emulation/qemu drivers/emulation/qemu_debugcon: Don't use CAR_GLOBAL 2019-05-29 20:05:41 +00:00
generic src/{device,drivers}: Add missing 'include <types.h>' 2019-05-29 20:27:52 +00:00
gic device/mmio.h: Add include file for MMIO ops 2019-03-04 15:57:39 +00:00
i2c drivers/i2c/generic: Add "compatible" property to _DSD 2019-08-13 19:47:54 +00:00
intel soc/intel: Use common romstage code 2019-08-26 21:08:41 +00:00
ipmi drivers/ipmi/ipmi_kcs_ops: Advertise correct register spacing 2019-09-02 05:30:18 +00:00
lenovo mb/lenovo/t430: Fix Dual Graphics 2019-06-08 11:33:41 +00:00
maxim device/mmio.h: Add include file for MMIO ops 2019-03-04 15:57:39 +00:00
mrc_cache coreboot: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-08 08:33:24 +00:00
net src/{device,drivers}: Add missing 'include <types.h>' 2019-05-29 20:27:52 +00:00
parade
pc80 drivers/pc80: Move UDELAY_IO and UDELAY_TIMER2 2019-07-08 09:45:56 +00:00
ricoh/rce822 arch/io.h: Drop unnecessary include 2019-03-04 15:08:03 +00:00
siemens/nc_fpga src: Use include <delay.h> when appropriate 2019-04-06 16:09:12 +00:00
sil/3114 src: Use include <delay.h> when appropriate 2019-04-06 16:09:12 +00:00
smmstore drivers: Add missing #include <commonlib/helpers.h> 2019-06-22 11:40:39 +00:00
spi src: Remove variable length arrays 2019-08-20 15:27:42 +00:00
ti
tpm coreboot: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX) 2019-03-08 08:33:24 +00:00
uart arch/non-x86: Remove use of __PRE_RAM__ 2019-08-20 01:12:28 +00:00
usb device/pci_ops: Define pci_find_capability() just once 2019-07-04 09:36:19 +00:00
vpd drivers/vpd: add framework to search VPD in romstage 2019-09-02 06:38:29 +00:00
wifi drivers/wifi: Add generic WiFi driver 2019-07-13 18:25:47 +00:00
xgi src/drivers/xgi: Move coreboot related includes to xgi_coreboot.h 2019-05-29 20:14:04 +00:00