summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
authorTim Van Patten <timvp@google.com>2023-03-31 17:16:50 -0600
committerFelix Held <felix-coreboot@felixheld.de>2023-04-06 18:00:32 +0000
commitb9caac74a320a58ff0a60b33ec541f667082fd27 (patch)
tree6f63c0ad87faae30d45ce631cad2c02bfa2db5e3 /src/soc
parent177e13513644b4d3de2529468e827ebfcadbda02 (diff)
soc/amd/mendocino: Reinterpret smu_power_and_thm_limit
The FSP will return the TDP in the format 0xX0000, where 'X' is the value we're interested in. For example: 0xF0000 (15W), 0x60000 (6W). Re-interpret the value so the caller just sees the TDP directly, without needing to re-interpret things themselves. BUG=b:253301653 TEST=Manually verify value is correct Change-Id: I632e702d986a4ac85605040e09c1afab2bbdc59d Signed-off-by: Tim Van Patten <timvp@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/74126 Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/amd/mendocino/fsp_misc_data_hob.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/soc/amd/mendocino/fsp_misc_data_hob.c b/src/soc/amd/mendocino/fsp_misc_data_hob.c
index 103f821355..3b51fd84c1 100644
--- a/src/soc/amd/mendocino/fsp_misc_data_hob.c
+++ b/src/soc/amd/mendocino/fsp_misc_data_hob.c
@@ -43,7 +43,14 @@ enum cb_err get_amd_smu_reported_tdp(uint32_t *tdp)
if (get_amd_misc_data_hob(&fsp_misc_data, AMD_MISC_DATA_VERSION) != CB_SUCCESS)
return CB_ERR;
- *tdp = fsp_misc_data->smu_power_and_thm_limit;
+ /*
+ * The FSP will return the TDP in the format 0xX0000, where 'X' is the value
+ * we're interested in. For example: 0xF0000 (15W), 0x60000 (6W). Re-interpret
+ * the value so the caller just sees the TDP.
+ */
+ printk(BIOS_INFO, "fsp_misc_data->smu_power_and_thm_limit = 0x%08X\n",
+ fsp_misc_data->smu_power_and_thm_limit);
+ *tdp = fsp_misc_data->smu_power_and_thm_limit >> 16;
return CB_SUCCESS;
}