Attention is currently required from: Dinesh Gehlot, Eran Mitrani, Jakub Czapiga, Kapil Porwal, Subrata Banik, Tarun.
Hello Subrata Banik,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/85545?usp=email
to review the following change.
Change subject: intel/common/block: Program the right power_limits_config entry ......................................................................
intel/common/block: Program the right power_limits_config entry
When variant_update_cpu_power_limits() programs PL4, it systematically sets the first entry of the power_limits_config SoC chip data structure. This approach is problematic because the current SoC SKU may align with a different data structure entry, introducing inconsistencies.
This commit introduces the power_limits_index field to the cpu_tdp_power_limits data structure. This field specifies the specific power limits entry that should be updated.
All data structures utilized by this function are updated accordingly.
BUG=b:380408956 TEST=Able to retrieve collect 28W power_limit.
Change-Id: I54b74241cca29eee722178f9fb1be5e8a7a8be15 Signed-off-by: Subrata Banik subratabanik@google.com Signed-off-by: Jeremy Compostella jeremy.compostella@intel.com --- M src/mainboard/google/rex/variants/baseboard/ovis/ramstage.c M src/mainboard/google/rex/variants/baseboard/rex/ramstage.c M src/mainboard/google/rex/variants/deku/ramstage.c M src/mainboard/google/rex/variants/screebo/variant.c M src/mainboard/intel/mtlrvp/variants/baseboard/mtlrvp_p/ramstage.c M src/soc/intel/common/block/include/intelblocks/power_limit.h M src/soc/intel/common/block/power_limit/power_limit.c 7 files changed, 14 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/85545/1
diff --git a/src/mainboard/google/rex/variants/baseboard/ovis/ramstage.c b/src/mainboard/google/rex/variants/baseboard/ovis/ramstage.c index e23fc9a..b1b3b9c 100644 --- a/src/mainboard/google/rex/variants/baseboard/ovis/ramstage.c +++ b/src/mainboard/google/rex/variants/baseboard/ovis/ramstage.c @@ -41,6 +41,7 @@ { .mch_id = PCI_DID_INTEL_MTL_P_ID_1, .cpu_tdp = 28, + .power_limits_index = MTL_P_682_482_CORE, .pl1_min_power = 19000, .pl1_max_power = 28000, .pl2_min_power = 64000, @@ -50,6 +51,7 @@ { .mch_id = PCI_DID_INTEL_MTL_P_ID_3, .cpu_tdp = 28, + .power_limits_index = MTL_P_682_482_CORE, .pl1_min_power = 19000, .pl1_max_power = 28000, .pl2_min_power = 64000, diff --git a/src/mainboard/google/rex/variants/baseboard/rex/ramstage.c b/src/mainboard/google/rex/variants/baseboard/rex/ramstage.c index 14fbad2..2b920ad 100644 --- a/src/mainboard/google/rex/variants/baseboard/rex/ramstage.c +++ b/src/mainboard/google/rex/variants/baseboard/rex/ramstage.c @@ -15,6 +15,7 @@ { .mch_id = PCI_DID_INTEL_MTL_P_ID_2, .cpu_tdp = 15, + .power_limits_index = MTL_P_282_242_CORE, .pl1_min_power = 10000, .pl1_max_power = 15000, .pl2_min_power = 57000, @@ -24,6 +25,7 @@ { .mch_id = PCI_DID_INTEL_MTL_P_ID_5, .cpu_tdp = 15, + .power_limits_index = MTL_P_282_242_CORE, .pl1_min_power = 10000, .pl1_max_power = 15000, .pl2_min_power = 57000, @@ -36,6 +38,7 @@ { .mch_id = PCI_DID_INTEL_MTL_P_ID_2, .cpu_tdp = 15, + .power_limits_index = MTL_P_282_242_CORE, .pl1_min_power = 10000, .pl1_max_power = 15000, .pl2_min_power = 57000, @@ -45,6 +48,7 @@ { .mch_id = PCI_DID_INTEL_MTL_P_ID_5, .cpu_tdp = 15, + .power_limits_index = MTL_P_282_242_CORE, .pl1_min_power = 10000, .pl1_max_power = 15000, .pl2_min_power = 57000, diff --git a/src/mainboard/google/rex/variants/deku/ramstage.c b/src/mainboard/google/rex/variants/deku/ramstage.c index 0cfcae1..871313c 100644 --- a/src/mainboard/google/rex/variants/deku/ramstage.c +++ b/src/mainboard/google/rex/variants/deku/ramstage.c @@ -14,6 +14,7 @@ { .mch_id = PCI_DID_INTEL_MTL_P_ID_1, .cpu_tdp = 28, + .power_limits_index = MTL_P_682_482_CORE, .pl1_min_power = 19000, .pl1_max_power = 28000, .pl2_min_power = 64000, @@ -23,6 +24,7 @@ { .mch_id = PCI_DID_INTEL_MTL_P_ID_3, .cpu_tdp = 28, + .power_limits_index = MTL_P_682_482_CORE, .pl1_min_power = 19000, .pl1_max_power = 28000, .pl2_min_power = 64000, diff --git a/src/mainboard/google/rex/variants/screebo/variant.c b/src/mainboard/google/rex/variants/screebo/variant.c index edddd43..00ee19f5 100644 --- a/src/mainboard/google/rex/variants/screebo/variant.c +++ b/src/mainboard/google/rex/variants/screebo/variant.c @@ -35,6 +35,7 @@ { .mch_id = PCI_DID_INTEL_MTL_P_ID_2, .cpu_tdp = 15, + .power_limits_index = MTL_P_282_242_CORE, .pl1_min_power = 10000, .pl1_max_power = 15000, .pl2_min_power = 40000, @@ -44,6 +45,7 @@ { .mch_id = PCI_DID_INTEL_MTL_P_ID_5, .cpu_tdp = 15, + .power_limits_index = MTL_P_282_242_CORE, .pl1_min_power = 10000, .pl1_max_power = 15000, .pl2_min_power = 40000, diff --git a/src/mainboard/intel/mtlrvp/variants/baseboard/mtlrvp_p/ramstage.c b/src/mainboard/intel/mtlrvp/variants/baseboard/mtlrvp_p/ramstage.c index aee3d88..d8a171e 100644 --- a/src/mainboard/intel/mtlrvp/variants/baseboard/mtlrvp_p/ramstage.c +++ b/src/mainboard/intel/mtlrvp/variants/baseboard/mtlrvp_p/ramstage.c @@ -13,6 +13,7 @@ { .mch_id = PCI_DID_INTEL_MTL_P_ID_2, .cpu_tdp = 15, + .power_limits_index = MTL_P_282_242_CORE, .pl1_min_power = 10000, .pl1_max_power = 15000, .pl2_min_power = 57000, diff --git a/src/soc/intel/common/block/include/intelblocks/power_limit.h b/src/soc/intel/common/block/include/intelblocks/power_limit.h index 290a3a3..d02eaa1 100644 --- a/src/soc/intel/common/block/include/intelblocks/power_limit.h +++ b/src/soc/intel/common/block/include/intelblocks/power_limit.h @@ -45,6 +45,7 @@ struct cpu_tdp_power_limits { uint16_t mch_id; uint8_t cpu_tdp; + uint32_t power_limits_index; unsigned int pl1_min_power; unsigned int pl1_max_power; unsigned int pl2_min_power; diff --git a/src/soc/intel/common/block/power_limit/power_limit.c b/src/soc/intel/common/block/power_limit/power_limit.c index 40a0857..b5fbe89 100644 --- a/src/soc/intel/common/block/power_limit/power_limit.c +++ b/src/soc/intel/common/block/power_limit/power_limit.c @@ -268,7 +268,8 @@ } else { struct dptf_power_limits *settings = &config->controls.power_limits; config_t *conf = config_of_soc(); - struct soc_power_limits_config *soc_config = conf->power_limits_config; + struct soc_power_limits_config *soc_config = + &conf->power_limits_config[limits[index].power_limits_index]; settings->pl1.min_power = limits[index].pl1_min_power; settings->pl1.max_power = limits[index].pl1_max_power; settings->pl2.min_power = limits[index].pl2_min_power;