diff options
author | Sridhar Siricilla <sridhar.siricilla@intel.com> | 2023-01-05 17:08:17 +0530 |
---|---|---|
committer | Lean Sheng Tan <sheng.tan@9elements.com> | 2023-01-10 13:53:24 +0000 |
commit | d9c82695f50ca59ef5cdecdbefe7402ad90b3f27 (patch) | |
tree | 1a836b930566486a4cc2a72bd1bb3c176dd88439 /src/soc/intel/common/block | |
parent | 166c75c7785965e7c7013b20a420720635cee656 (diff) |
soc/intel: Add Kconfigs to define scaling factor for cores
The patch adds Kconfigs to define scaling factor for Efficient and
Performance cores instead of using hard coded values in the soc code.
Also, the patches uses the Kconfigs directly to calculate the core's
nominal performance. So, we don't need to implement soc function
soc_get_scaling_factor() to get the scaling factor data for different
core types. Hence, soc_get_scaling_factor() function is removed.
TEST=Build the code for Gimble and Rex. Also, I have verified that
build system logs error when the Kconfigs are undefined.
Signed-off-by: Sridhar Siricilla <sridhar.siricilla@intel.com>
Change-Id: I55e4d815116ef40c5f33be64ab495e942bf35ee8
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71687
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/common/block')
-rw-r--r-- | src/soc/intel/common/block/acpi/cpu_hybrid.c | 13 | ||||
-rw-r--r-- | src/soc/intel/common/block/include/intelblocks/acpi.h | 3 |
2 files changed, 9 insertions, 7 deletions
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); |