drivers/vpd: Add VPD support

VPD reference: https://chromium.googlesource.com/chromiumos/platform/vpd/+/master/README.md

Copy ChromeOS VPD driver to add support for VPD without CROMEOS.
Possible use case:
* Storing calibration data
* Storing MAC address
* Storing serial
* Storing boot options

+ Now it's possible to define the VPD space by choosing
  one of the following enums: VPD_ANY, VPD_RW, VPD_RO.
+ CHROMEOS selects now VPD as part of it.
+ VPD is implemented as driver.

Change-Id: Id9263bd39bf25d024e93daa57053fefcb1adc53a
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/25046
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Patrick Rudolph
2018-03-08 15:43:12 +01:00
committed by Philipp Deppenwiese
parent c4b0fd0a86
commit 28cee59ca2
16 changed files with 206 additions and 140 deletions

View File

@@ -16,7 +16,7 @@
#include <string.h>
#include <baseboard/variants.h>
#include <ec/google/chromeec/ec.h>
#include <vendorcode/google/chromeos/cros_vpd.h>
#include <drivers/vpd/vpd.h>
#include <soc/cpu.h>
#include <soc/intel/apollolake/chip.h>
@@ -59,7 +59,7 @@ uint8_t variant_board_sku(void)
if (!IS_ENABLED(CONFIG_CHROMEOS))
return board_sku_num;
if (!cros_vpd_gets(vpd_skuid, vpd_buffer, ARRAY_SIZE(vpd_buffer)))
if (!vpd_gets(vpd_skuid, vpd_buffer, ARRAY_SIZE(vpd_buffer), VPD_ANY))
return board_sku_num;
vpd_len = strlen(vpd_buffer);