Shuo Liu | a0aff6e | 2024-04-26 17:35:05 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <drivers/ocp/include/vpd.h> |
Shuo Liu | c2ed5ea | 2024-05-11 03:23:23 +0800 | [diff] [blame] | 4 | #include <soc/config.h> |
Shuo Liu | a0aff6e | 2024-04-26 17:35:05 +0800 | [diff] [blame] | 5 | |
Patrick Rudolph | f2ac23f | 2024-04-19 09:05:04 +0200 | [diff] [blame] | 6 | #if CONFIG(SOC_INTEL_HAS_CXL) && CONFIG(OCP_VPD) |
Shuo Liu | a0aff6e | 2024-04-26 17:35:05 +0800 | [diff] [blame] | 7 | enum xeonsp_cxl_mode get_cxl_mode(void) |
| 8 | { |
| 9 | int ocp_cxl_mode = get_cxl_mode_from_vpd(); |
| 10 | switch (ocp_cxl_mode) { |
| 11 | case CXL_SYSTEM_MEMORY: |
| 12 | return XEONSP_CXL_SYS_MEM; |
| 13 | case CXL_SPM: |
| 14 | return XEONSP_CXL_SP_MEM; |
| 15 | default: |
| 16 | return XEONSP_CXL_DISABLED; |
| 17 | } |
| 18 | } |
| 19 | #endif |