diff --git a/src/soc/intel/common/block/acpi/cpu_hybrid.c b/src/soc/intel/common/block/acpi/cpu_hybrid.c index 2c3b84ceee..ee4777ae69 100644 --- a/src/soc/intel/common/block/acpi/cpu_hybrid.c +++ b/src/soc/intel/common/block/acpi/cpu_hybrid.c @@ -110,22 +110,8 @@ static void acpi_get_cpu_nomi_perf(u16 *eff_core_nom_perf, u16 *perf_core_nom_pe u8 max_non_turbo_ratio = cpu_get_max_non_turbo_ratio(); static u16 performance, efficient; - _Static_assert(CONFIG(SOC_INTEL_COMMON_BLOCK_RUNTIME_CORE_SCALING_FACTORS) || - CONFIG_SOC_INTEL_PERFORMANCE_CORE_SCALE_FACTOR != 0, - "CONFIG_SOC_INTEL_PERFORMANCE_CORE_SCALE_FACTOR must not be zero"); - - _Static_assert(CONFIG(SOC_INTEL_COMMON_BLOCK_RUNTIME_CORE_SCALING_FACTORS) || - CONFIG_SOC_INTEL_EFFICIENT_CORE_SCALE_FACTOR != 0, - "CONFIG_SOC_INTEL_EFFICIENT_CORE_SCALE_FACTOR must not be zero"); - - if (!performance) { - if (CONFIG(SOC_INTEL_COMMON_BLOCK_RUNTIME_CORE_SCALING_FACTORS)) { - soc_read_core_scaling_factors(&performance, &efficient); - } else { - performance = CONFIG_SOC_INTEL_PERFORMANCE_CORE_SCALE_FACTOR; - efficient = CONFIG_SOC_INTEL_EFFICIENT_CORE_SCALE_FACTOR; - } - } + if (!performance) + soc_read_core_scaling_factors(&performance, &efficient); *perf_core_nom_perf = (u16)((max_non_turbo_ratio * performance) / 100); *eff_core_nom_perf = (u16)((max_non_turbo_ratio * efficient) / 100); diff --git a/src/soc/intel/common/block/include/intelblocks/acpi.h b/src/soc/intel/common/block/include/intelblocks/acpi.h index a3f82481c9..de81c37062 100644 --- a/src/soc/intel/common/block/include/intelblocks/acpi.h +++ b/src/soc/intel/common/block/include/intelblocks/acpi.h @@ -26,12 +26,30 @@ enum cpu_perf_eff_type { unsigned long acpi_create_madt_lapics_with_nmis_hybrid(unsigned long current); +#if CONFIG(SOC_INTEL_COMMON_BLOCK_ACPI_CPU_HYBRID) /* * Read the performance and efficient core ratios. * This is to be implemented by the SoC specific code if * SOC_INTEL_COMMON_BLOCK_RUNTIME_CORE_SCALING_FACTORS is selected. */ +#if CONFIG(SOC_INTEL_COMMON_BLOCK_RUNTIME_CORE_SCALING_FACTORS) enum cb_err soc_read_core_scaling_factors(u16 *performance, u16 *efficient); +#else +static inline enum cb_err soc_read_core_scaling_factors(u16 *performance, u16 *efficient) +{ + _Static_assert(CONFIG_SOC_INTEL_PERFORMANCE_CORE_SCALE_FACTOR != 0, + "CONFIG_SOC_INTEL_PERFORMANCE_CORE_SCALE_FACTOR must not be zero"); + + _Static_assert(CONFIG_SOC_INTEL_EFFICIENT_CORE_SCALE_FACTOR != 0, + "CONFIG_SOC_INTEL_EFFICIENT_CORE_SCALE_FACTOR must not be zero"); + + *performance = CONFIG_SOC_INTEL_PERFORMANCE_CORE_SCALE_FACTOR; + *efficient = CONFIG_SOC_INTEL_EFFICIENT_CORE_SCALE_FACTOR; + + return CB_SUCCESS; +} +#endif +#endif /* SOC_INTEL_COMMON_BLOCK_ACPI_CPU_HYBRID */ /* Generates ACPI code to define _CPC control method */ void acpigen_write_CPPC_hybrid_method(int core_id);