aboutsummaryrefslogtreecommitdiff
path: root/src/vendorcode/google/chromeos/sar.c
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2018-03-08 15:43:12 +0100
committerPhilipp Deppenwiese <zaolin.daisuki@gmail.com>2018-09-09 17:51:37 +0000
commit28cee59ca294422056d983fc06d5d8d5800a4390 (patch)
tree2dab3f2423f474a9075dc9c9d56ad997d6c4ed77 /src/vendorcode/google/chromeos/sar.c
parentc4b0fd0a86db280ad1a8d8572218dc42fd5bb7e4 (diff)
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>
Diffstat (limited to 'src/vendorcode/google/chromeos/sar.c')
-rw-r--r--src/vendorcode/google/chromeos/sar.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vendorcode/google/chromeos/sar.c b/src/vendorcode/google/chromeos/sar.c
index fc72dc1348..6799f12a24 100644
--- a/src/vendorcode/google/chromeos/sar.c
+++ b/src/vendorcode/google/chromeos/sar.c
@@ -19,9 +19,10 @@
#include <types.h>
#include <string.h>
#include <sar.h>
-#include "cros_vpd.h"
+#include <drivers/vpd/vpd.h>
#define WIFI_SAR_CBFS_FILENAME "wifi_sar_defaults.hex"
+#define CROS_VPD_WIFI_SAR_NAME "wifi_sar"
static int load_sar_file_from_cbfs(void *buf, size_t buffer_size)
{
@@ -55,7 +56,7 @@ For [WGDS_VERSION] 0x00,
int get_wifi_sar_limits(struct wifi_sar_limits *sar_limits)
{
const char *wifi_sar_limit_key = CROS_VPD_WIFI_SAR_NAME;
- /* cros_vpd_gets() reads in one less than size characters from the VPD
+ /* vpd_gets() reads in one less than size characters from the VPD
* with a terminating null byte ('\0') stored as the last character into
* the buffer, thus the increasing by 1 for buffer_size. */
const size_t buffer_size = (sizeof(struct wifi_sar_limits) /
@@ -79,8 +80,8 @@ int get_wifi_sar_limits(struct wifi_sar_limits *sar_limits)
}
/* Try to read the SAR limit entry from VPD */
- if (!cros_vpd_gets(wifi_sar_limit_key, wifi_sar_limit_str,
- buffer_size)) {
+ if (!vpd_gets(wifi_sar_limit_key, wifi_sar_limit_str,
+ buffer_size, VPD_ANY)) {
printk(BIOS_ERR, "Error: Could not locate '%s' in VPD.\n",
wifi_sar_limit_key);