summaryrefslogtreecommitdiff
path: root/src/soc/amd
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2023-07-17 22:59:02 +0200
committerFelix Held <felix-coreboot@felixheld.de>2023-07-18 21:51:33 +0000
commitc04d3ddbaef84746e6651e7354a81b874dbd3385 (patch)
treef17936968325e6c2af6de9f9aad0cba82cbac6c4 /src/soc/amd
parent8e0bbb30b616fe65bb03186220753af76dfda7d2 (diff)
include/cpu/amd/msr: introduce and use PSTATE_MSR_COUNT
Add and use a define for the total number of P-state MSRs to avoid magic constants in the code. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I37a89faa0f216790b3404fc03edc62408684cc24 Reviewed-on: https://review.coreboot.org/c/coreboot/+/76546 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/stoneyridge/pstate_util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/soc/amd/stoneyridge/pstate_util.c b/src/soc/amd/stoneyridge/pstate_util.c
index 12bc2b5cfa..cd5878f82a 100644
--- a/src/soc/amd/stoneyridge/pstate_util.c
+++ b/src/soc/amd/stoneyridge/pstate_util.c
@@ -21,7 +21,7 @@ static bool all_pstates_have_same_frequency_id(void)
bool first = true;
uint32_t frequency_id;
- for (i = 0; i < 8; i++) {
+ for (i = 0; i < PSTATE_MSR_COUNT; i++) {
pstate_reg.raw = rdmsr(PSTATE_MSR(i)).raw;
if (!pstate_reg.pstate_en)