Jonathon Hall | 4dfa906 | 2023-09-27 13:04:11 -0400 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <arch/cpu.h> |
| 4 | #include <console/console.h> |
| 5 | #include <fsp/util.h> |
| 6 | |
| 7 | static bool use_fsp_v1(void) |
| 8 | { |
| 9 | /* |
| 10 | * Per the Comet Lake FSP documentation, differentiate Comet Lake v1/v2 |
| 11 | * by CPUID. CML v1 has eax 0x000A0660 or 0x000806EC, CML v2 has |
| 12 | * 0x000A0661. |
| 13 | */ |
| 14 | uint32_t cpuid = cpu_get_cpuid(); |
| 15 | switch (cpuid) { |
| 16 | case 0x000A0660: |
| 17 | case 0x000806EC: |
| 18 | printk(BIOS_INFO, "CPUID %08X is Comet Lake v1\n", cpuid); |
| 19 | return true; |
| 20 | case 0x000A0661: |
| 21 | printk(BIOS_INFO, "CPUID %08X is Comet Lake v2\n", cpuid); |
| 22 | return false; |
| 23 | default: |
| 24 | /* |
| 25 | * It's unlikely any new Comet Lake SKUs would be added |
| 26 | * at this point, but guess CML v2 rather than failing |
| 27 | * to boot entirely. |
| 28 | */ |
| 29 | printk(BIOS_ERR, "CPUID %08X is unknown, guessing Comet Lake v2\n", |
| 30 | cpuid); |
| 31 | return false; |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | const char *soc_select_fsp_m_cbfs(void) |
| 36 | { |
| 37 | return use_fsp_v1() ? CONFIG_FSP_M_CBFS : CONFIG_FSP_M_CBFS_2; |
| 38 | } |
| 39 | |
| 40 | const char *soc_select_fsp_s_cbfs(void) |
| 41 | { |
| 42 | return use_fsp_v1() ? CONFIG_FSP_S_CBFS : CONFIG_FSP_S_CBFS_2; |
| 43 | } |