summaryrefslogtreecommitdiff
path: root/src/soc/intel/xeon_sp
diff options
context:
space:
mode:
authorNaresh Solanki <Naresh.Solanki@9elements.com>2022-12-05 11:42:10 +0100
committerFelix Held <felix-coreboot@felixheld.de>2023-03-23 21:21:09 +0000
commit08135332ddf5ad60d922f3bc6742e719d3ceebdd (patch)
treee143117c95a3e2c99cfeae82a4babc75176af1ac /src/soc/intel/xeon_sp
parent518bba8409b704864b28d58baebcd4899650a3d3 (diff)
soc/intel/xeon_sp: Report platform cpu info
Add platform cpu info for known microcode, print cpuid & processor branding string. This will print as in the following example: CPU: Intel(R) Xeon(R) Platinum 8468H CPU: ID 806f6, Sapphire Rapids E3, ucode: 2b000130 CPU: AES supported, TXT supported, VT supported Change-Id: I9c08fb924aad81608f554523432ab6a549b1b75f Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/73391 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/soc/intel/xeon_sp')
-rw-r--r--src/soc/intel/xeon_sp/Makefile.inc2
-rw-r--r--src/soc/intel/xeon_sp/bootblock.c2
-rw-r--r--src/soc/intel/xeon_sp/include/soc/bootblock.h2
-rw-r--r--src/soc/intel/xeon_sp/report_platform.c67
4 files changed, 71 insertions, 2 deletions
diff --git a/src/soc/intel/xeon_sp/Makefile.inc b/src/soc/intel/xeon_sp/Makefile.inc
index 69792c486c..a46b93e71a 100644
--- a/src/soc/intel/xeon_sp/Makefile.inc
+++ b/src/soc/intel/xeon_sp/Makefile.inc
@@ -6,7 +6,7 @@ subdirs-$(CONFIG_SOC_INTEL_SKYLAKE_SP) += skx lbg
subdirs-$(CONFIG_SOC_INTEL_COOPERLAKE_SP) += cpx lbg
subdirs-$(CONFIG_SOC_INTEL_SAPPHIRERAPIDS_SP) += spr ebg
-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 ba215d8f84..cc839efc57 100644
--- a/src/soc/intel/xeon_sp/bootblock.c
+++ b/src/soc/intel/xeon_sp/bootblock.c
@@ -77,4 +77,6 @@ void bootblock_soc_init(void)
/* 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 6be4370454..0fdb6057dc 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 0000000000..874ff45d81
--- /dev/null
+++ b/src/soc/intel/xeon_sp/report_platform.c
@@ -0,0 +1,67 @@
+/* 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/msr.h>
+#include <cpu/x86/name.h>
+#include <soc/bootblock.h>
+
+static struct {
+ u32 cpuid;
+ const char *name;
+} cpu_table[] = {
+ { CPUID_COOPERLAKE_SP_A0, "Cooper Lake A0" },
+ { CPUID_COOPERLAKE_SP_A1, "Cooper Lake A1" },
+ { CPUID_SKYLAKE_SP_A0_A1, "SkyLake-SP A0/A1" },
+ { CPUID_SKYLAKE_SP_B0, "SkyLake-SP B0" },
+ { CPUID_SKYLAKE_SP_4, "SkyLake-SP 4" },
+ { CPUID_SAPPHIRERAPIDS_SP_A, "Sapphire Rapids A" },
+ { CPUID_SAPPHIRERAPIDS_SP_B, "Sapphire Rapids B" },
+ { CPUID_SAPPHIRERAPIDS_SP_C, "Sapphire Rapids C" },
+ { CPUID_SAPPHIRERAPIDS_SP_D, "Sapphire Rapids D" },
+ { CPUID_SAPPHIRERAPIDS_SP_E0, "Sapphire Rapids E0" },
+ { CPUID_SAPPHIRERAPIDS_SP_E2, "Sapphire Rapids E2" },
+ { CPUID_SAPPHIRERAPIDS_SP_E3, "Sapphire Rapids E3" },
+ { CPUID_SAPPHIRERAPIDS_SP_E4, "Sapphire Rapids E4" },
+ { CPUID_SAPPHIRERAPIDS_SP_Ex, "Sapphire Rapids Ex" },
+};
+
+static void report_cpu_info(void)
+{
+ u32 cpu_id, cpu_feature_flag;
+ char cpu_name[49];
+ int vt, txt, aes;
+ static const char *const mode[] = {"NOT ", ""};
+ const char *cpu_type = "Unknown";
+ size_t i;
+
+ 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();
+}