summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/drivers/vpd/Makefile.mk2
-rw-r--r--src/drivers/vpd/vpd.h5
-rw-r--r--src/drivers/vpd/vpd_device_feature.c15
3 files changed, 21 insertions, 1 deletions
diff --git a/src/drivers/vpd/Makefile.mk b/src/drivers/vpd/Makefile.mk
index 615e48a18e..74c0ab50cb 100644
--- a/src/drivers/vpd/Makefile.mk
+++ b/src/drivers/vpd/Makefile.mk
@@ -4,5 +4,5 @@ bootblock-$(CONFIG_VPD) += vpd_decode.c vpd.c
verstage-$(CONFIG_VPD) += vpd_decode.c vpd.c
romstage-$(CONFIG_VPD) += vpd_decode.c vpd.c
postcar-$(CONFIG_VPD) += vpd_decode.c vpd.c
-ramstage-$(CONFIG_VPD) += vpd_decode.c vpd.c
+ramstage-$(CONFIG_VPD) += vpd_decode.c vpd.c vpd_device_feature.c
ramstage-$(CONFIG_SMBIOS_SERIAL_FROM_VPD) += vpd_serial.c
diff --git a/src/drivers/vpd/vpd.h b/src/drivers/vpd/vpd.h
index 817867aba4..a23005fca1 100644
--- a/src/drivers/vpd/vpd.h
+++ b/src/drivers/vpd/vpd.h
@@ -59,4 +59,9 @@ bool vpd_get_bool(const char *key, enum vpd_region region,
*/
bool vpd_get_int(const char *key, enum vpd_region region, int *val);
+/*
+ * Return the value after reading the VPD key named "feature_device_info".
+ */
+const char *vpd_get_feature_device_info(void);
+
#endif /* __VPD_H__ */
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 "";
+}