diff options
author | Subrata Banik <subrata.banik@intel.com> | 2018-12-10 14:11:35 +0530 |
---|---|---|
committer | Subrata Banik <subrata.banik@intel.com> | 2018-12-13 04:32:57 +0000 |
commit | 53b08c347f54970cf5f6ce35b8e1a1fe5f8a11f9 (patch) | |
tree | b4eed19fbf1b9f35dfbdddcc43fc84469176ec59 /src/soc/intel/quark | |
parent | e3110b862071ae0797afb0688495315a7dd47739 (diff) |
cpuid: Add helper function for cpuid(1) functions
This patch introduces 3 helper function for cpuid(1) :
1. cpu_get_cpuid() -> to get processor id (from cpuid.eax)
2. cpu_get_feature_flags_ecx -> to get processor feature flag (from cpuid.ecx)
3. cpu_get_feature_flags_edx -> to get processor feature flag (from cpuid.edx)
Above 3 helper functions are targeted to replace majority of cpuid(1)
references.
Change-Id: Ib96a7c79dadb1feff0b8d58aa408b355fbb3bc50
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/c/30123
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/soc/intel/quark')
-rw-r--r-- | src/soc/intel/quark/romstage/report_platform.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/soc/intel/quark/romstage/report_platform.c b/src/soc/intel/quark/romstage/report_platform.c index 5ed8a5f9cb..640f5b0594 100644 --- a/src/soc/intel/quark/romstage/report_platform.c +++ b/src/soc/intel/quark/romstage/report_platform.c @@ -67,14 +67,13 @@ static uint32_t fuse_port_read(uint32_t offset) static void report_cpu_info(void) { - struct cpuid_result cpuidr; const char *cpu_type = "Unknown"; u32 d_variant; u32 ecc_enabled; u32 extended_temp; u32 i; u8 revision; - u32 secure_boot; + u32 secure_boot, cpu_id; const char *stepping = "Unknown"; /* Determine if ECC is enabled */ @@ -94,9 +93,9 @@ static void report_cpu_info(void) extended_temp = 0; /* Look for string to match the CPU ID value */ - cpuidr = cpuid(1); + cpu_id = cpu_get_cpuid(); for (i = 0; i < ARRAY_SIZE(cpu_table); i++) { - if ((cpu_table[i].cpuid == cpuidr.eax) + if ((cpu_table[i].cpuid == cpu_id) && (cpu_table[i].extended_temp == extended_temp) && (cpu_table[i].ecc == ecc_enabled) && (cpu_table[i].secure_boot == secure_boot) @@ -118,7 +117,7 @@ static void report_cpu_info(void) } } - printk(BIOS_DEBUG, "CPU: ID %x:%x, %s %s Stepping\n", cpuidr.eax, + printk(BIOS_DEBUG, "CPU: ID %x:%x, %s %s Stepping\n", cpu_id, revision, cpu_type, stepping); } |