soc/intel/cannonlake: Clean up report_cpu_info() function

This patch makes below clean-up for report_cpu_info() function.
1. Remove unused variables.
3. Reuse fill_processor_name.

TEST = Successfully able to boot hatch and verify the
cpu_name "CPU: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz"

Change-Id: I41c76eb93f0c5229c4a49ab041339b6ad51ad24a
Signed-off-by: Usha P <usha.p@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37309
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subrata.banik@intel.com>
This commit is contained in:
Usha P 2019-11-28 10:21:02 +05:30 committed by Patrick Georgi
parent 33ff4cc137
commit e150876910
1 changed files with 4 additions and 24 deletions

View File

@ -18,6 +18,7 @@
#include <device/pci_ops.h> #include <device/pci_ops.h>
#include <console/console.h> #include <console/console.h>
#include <cpu/x86/msr.h> #include <cpu/x86/msr.h>
#include <cpu/x86/name.h>
#include <device/pci.h> #include <device/pci.h>
#include <device/pci_ids.h> #include <device/pci_ids.h>
#include <intelblocks/mp_init.h> #include <intelblocks/mp_init.h>
@ -178,35 +179,14 @@ static uint16_t get_dev_id(pci_devfn_t dev)
static void report_cpu_info(void) static void report_cpu_info(void)
{ {
struct cpuid_result cpuidr; u32 i, cpu_id, cpu_feature_flag;
u32 i, index, cpu_id, cpu_feature_flag; char cpu_name[49];
char cpu_string[50], *cpu_name = cpu_string; /* 48 bytes are reported */
int vt, txt, aes; int vt, txt, aes;
msr_t microcode_ver; msr_t microcode_ver;
static const char *const mode[] = {"NOT ", ""}; static const char *const mode[] = {"NOT ", ""};
const char *cpu_type = "Unknown"; const char *cpu_type = "Unknown";
u32 p[13];
index = 0x80000000; fill_processor_name(cpu_name);
cpuidr = cpuid(index);
if (cpuidr.eax < 0x80000004) {
strcpy(cpu_string, "Platform info not available");
} else {
int j=0;
for (i = 2; i <= 4; i++) {
cpuidr = cpuid(index + i);
p[j++] = cpuidr.eax;
p[j++] = cpuidr.ebx;
p[j++] = cpuidr.ecx;
p[j++] = cpuidr.edx;
}
p[12]=0;
cpu_name = (char *)p;
}
/* Skip leading spaces in CPU name string */
while (cpu_name[0] == ' ')
cpu_name++;
microcode_ver.lo = 0; microcode_ver.lo = 0;
microcode_ver.hi = 0; microcode_ver.hi = 0;