Subrata Banik has submitted this change. ( https://review.coreboot.org/c/coreboot/+/79329?usp=email )
Change subject: mb/google/rex: Enhance power limit override mechanism ......................................................................
mb/google/rex: Enhance power limit override mechanism
This patch expands the power limit override capability to include variants directories, enabling them to modify power limit settings configured by the baseboard.
Previously, only the baseboard could override power limit settings. For instance, while the google/rex baseboard sets the PL1 max power limit to 15W, the google/screebo variant couldn't override this value.
This enhancement empowers variants directories to override baseboard- configured power limit settings, allowing for greater flexibility and control over power limits.
BUG=b:313667378 TEST=Able to call into _weak implementation of `variant_devtree_update` unless there is one override.
[DEBUG] WEAK: src/mainboard/google/rex/variants/baseboard/rex/ ramstage.c/variant_devtree_update called [INFO ] Overriding power limits PL1 (mW) (10000, 15000) PL2 (mW) (40000, 40000) PL4 (W) (84)
Change-Id: Ib07691625e075b0fbab42271512322ffc60ba13b Signed-off-by: Subrata Banik subratabanik@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/79329 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Kapil Porwal kapilporwal@google.com --- M src/mainboard/google/rex/mainboard.c M src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h M src/mainboard/google/rex/variants/baseboard/ovis/ramstage.c M src/mainboard/google/rex/variants/baseboard/rex/ramstage.c 4 files changed, 22 insertions(+), 6 deletions(-)
Approvals: build bot (Jenkins): Verified Kapil Porwal: Looks good to me, approved
diff --git a/src/mainboard/google/rex/mainboard.c b/src/mainboard/google/rex/mainboard.c index 619ca71..3ca85ff 100644 --- a/src/mainboard/google/rex/mainboard.c +++ b/src/mainboard/google/rex/mainboard.c @@ -41,12 +41,12 @@ fw_config_gpio_padbased_override(padbased_table); gpio_configure_pads_with_padbased(padbased_table); free(padbased_table); - variant_devtree_update(); + baseboard_devtree_update(); }
-void __weak variant_devtree_update(void) +void __weak baseboard_devtree_update(void) { - /* Override dev tree settings per board */ + /* Override dev tree settings per baseboard */ }
void __weak variant_generate_s0ix_hook(enum s0ix_entry entry) diff --git a/src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h index afed754..bd3d535 100644 --- a/src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h @@ -31,7 +31,9 @@
void variant_generate_s0ix_hook(enum s0ix_entry entry);
-/* Modify devictree settings during ramstage */ +/* Modify devictree settings during ramstage by baseboard */ +void baseboard_devtree_update(void); +/* Modify devictree settings during ramstage by dedicated variant */ void variant_devtree_update(void);
#endif /*__BASEBOARD_VARIANTS_H__ */ diff --git a/src/mainboard/google/rex/variants/baseboard/ovis/ramstage.c b/src/mainboard/google/rex/variants/baseboard/ovis/ramstage.c index 5955b2a..17d39ae 100644 --- a/src/mainboard/google/rex/variants/baseboard/ovis/ramstage.c +++ b/src/mainboard/google/rex/variants/baseboard/ovis/ramstage.c @@ -21,8 +21,15 @@ }, };
-void variant_devtree_update(void) +void __weak variant_devtree_update(void) { + printk(BIOS_DEBUG, "WEAK: %s/%s called\n", __FILE__, __func__); + size_t total_entries = ARRAY_SIZE(limits); variant_update_cpu_power_limits(limits, total_entries); } + +void baseboard_devtree_update(void) +{ + variant_devtree_update(); +} diff --git a/src/mainboard/google/rex/variants/baseboard/rex/ramstage.c b/src/mainboard/google/rex/variants/baseboard/rex/ramstage.c index 02bdca5d..7c096510 100644 --- a/src/mainboard/google/rex/variants/baseboard/rex/ramstage.c +++ b/src/mainboard/google/rex/variants/baseboard/rex/ramstage.c @@ -96,8 +96,10 @@ }; #endif
-void variant_devtree_update(void) +void __weak variant_devtree_update(void) { + printk(BIOS_DEBUG, "WEAK: %s/%s called\n", __FILE__, __func__); + const struct cpu_tdp_power_limits *limits = performance_efficient_limits; size_t limits_size = ARRAY_SIZE(performance_efficient_limits);
@@ -115,3 +117,8 @@
variant_update_cpu_power_limits(limits, limits_size); } + +void baseboard_devtree_update(void) +{ + variant_devtree_update(); +}