summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/drivers/ocp/include/vpd.h1
-rw-r--r--src/drivers/ocp/vpd/vpd_util.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/src/drivers/ocp/include/vpd.h b/src/drivers/ocp/include/vpd.h
index f4517c4660..d58f79120f 100644
--- a/src/drivers/ocp/include/vpd.h
+++ b/src/drivers/ocp/include/vpd.h
@@ -81,4 +81,5 @@ enum cxl_memory_mode {
int get_int_from_vpd_range(const char *const key, const int fallback, const int min,
const int max);
bool get_bool_from_vpd(const char *const key, const bool fallback);
+int get_cxl_mode_from_vpd(void);
#endif
diff --git a/src/drivers/ocp/vpd/vpd_util.c b/src/drivers/ocp/vpd/vpd_util.c
index 3a66b884f2..27d7bccb5c 100644
--- a/src/drivers/ocp/vpd/vpd_util.c
+++ b/src/drivers/ocp/vpd/vpd_util.c
@@ -38,3 +38,8 @@ bool get_bool_from_vpd(const char *const key, const bool fallback)
return (bool)val;
}
+
+int get_cxl_mode_from_vpd(void)
+{
+ return get_int_from_vpd_range(CXL_MODE, CXL_MODE_DEFAULT, 0, CXL_MODE_MAX-1);
+}