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>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74127
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/soc/amd/mendocino/root_complex.c b/src/soc/amd/mendocino/root_complex.c
index 6217246..53a245b 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();
}