Tim Van Patten has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/74127 )
Change subject: amd/mendocino/root_complex: Restrict DPTC to 15W boards ......................................................................
amd/mendocino/root_complex: Restrict DPTC to 15W boards
Restrict DPTC to 15W boards, since we only have 15W values defined in the devicetree. This will revert the 6W boards back to their default values, rather than (incorrectly) configuring them with 15W values.
BUG=b:253301653 TEST=Verify DPTC values are set for 15W boards TEST=Verify DPTC values are set not set for 6W boards
Change-Id: I94f3974fce6358e3cbb0c30c1af33eb7ecb29ad7 Signed-off-by: Tim Van Patten timvp@google.com --- M src/soc/amd/mendocino/fsp_misc_data_hob.c M src/soc/amd/mendocino/root_complex.c 2 files changed, 32 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/27/74127/1
diff --git a/src/soc/amd/mendocino/fsp_misc_data_hob.c b/src/soc/amd/mendocino/fsp_misc_data_hob.c index 0b0d9c5..e48d33c 100644 --- a/src/soc/amd/mendocino/fsp_misc_data_hob.c +++ b/src/soc/amd/mendocino/fsp_misc_data_hob.c @@ -46,7 +46,7 @@ // 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 = %u\n", + 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;
diff --git a/src/soc/amd/mendocino/root_complex.c b/src/soc/amd/mendocino/root_complex.c index 6217246..a0718f9 100644 --- a/src/soc/amd/mendocino/root_complex.c +++ b/src/soc/amd/mendocino/root_complex.c @@ -12,11 +12,13 @@ #include <console/console.h> #include <device/device.h> #include <device/pci.h> +#include <fsp/amd_misc_data.h> #include <fsp/util.h> #include <soc/iomap.h> #include <stdint.h> #include "chip.h"
+#define TDP_15W 15 #define DPTC_TOTAL_UPDATE_PARAMS 13
struct dptc_input { @@ -367,7 +369,18 @@
static void root_complex_fill_ssdt(const struct device *device) { + uint32_t tdp = 0; + acpi_fill_root_complex_tom(device); + + if(get_amd_smu_reported_tdp(&tdp) != CB_SUCCESS) { + // Unknown TDP, so return rather than setting invalid values. + return; + } + // TODO(b/249359574): Add support for 6W DPTC values. + if (tdp != TDP_15W) + return; + if (CONFIG(SOC_AMD_COMMON_BLOCK_ACPI_DPTC)) acipgen_dptci(); }