summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2022-08-08 22:57:31 +0200
committerFelix Held <felix-coreboot@felixheld.de>2022-08-17 16:24:16 +0000
commitd5ab24cd48006022ca60fe35f0f0366f3edce748 (patch)
tree914c025a4c2ae34645a07033f5403089e213d9eb
parent75547dbc53cde54dc83e26ef22828ce7cf9e2ba2 (diff)
soc/amd/common/acpi/cppc: add nominal and minimum frequencies
Now that we have functionality to get the minimal and nominal frequencies, the corresponding fields in the CPPC config can now be populated. If the HOB isn't present and/or the frequency values could not be obtained, CPPC_UNSUPPORTED is still used; otherwise the HOB-provided frequency in MHz is used for those two fields. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Signed-off-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com> Change-Id: Id3257690a3388d44ceceb7ac4f1db3d49e195caa Reviewed-on: https://review.coreboot.org/c/coreboot/+/66551 Reviewed-by: Raul Rangel <rrangel@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/soc/amd/cezanne/Kconfig1
-rw-r--r--src/soc/amd/common/block/acpi/cppc.c12
2 files changed, 11 insertions, 2 deletions
diff --git a/src/soc/amd/cezanne/Kconfig b/src/soc/amd/cezanne/Kconfig
index d40c37c757..ce1688941a 100644
--- a/src/soc/amd/cezanne/Kconfig
+++ b/src/soc/amd/cezanne/Kconfig
@@ -68,6 +68,7 @@ config SOC_SPECIFIC_OPTIONS
select SOC_AMD_COMMON_BLOCK_TSC_FAM17H_19H
select SOC_AMD_COMMON_BLOCK_UART
select SOC_AMD_COMMON_BLOCK_UCODE
+ select SOC_AMD_COMMON_FSP_CCX_CPPC_HOB
select SOC_AMD_COMMON_FSP_DMI_TABLES
select SOC_AMD_COMMON_FSP_PCI
select SSE2
diff --git a/src/soc/amd/common/block/acpi/cppc.c b/src/soc/amd/common/block/acpi/cppc.c
index 224034d159..f1167e8d27 100644
--- a/src/soc/amd/common/block/acpi/cppc.c
+++ b/src/soc/amd/common/block/acpi/cppc.c
@@ -5,6 +5,7 @@
#include <amdblocks/cppc.h>
#include <arch/cpu.h>
#include <soc/msr.h>
+#include <types.h>
/*
* version 2 is expected to be the typical use case.
@@ -13,6 +14,9 @@
*/
static void cpu_init_cppc_config(struct cppc_config *config, u32 version)
{
+ uint32_t lowest_freq_mhz;
+ uint32_t nominal_freq_mhz;
+
config->version = version;
config->entries[CPPC_HIGHEST_PERF] = CPPC_REG_MSR(MSR_CPPC_CAPABILITY_1, SHIFT_CPPC_CAPABILITY_1_HIGHEST_PERF, 8);
@@ -42,8 +46,12 @@ static void cpu_init_cppc_config(struct cppc_config *config, u32 version)
if (version < 3)
return;
- config->entries[CPPC_LOWEST_FREQ] = CPPC_UNSUPPORTED;
- config->entries[CPPC_NOMINAL_FREQ] = CPPC_UNSUPPORTED;
+ config->entries[CPPC_LOWEST_FREQ] =
+ get_ccx_cppc_min_frequency(&lowest_freq_mhz) == CB_SUCCESS ?
+ CPPC_DWORD(lowest_freq_mhz) : CPPC_UNSUPPORTED;
+ config->entries[CPPC_NOMINAL_FREQ] =
+ get_ccx_cppc_nom_frequency(&nominal_freq_mhz) == CB_SUCCESS ?
+ CPPC_DWORD(nominal_freq_mhz) : CPPC_UNSUPPORTED;
}
void generate_cppc_entries(unsigned int core_id)