drivers/ocp/vpd: add get_cxl_mode_from_vpd()
cxl_mode VPD variable supports 3 modes: CXL_DISABLED, CXL_SYSTEM_MEMORY and CXL_SPM. Change-Id: Ib3bf85fbe687680db3c11efa908c4fb351be9c44 Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/71100 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jonathan Zhang <jonzhang@fb.com> Reviewed-by: David Hendricks <david.hendricks@gmail.com>
This commit is contained in:
parent
da538cb38f
commit
651e3e06a5
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue