Attention is currently required from: Jonathan Zhang, Johnny Lin, Christian Walter, Arthur Heymans, Tim Chu.
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/73391 )
Change subject: soc/intel/xeon_sp: Report platform cpu info ......................................................................
soc/intel/xeon_sp: Report platform cpu info
Add platform cpu info for know microcode, print cpuid & processor branding string.
Change-Id: I9c08fb924aad81608f554523432ab6a549b1b75f Signed-off-by: Naresh Solanki Naresh.Solanki@9elements.com --- M src/include/cpu/intel/cpu_ids.h M src/soc/intel/xeon_sp/Makefile.inc M src/soc/intel/xeon_sp/bootblock.c M src/soc/intel/xeon_sp/include/soc/bootblock.h A src/soc/intel/xeon_sp/report_platform.c 5 files changed, 78 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/91/73391/1
diff --git a/src/include/cpu/intel/cpu_ids.h b/src/include/cpu/intel/cpu_ids.h index 4e23c5b..3439104 100644 --- a/src/include/cpu/intel/cpu_ids.h +++ b/src/include/cpu/intel/cpu_ids.h @@ -47,6 +47,11 @@ #define CPUID_TIGERLAKE_A0 0x806c0 #define CPUID_TIGERLAKE_B0 0x806c1 #define CPUID_TIGERLAKE_R0 0x806d1 +#define CPUID_SPR_S1 0x806F1 +#define CPUID_SPR_S2 0x806F2 +#define CPUID_SPR_S3 0x806F3 +#define CPUID_SPR_S4 0x806F4 +#define CPUID_SPR_S6 0x806F6 #define CPUID_ELKHARTLAKE_A0 0x90660 #define CPUID_ELKHARTLAKE_B0 0x90661 #define CPUID_ALDERLAKE_S_A0 0x90670 diff --git a/src/soc/intel/xeon_sp/Makefile.inc b/src/soc/intel/xeon_sp/Makefile.inc index 4124f42..f0af668 100644 --- a/src/soc/intel/xeon_sp/Makefile.inc +++ b/src/soc/intel/xeon_sp/Makefile.inc @@ -5,7 +5,7 @@ subdirs-$(CONFIG_SOC_INTEL_SKYLAKE_SP) += skx lbg subdirs-$(CONFIG_SOC_INTEL_COOPERLAKE_SP) += cpx lbg
-bootblock-y += bootblock.c spi.c lpc.c pch.c +bootblock-y += bootblock.c spi.c lpc.c pch.c report_platform.c romstage-y += romstage.c reset.c util.c spi.c pmutil.c memmap.c romstage-y += ../../../cpu/intel/car/romstage.c ramstage-y += uncore.c reset.c util.c lpc.c spi.c ramstage.c chip_common.c diff --git a/src/soc/intel/xeon_sp/bootblock.c b/src/soc/intel/xeon_sp/bootblock.c index ba215d8..cc839ef 100644 --- a/src/soc/intel/xeon_sp/bootblock.c +++ b/src/soc/intel/xeon_sp/bootblock.c @@ -77,4 +77,6 @@
/* Programming TCO_BASE_ADDRESS and TCO Timer Halt */ tco_configure(); + + report_platform_info(); } diff --git a/src/soc/intel/xeon_sp/include/soc/bootblock.h b/src/soc/intel/xeon_sp/include/soc/bootblock.h index 6be4370..0fdb605 100644 --- a/src/soc/intel/xeon_sp/include/soc/bootblock.h +++ b/src/soc/intel/xeon_sp/include/soc/bootblock.h @@ -7,5 +7,5 @@
/* Bootblock post console init programming */ void bootblock_pch_init(void); - +void report_platform_info(void); #endif diff --git a/src/soc/intel/xeon_sp/report_platform.c b/src/soc/intel/xeon_sp/report_platform.c new file mode 100644 index 0000000..df51810 --- /dev/null +++ b/src/soc/intel/xeon_sp/report_platform.c @@ -0,0 +1,56 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <arch/cpu.h> +#include <console/console.h> +#include <cpu/intel/cpu_ids.h> +#include <cpu/intel/microcode.h> +#include <cpu/x86/name.h> +#include <soc/bootblock.h> + +static struct { + u32 cpuid; + const char *name; +} cpu_table[] = { + { CPUID_SPR_S1, "Sapphire Rapids Step1" }, + { CPUID_SPR_S2, "Sapphire Rapids Step2" }, + { CPUID_SPR_S3, "Sapphire Rapids Step3" }, + { CPUID_SPR_S4, "Sapphire Rapids Step4" }, + { CPUID_SPR_S6, "Sapphire Rapids Step6" }, +}; + +static void report_cpu_info(void) +{ + u32 i, cpu_id, cpu_feature_flag; + char cpu_name[49]; + int vt, txt, aes; + static const char *const mode[] = {"NOT ", ""}; + const char *cpu_type = "Unknown"; + + fill_processor_name(cpu_name); + cpu_id = cpu_get_cpuid(); + + /* Look for string to match the name */ + for (i = 0; i < ARRAY_SIZE(cpu_table); i++) { + if (cpu_table[i].cpuid == cpu_id) { + cpu_type = cpu_table[i].name; + break; + } + } + + printk(BIOS_DEBUG, "CPU: %s\n", cpu_name); + printk(BIOS_DEBUG, "CPU: ID %x, %s, ucode: %08x\n", + cpu_id, cpu_type, get_current_microcode_rev()); + + cpu_feature_flag = cpu_get_feature_flags_ecx(); + aes = (cpu_feature_flag & CPUID_AES) ? 1 : 0; + txt = (cpu_feature_flag & CPUID_SMX) ? 1 : 0; + vt = (cpu_feature_flag & CPUID_VMX) ? 1 : 0; + printk(BIOS_DEBUG, + "CPU: AES %ssupported, TXT %ssupported, VT %ssupported\n", + mode[aes], mode[txt], mode[vt]); +} + +void report_platform_info(void) +{ + report_cpu_info(); +}