Usha P has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37309 )
Change subject: soc/intel/cannonlake: Clean up report_cpu_info() function ......................................................................
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=Succesfully 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 --- M src/soc/intel/cannonlake/bootblock/report_platform.c 1 file changed, 4 insertions(+), 24 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/37309/1
diff --git a/src/soc/intel/cannonlake/bootblock/report_platform.c b/src/soc/intel/cannonlake/bootblock/report_platform.c index 3d46916..eddcbd8 100644 --- a/src/soc/intel/cannonlake/bootblock/report_platform.c +++ b/src/soc/intel/cannonlake/bootblock/report_platform.c @@ -18,6 +18,7 @@ #include <device/pci_ops.h> #include <console/console.h> #include <cpu/x86/msr.h> +#include <cpu/x86/name.h> #include <device/pci.h> #include <device/pci_ids.h> #include <intelblocks/mp_init.h> @@ -161,35 +162,14 @@
static void report_cpu_info(void) { - struct cpuid_result cpuidr; - u32 i, index, cpu_id, cpu_feature_flag; - char cpu_string[50], *cpu_name = cpu_string; /* 48 bytes are reported */ + u32 i, cpu_id, cpu_feature_flag; + char cpu_name[49]; int vt, txt, aes; msr_t microcode_ver; static const char *const mode[] = {"NOT ", ""}; const char *cpu_type = "Unknown"; - u32 p[13];
- index = 0x80000000; - 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++; + fill_processor_name(cpu_name);
microcode_ver.lo = 0; microcode_ver.hi = 0;
Hello Patrick Rudolph, Subrata Banik, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/37309
to look at the new patch set (#2).
Change subject: soc/intel/cannonlake: Clean up report_cpu_info() function ......................................................................
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 = Succesfully 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 --- M src/soc/intel/cannonlake/bootblock/report_platform.c 1 file changed, 4 insertions(+), 24 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/37309/2
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37309 )
Change subject: soc/intel/cannonlake: Clean up report_cpu_info() function ......................................................................
Patch Set 2: Code-Review+2
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37309 )
Change subject: soc/intel/cannonlake: Clean up report_cpu_info() function ......................................................................
Patch Set 2:
(3 comments)
Could have been two commits.
https://review.coreboot.org/c/coreboot/+/37309/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/37309/2//COMMIT_MSG@10 PS2, Line 10: function. Fits on the line above.
https://review.coreboot.org/c/coreboot/+/37309/2//COMMIT_MSG@14 PS2, Line 14: Succesfully Successfully
https://review.coreboot.org/c/coreboot/+/37309/2/src/soc/intel/cannonlake/bo... File src/soc/intel/cannonlake/bootblock/report_platform.c:
https://review.coreboot.org/c/coreboot/+/37309/2/src/soc/intel/cannonlake/bo... PS2, Line 166: char cpu_name[49]; Why was it 50 before?
Hello Patrick Rudolph, Subrata Banik, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/37309
to look at the new patch set (#3).
Change subject: soc/intel/cannonlake: Clean up report_cpu_info() function ......................................................................
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 --- M src/soc/intel/cannonlake/bootblock/report_platform.c 1 file changed, 4 insertions(+), 24 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/37309/3
Usha P has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37309 )
Change subject: soc/intel/cannonlake: Clean up report_cpu_info() function ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/37309/2/src/soc/intel/cannonlake/bo... File src/soc/intel/cannonlake/bootblock/report_platform.c:
https://review.coreboot.org/c/coreboot/+/37309/2/src/soc/intel/cannonlake/bo... PS2, Line 166: char cpu_name[49];
Why was it 50 before?
Realized CPUID must be issued with each parameter in sequence to get the entire 48-byte null-terminated ASCII processor brand string. Hence this is made 49(3 * 12 + 4 + 1) char array size now.
Usha P has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37309 )
Change subject: soc/intel/cannonlake: Clean up report_cpu_info() function ......................................................................
Patch Set 3:
(2 comments)
https://review.coreboot.org/c/coreboot/+/37309/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/37309/2//COMMIT_MSG@10 PS2, Line 10: function.
Fits on the line above.
Done
https://review.coreboot.org/c/coreboot/+/37309/2//COMMIT_MSG@14 PS2, Line 14: Succesfully
Successfully
Done
Usha P has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37309 )
Change subject: soc/intel/cannonlake: Clean up report_cpu_info() function ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/37309/2/src/soc/intel/cannonlake/bo... File src/soc/intel/cannonlake/bootblock/report_platform.c:
https://review.coreboot.org/c/coreboot/+/37309/2/src/soc/intel/cannonlake/bo... PS2, Line 166: char cpu_name[49];
Realized CPUID must be issued with each parameter in sequence to get the entire 48-byte null-termina […]
Done
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/37309 )
Change subject: soc/intel/cannonlake: Clean up report_cpu_info() function ......................................................................
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 --- M src/soc/intel/cannonlake/bootblock/report_platform.c 1 file changed, 4 insertions(+), 24 deletions(-)
Approvals: build bot (Jenkins): Verified Subrata Banik: Looks good to me, approved
diff --git a/src/soc/intel/cannonlake/bootblock/report_platform.c b/src/soc/intel/cannonlake/bootblock/report_platform.c index 8cdf38e..523c1a8 100644 --- a/src/soc/intel/cannonlake/bootblock/report_platform.c +++ b/src/soc/intel/cannonlake/bootblock/report_platform.c @@ -18,6 +18,7 @@ #include <device/pci_ops.h> #include <console/console.h> #include <cpu/x86/msr.h> +#include <cpu/x86/name.h> #include <device/pci.h> #include <device/pci_ids.h> #include <intelblocks/mp_init.h> @@ -178,35 +179,14 @@
static void report_cpu_info(void) { - struct cpuid_result cpuidr; - u32 i, index, cpu_id, cpu_feature_flag; - char cpu_string[50], *cpu_name = cpu_string; /* 48 bytes are reported */ + u32 i, cpu_id, cpu_feature_flag; + char cpu_name[49]; int vt, txt, aes; msr_t microcode_ver; static const char *const mode[] = {"NOT ", ""}; const char *cpu_type = "Unknown"; - u32 p[13];
- index = 0x80000000; - 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++; + fill_processor_name(cpu_name);
microcode_ver.lo = 0; microcode_ver.hi = 0;