diff options
author | Subrata Banik <subratabanik@google.com> | 2024-02-26 11:48:03 +0530 |
---|---|---|
committer | Subrata Banik <subratabanik@google.com> | 2024-02-28 11:05:42 +0000 |
commit | f45fcd1cf3ff801816ea5462a0f0f3208a585c3a (patch) | |
tree | 27c7e659a500fd93aef5350a0b557df1c1929e28 /src/drivers/vpd/vpd_device_feature.c | |
parent | be426e0722be270916cadd2098b2224a6fa5ec00 (diff) |
drivers/vpd: Add API to read "feature_device_info" VPD
This patch introduces an API for reading "feature_device_info" VPD
data. This information is essential for correctly differentiating
ChromeOS product segments (e.g., Chromebook-Plus vs. standard
Chromebook models).
BUG=b:324107408
TEST=Build and boot successful on google/yahiko with this change.
Change-Id: I8d49e2dc49cd2935a9d8023c989869eb9558039d
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80741
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Diffstat (limited to 'src/drivers/vpd/vpd_device_feature.c')
-rw-r--r-- | src/drivers/vpd/vpd_device_feature.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/drivers/vpd/vpd_device_feature.c b/src/drivers/vpd/vpd_device_feature.c new file mode 100644 index 0000000000..1c8682ab7e --- /dev/null +++ b/src/drivers/vpd/vpd_device_feature.c @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <drivers/vpd/vpd.h> + +#define VPD_KEY_FEATURE_DEVICE_INFO "feature_device_info" +#define VPD_FEATURE_DEVICE_INFO_LEN 64 + +const char *vpd_get_feature_device_info(void) +{ + static char device_info[VPD_FEATURE_DEVICE_INFO_LEN]; + if (vpd_gets(VPD_KEY_FEATURE_DEVICE_INFO, device_info, VPD_FEATURE_DEVICE_INFO_LEN, + VPD_RW)) + return device_info; + return ""; +} |