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 | |
Shuo Liu | a0aff6e | 2024-04-26 17:35:05 +0800 | [diff] [blame] | 6 | enum xeonsp_cxl_mode get_cxl_mode(void) |
| 7 | { |
| 8 | int ocp_cxl_mode = get_cxl_mode_from_vpd(); |
| 9 | switch (ocp_cxl_mode) { |
| 10 | case CXL_SYSTEM_MEMORY: |
| 11 | return XEONSP_CXL_SYS_MEM; |
| 12 | case CXL_SPM: |
| 13 | return XEONSP_CXL_SP_MEM; |
| 14 | default: |
| 15 | return XEONSP_CXL_DISABLED; |
| 16 | } |
| 17 | } |