Attention is currently required from: Tarun Tuli, Subrata Banik, Kapil Porwal.
Sridhar Siricilla has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/71687 )
Change subject: soc/intel: Add Kconfigs to define scaling factor for cores ......................................................................
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 patch defines core_scaling_factor structure to group performance and efficient scaling factor variables.
TEST=Build the code for Gimble and Rex.
Signed-off-by: Sridhar Siricilla sridhar.siricilla@intel.com Change-Id: I55e4d815116ef40c5f33be64ab495e942bf35ee8 --- M src/soc/intel/alderlake/Kconfig M src/soc/intel/alderlake/cpu.c M src/soc/intel/common/block/acpi/cpu_hybrid.c M src/soc/intel/common/block/include/intelblocks/acpi.h M src/soc/intel/meteorlake/Kconfig M src/soc/intel/meteorlake/cpu.c 6 files changed, 50 insertions(+), 13 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/87/71687/1
diff --git a/src/soc/intel/alderlake/Kconfig b/src/soc/intel/alderlake/Kconfig index 9d950a7..42719b7 100644 --- a/src/soc/intel/alderlake/Kconfig +++ b/src/soc/intel/alderlake/Kconfig @@ -290,6 +290,14 @@ int default 100
+config SOC_INTEL_PERF_CORE_SCAL_FACTOR + int + default 127 + +config SOC_INTEL_EFFICIENT_CORE_SCAL_FACTOR + int + default 100 + config SOC_INTEL_COMMON_BLOCK_GSPI_CLOCK_MHZ int default 120 @@ -459,6 +467,7 @@
endchoice
+ if STITCH_ME_BIN
config CSE_BPDT_VERSION diff --git a/src/soc/intel/alderlake/cpu.c b/src/soc/intel/alderlake/cpu.c index 768f2d5..0a0eb34 100644 --- a/src/soc/intel/alderlake/cpu.c +++ b/src/soc/intel/alderlake/cpu.c @@ -99,10 +99,10 @@ return CPUID_CORE_TYPE_INTEL_CORE; }
-void soc_get_scaling_factor(u16 *perf_core_scal_factor, u16 *eff_core_scal_factor) +void soc_get_scaling_factor(struct core_scaling_factor *scaling_factor) { - *perf_core_scal_factor = 127; - *eff_core_scal_factor = 100; + scaling_factor->performance_core = CONFIG_SOC_INTEL_PERF_CORE_SCAL_FACTOR; + scaling_factor->efficient_core = CONFIG_SOC_INTEL_EFFICIENT_CORE_SCAL_FACTOR; }
bool soc_is_nominal_freq_supported(void) diff --git a/src/soc/intel/common/block/acpi/cpu_hybrid.c b/src/soc/intel/common/block/acpi/cpu_hybrid.c index 8f0da02..836f808 100644 --- a/src/soc/intel/common/block/acpi/cpu_hybrid.c +++ b/src/soc/intel/common/block/acpi/cpu_hybrid.c @@ -72,14 +72,12 @@
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; + struct core_scaling_factor 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); - - *perf_core_nom_perf = (u16)((max_non_turbo_ratio * perf_core_scal_factor) / 100); - - *eff_core_nom_perf = (u16)((max_non_turbo_ratio * eff_core_scal_factor) / 100); + soc_get_scaling_factor(&scal_factor); + *perf_core_nom_perf = (u16)((max_non_turbo_ratio * scal_factor.performance_core) / 100); + *eff_core_nom_perf = (u16)((max_non_turbo_ratio * scal_factor.efficient_core) / 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 63f38bf..d6e5974 100644 --- a/src/soc/intel/common/block/include/intelblocks/acpi.h +++ b/src/soc/intel/common/block/include/intelblocks/acpi.h @@ -18,8 +18,13 @@ CPUID_UNKNOWN = 0xff, };
+struct core_scaling_factor { + uint16_t performance_core; + uint16_t efficient_core; +}; + /* Gets the scaling factor for Efficient and Performance core */ -void soc_get_scaling_factor(u16 *perf_core_scal_factor, u16 *eff_core_scal_factor); +void soc_get_scaling_factor(struct core_scaling_factor *scaling_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 4d69566..d5beb75 100644 --- a/src/soc/intel/meteorlake/Kconfig +++ b/src/soc/intel/meteorlake/Kconfig @@ -210,6 +210,14 @@ config ECAM_MMCONF_BASE_ADDRESS default 0xc0000000
+config SOC_INTEL_PERF_CORE_SCAL_FACTOR + int + default 125 + +config SOC_INTEL_EFFICIENT_CORE_SCAL_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 b299cc8..435ddb1 100644 --- a/src/soc/intel/meteorlake/cpu.c +++ b/src/soc/intel/meteorlake/cpu.c @@ -87,10 +87,10 @@ return CPUID_CORE_TYPE_INTEL_CORE; }
-void soc_get_scaling_factor(u16 *perf_core_scal_factor, u16 *eff_core_scal_factor) +void soc_get_scaling_factor(struct core_scaling_factor *scaling_factor) { - *perf_core_scal_factor = 125; - *eff_core_scal_factor = 100; + scaling_factor->performance_core = CONFIG_SOC_INTEL_PERF_CORE_SCAL_FACTOR; + scaling_factor->efficient_core = CONFIG_SOC_INTEL_EFFICIENT_CORE_SCAL_FACTOR; }
bool soc_is_nominal_freq_supported(void)