Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/74000 )
(
3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: soc/amd/common/block/cpu/svi2: drop unneeded core_vid check ......................................................................
soc/amd/common/block/cpu/svi2: drop unneeded core_vid check
A core voltage ID larger than 0xff shouldn't happen, since SVI2's core VID is only 8 bit long. In order for making it more difficult to use this function in a wrong way that results in a very wrong voltage being returned, also return 0 for those invalid core VID values.
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: I95417c45db86cd2373879cdad8a07fb9eb8dfdda Reviewed-on: https://review.coreboot.org/c/coreboot/+/74000 Reviewed-by: Fred Reitberger reitbergerfred@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/soc/amd/common/block/cpu/svi2.c 1 file changed, 20 insertions(+), 2 deletions(-)
Approvals: build bot (Jenkins): Verified Fred Reitberger: Looks good to me, approved
diff --git a/src/soc/amd/common/block/cpu/svi2.c b/src/soc/amd/common/block/cpu/svi2.c index 21d459f..2e8766c 100644 --- a/src/soc/amd/common/block/cpu/svi2.c +++ b/src/soc/amd/common/block/cpu/svi2.c @@ -10,8 +10,8 @@
uint32_t get_uvolts_from_vid(uint16_t core_vid) { - if ((core_vid >= 0xF8) && (core_vid <= 0xFF)) { - /* Voltage off for VID codes 0xF8 to 0xFF */ + if (core_vid >= 0xF8) { + /* Voltage off for VID codes >= 0xF8 */ return 0; } else { return SERIAL_VID_2_MAX_MICROVOLTS -