mb/{intel,google}/{icelake_rvp,dragonegg}: make use of cpu_get_cpuid() helper function

This patch replaces cpuid(1) references from icelake mainboard
with x86 cpu common code library functions cpu_get_cpuid().

- cpu_get_cpuid() -> to get processor id (from cpuid.eax)

Change-Id: Ia12d95d911dd6ee60a3a35937264fef668ad9e35
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/c/30124
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aamir Bohra <aamir.bohra@intel.com>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
This commit is contained in:
Subrata Banik 2018-12-10 14:19:35 +05:30
parent 5d7f5bc973
commit 78c919bdc8
2 changed files with 2 additions and 28 deletions

View File

@ -36,19 +36,6 @@ static const u8 dqs_map[][8] = {
/* Rcomp resistor */ /* Rcomp resistor */
static const u16 rcomp_resistor[] = { 100, 100, 100 }; static const u16 rcomp_resistor[] = { 100, 100, 100 };
/*
* get processor id using cpuid eax=1
* return value will be in EAX register
*/
static uint32_t get_cpuid(void)
{
struct cpuid_result cpuidr;
cpuidr = cpuid(1);
return cpuidr.eax;
}
void __weak variant_memory_params(struct lpddr4_config *mem_config) void __weak variant_memory_params(struct lpddr4_config *mem_config)
{ {
/* Rcomp target */ /* Rcomp target */
@ -61,7 +48,7 @@ void __weak variant_memory_params(struct lpddr4_config *mem_config)
mem_config->dqs_map_size = sizeof(dqs_map); mem_config->dqs_map_size = sizeof(dqs_map);
mem_config->rcomp_resistor = rcomp_resistor; mem_config->rcomp_resistor = rcomp_resistor;
mem_config->rcomp_resistor_size = sizeof(rcomp_resistor); mem_config->rcomp_resistor_size = sizeof(rcomp_resistor);
if (get_cpuid() == CPUID_ICELAKE_A0) { if (cpu_get_cpuid() == CPUID_ICELAKE_A0) {
mem_config->rcomp_target = rcomp_target_es0; mem_config->rcomp_target = rcomp_target_es0;
mem_config->rcomp_target_size = sizeof(rcomp_target_es0); mem_config->rcomp_target_size = sizeof(rcomp_target_es0);
} else { } else {

View File

@ -111,19 +111,6 @@ void mainboard_fill_rcomp_res_data(void *rcomp_ptr)
memcpy(rcomp_ptr, RcompResistor, sizeof(RcompResistor)); memcpy(rcomp_ptr, RcompResistor, sizeof(RcompResistor));
} }
/*
* get processor id using cpuid eax=1
* return value will be in EAX register
*/
static uint32_t get_cpuid(void)
{
struct cpuid_result cpuidr;
cpuidr = cpuid(1);
return cpuidr.eax;
}
void mainboard_fill_rcomp_strength_data(void *rcomp_strength_ptr) void mainboard_fill_rcomp_strength_data(void *rcomp_strength_ptr)
{ {
/* Rcomp target */ /* Rcomp target */
@ -142,7 +129,7 @@ void mainboard_fill_rcomp_strength_data(void *rcomp_strength_ptr)
case icl_y_lpddr4: case icl_y_lpddr4:
case icl_u_lpddr4: case icl_u_lpddr4:
case icl_u_lpddr4_type_3: case icl_u_lpddr4_type_3:
if (get_cpuid() == CPUID_ICELAKE_A0) if (cpu_get_cpuid() == CPUID_ICELAKE_A0)
memcpy(rcomp_strength_ptr, RcompTarget_LPDDR4_Ax, memcpy(rcomp_strength_ptr, RcompTarget_LPDDR4_Ax,
sizeof(RcompTarget_LPDDR4_Ax)); sizeof(RcompTarget_LPDDR4_Ax));
else else