diff --git a/src/soc/intel/alderlake/Kconfig b/src/soc/intel/alderlake/Kconfig index 132e812dfa..a5332b06c6 100644 --- a/src/soc/intel/alderlake/Kconfig +++ b/src/soc/intel/alderlake/Kconfig @@ -291,6 +291,14 @@ config CPU_BCLK_MHZ int default 100 +config SOC_INTEL_PERFORMANCE_CORE_SCALE_FACTOR + int + default 127 + +config SOC_INTEL_EFFICIENT_CORE_SCALE_FACTOR + int + default 100 + config SOC_INTEL_COMMON_BLOCK_GSPI_CLOCK_MHZ int default 120 diff --git a/src/soc/intel/alderlake/cpu.c b/src/soc/intel/alderlake/cpu.c index 768f2d533d..27c6a9330d 100644 --- a/src/soc/intel/alderlake/cpu.c +++ b/src/soc/intel/alderlake/cpu.c @@ -99,12 +99,6 @@ enum core_type get_soc_cpu_type(void) return CPUID_CORE_TYPE_INTEL_CORE; } -void soc_get_scaling_factor(u16 *perf_core_scal_factor, u16 *eff_core_scal_factor) -{ - *perf_core_scal_factor = 127; - *eff_core_scal_factor = 100; -} - bool soc_is_nominal_freq_supported(void) { return true; diff --git a/src/soc/intel/common/block/acpi/cpu_hybrid.c b/src/soc/intel/common/block/acpi/cpu_hybrid.c index 8f0da02624..eb852de50d 100644 --- a/src/soc/intel/common/block/acpi/cpu_hybrid.c +++ b/src/soc/intel/common/block/acpi/cpu_hybrid.c @@ -72,14 +72,19 @@ static void run_set_cpu_type(void *unused) static void acpi_get_cpu_nomi_perf(u16 *eff_core_nom_perf, u16 *perf_core_nom_perf) { - u16 perf_core_scal_factor, eff_core_scal_factor; u8 max_non_turbo_ratio = cpu_get_max_non_turbo_ratio(); - soc_get_scaling_factor(&perf_core_scal_factor, &eff_core_scal_factor); + _Static_assert(CONFIG_SOC_INTEL_PERFORMANCE_CORE_SCALE_FACTOR != 0, + "CONFIG_SOC_INTEL_PERFORMANCE_CORE_SCALE_FACTOR must not be zero"); - *perf_core_nom_perf = (u16)((max_non_turbo_ratio * perf_core_scal_factor) / 100); + _Static_assert(CONFIG_SOC_INTEL_EFFICIENT_CORE_SCALE_FACTOR != 0, + "CONFIG_SOC_INTEL_EFFICIENT_CORE_SCALE_FACTOR must not be zero"); - *eff_core_nom_perf = (u16)((max_non_turbo_ratio * eff_core_scal_factor) / 100); + *perf_core_nom_perf = (u16)((max_non_turbo_ratio * + CONFIG_SOC_INTEL_PERFORMANCE_CORE_SCALE_FACTOR) / 100); + + *eff_core_nom_perf = (u16)((max_non_turbo_ratio * + CONFIG_SOC_INTEL_EFFICIENT_CORE_SCALE_FACTOR) / 100); } static u16 acpi_get_cpu_nominal_freq(void) diff --git a/src/soc/intel/common/block/include/intelblocks/acpi.h b/src/soc/intel/common/block/include/intelblocks/acpi.h index 63f38bf308..be7d0dfa2d 100644 --- a/src/soc/intel/common/block/include/intelblocks/acpi.h +++ b/src/soc/intel/common/block/include/intelblocks/acpi.h @@ -18,9 +18,6 @@ enum core_type { CPUID_UNKNOWN = 0xff, }; -/* Gets the scaling factor for Efficient and Performance core */ -void soc_get_scaling_factor(u16 *perf_core_scal_factor, u16 *eff_core_scal_factor); - /* Generates ACPI code to define _CPC control method */ void acpigen_write_CPPC_hybrid_method(int core_id); diff --git a/src/soc/intel/meteorlake/Kconfig b/src/soc/intel/meteorlake/Kconfig index 7f9b9419a9..ce56e6b8d0 100644 --- a/src/soc/intel/meteorlake/Kconfig +++ b/src/soc/intel/meteorlake/Kconfig @@ -211,6 +211,14 @@ config PCR_BASE_ADDRESS config ECAM_MMCONF_BASE_ADDRESS default 0xc0000000 +config SOC_INTEL_PERFORMANCE_CORE_SCALE_FACTOR + int + default 125 + +config SOC_INTEL_EFFICIENT_CORE_SCALE_FACTOR + int + default 100 + config CPU_BCLK_MHZ int default 100 diff --git a/src/soc/intel/meteorlake/cpu.c b/src/soc/intel/meteorlake/cpu.c index b299cc89cf..c6d22eef9f 100644 --- a/src/soc/intel/meteorlake/cpu.c +++ b/src/soc/intel/meteorlake/cpu.c @@ -87,12 +87,6 @@ enum core_type get_soc_cpu_type(void) return CPUID_CORE_TYPE_INTEL_CORE; } -void soc_get_scaling_factor(u16 *perf_core_scal_factor, u16 *eff_core_scal_factor) -{ - *perf_core_scal_factor = 125; - *eff_core_scal_factor = 100; -} - bool soc_is_nominal_freq_supported(void) { return true;