diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2023-03-22 23:46:34 +0100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-03-24 13:55:58 +0000 |
commit | 5630506fc9810735a1ffca7e7b1cd533c5d689d5 (patch) | |
tree | 91ec0bac55f92f64356448eaf111e84ebe5f79fc /src/soc/amd/common/block/include | |
parent | 0b192d3238728bb71192bc518982ea2e02cc1e2c (diff) |
soc/amd: pass pstate_msr union to get_pstate_core_[freq,power]
Since we already have and use the pstate_msr union in get_pstate_info,
also pass it directly to the get_pstate_core_freq and
get_pstate_core_power function calls avoids having to sort-of convert
the msr_t type parameter in the implementations of those two functions.
In amdblocks/cpu.h a forward declaration of the pstate_msr union is used
since soc/msr.h doesn't exist in the two pre-Zen SoCs that also include
amdblocks/cpu.h.
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I112030a15211587ccdc949807d1a1d552fe662b4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73926
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/amd/common/block/include')
-rw-r--r-- | src/soc/amd/common/block/include/amdblocks/cpu.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/soc/amd/common/block/include/amdblocks/cpu.h b/src/soc/amd/common/block/include/amdblocks/cpu.h index 76d0326725..3501b22104 100644 --- a/src/soc/amd/common/block/include/amdblocks/cpu.h +++ b/src/soc/amd/common/block/include/amdblocks/cpu.h @@ -4,7 +4,6 @@ #define AMD_BLOCK_CPU_H #include <acpi/acpi.h> -#include <cpu/x86/msr.h> #include <types.h> #define MAX_CSTATE_COUNT 8 @@ -15,8 +14,10 @@ unsigned int get_threads_per_core(void); void set_cstate_io_addr(void); void write_resume_eip(void); -uint32_t get_pstate_core_freq(msr_t pstate_def); -uint32_t get_pstate_core_power(msr_t pstate_def); +union pstate_msr; /* proper definition is in soc/msr.h */ + +uint32_t get_pstate_core_freq(union pstate_msr pstate_reg); +uint32_t get_pstate_core_power(union pstate_msr pstate_reg); const acpi_cstate_t *get_cstate_config_data(size_t *size); #endif /* AMD_BLOCK_CPU_H */ |