soc/intel/alderlake: Add TDP to give correct VR configuration

The VR configuration should be based on the different Soc SKU type. And
we also have different SKU in the same SA PCI ID.

Therefore, add TDP to recognize the correct SKU and give the correct
power setting.

BUG=b:202486131
TEST=Build and check fsp log to confirm the settings are set properly.

Signed-off-by: Curtis Chen <curtis.chen@intel.com>
Change-Id: I4d31e7afc76d9a8c772781671f92ec08f9d8713f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59644
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
diff --git a/src/soc/intel/alderlake/fsp_params.c b/src/soc/intel/alderlake/fsp_params.c
index ed89d97..251b252 100644
--- a/src/soc/intel/alderlake/fsp_params.c
+++ b/src/soc/intel/alderlake/fsp_params.c
@@ -38,12 +38,10 @@
 #define DEF_DITOVAL	625
 
 /* VccIn Aux Imon IccMax values in mA */
-#define MILLIAMPS_TO_AMPS         1000
-#define ICC_MAX_ID_ADL_P_3_MA     34250
-#define ICC_MAX_ID_ADL_P_5_MA     32000
-#define ICC_MAX_ID_ADL_P_6_MA     32000
-#define ICC_MAX_ID_ADL_P_7_MA     32000
-#define ICC_MAX_ID_ADL_M_MA       12000
+#define MILLIAMPS_TO_AMPS	1000
+#define ICC_MAX_TDP_45W		34250
+#define ICC_MAX_TDP_15W_28W	32000
+#define ICC_MAX_ID_ADL_M_MA	12000
 
 /*
  * ME End of Post configuration
@@ -296,6 +294,7 @@
 static uint16_t get_vccin_aux_imon_iccmax(void)
 {
 	uint16_t mch_id = 0;
+	uint8_t tdp;
 
 	if (!mch_id) {
 		struct device *dev = pcidev_path_on_root(SA_DEVFN_ROOT);
@@ -305,13 +304,13 @@
 	switch (mch_id) {
 	case PCI_DEVICE_ID_INTEL_ADL_P_ID_1:
 	case PCI_DEVICE_ID_INTEL_ADL_P_ID_3:
-		return ICC_MAX_ID_ADL_P_3_MA;
 	case PCI_DEVICE_ID_INTEL_ADL_P_ID_5:
-		return ICC_MAX_ID_ADL_P_5_MA;
 	case PCI_DEVICE_ID_INTEL_ADL_P_ID_6:
-		return ICC_MAX_ID_ADL_P_6_MA;
 	case PCI_DEVICE_ID_INTEL_ADL_P_ID_7:
-		return ICC_MAX_ID_ADL_P_7_MA;
+		tdp = get_cpu_tdp();
+		if (tdp == TDP_45W)
+			return ICC_MAX_TDP_45W;
+		return ICC_MAX_TDP_15W_28W;
 	case PCI_DEVICE_ID_INTEL_ADL_M_ID_1:
 	case PCI_DEVICE_ID_INTEL_ADL_M_ID_2:
 		return ICC_MAX_ID_ADL_M_MA;