soc/amd/mendocino: add and use missing cpu_vid_8 pstate_msr field

Mendocino uses the SVI3 standard for CPU core voltage control which uses
9 data bits instead of the 8 in the SVI2 case and also calculates the
actual voltages with a different formula. The Mendocino code uses the
correct formula since commit 8d2bfbce23 ("soc/amd/sabrina/acpi:
Correct VID decoding on Sabrina"), but the MSR definition in the PPR
hasn't been updated to show the additional bit. The definition of the
register that is mirrored by these MSRs descries this 9th CPU voltage ID
bit though. Since this bit is expected to be zero, this shouldn't cause
a change in behavior.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I05acd239300836a34e40cd3f31ea819b79766e2e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73969
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
This commit is contained in:
Felix Held 2023-03-23 19:25:20 +01:00
parent ff23f455c4
commit 6a6d524b0a
2 changed files with 3 additions and 2 deletions

View File

@ -139,7 +139,7 @@ uint32_t get_pstate_core_power(union pstate_msr pstate_reg)
uint32_t voltage_in_uvolts, core_vid, current_value_amps, current_divisor, power_in_mw;
/* Core voltage ID */
core_vid = pstate_reg.cpu_vid_0_7;
core_vid = pstate_reg.cpu_vid_0_7 | pstate_reg.cpu_vid_8 << 8;
/* Current value in amps */
current_value_amps = pstate_reg.idd_value;

View File

@ -11,7 +11,8 @@ union pstate_msr {
uint64_t cpu_vid_0_7 : 8; /* [14..21] */
uint64_t idd_value : 8; /* [22..29] */
uint64_t idd_div : 2; /* [30..31] */
uint64_t : 31; /* [32..62] */
uint64_t cpu_vid_8 : 1; /* [32..32] */
uint64_t : 30; /* [33..62] */
uint64_t pstate_en : 1; /* [63..63] */
};
uint64_t raw;