summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSubrata Banik <subratabanik@google.com>2023-11-29 00:25:58 +0530
committerSubrata Banik <subratabanik@google.com>2023-12-02 18:03:52 +0000
commitfaf277995999179794d0a571ffc02faaee363c79 (patch)
tree8e7cb9be40d5da9c398a469be951da0def945d51 /src
parent73c918c59025e504c9a1d6f697646d5dd63e828e (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/google/rex/mainboard.c6
-rw-r--r--src/mainboard/google/rex/variants/baseboard/include/baseboard/variants.h4
-rw-r--r--src/mainboard/google/rex/variants/baseboard/ovis/ramstage.c9
-rw-r--r--src/mainboard/google/rex/variants/baseboard/rex/ramstage.c9
4 files changed, 22 insertions, 6 deletions
diff --git a/src/mainboard/google/rex/mainboard.c b/src/mainboard/google/rex/mainboard.c
index 619ca71927..3ca85ff77c 100644
--- a/src/mainboard/google/rex/mainboard.c
+++ b/src/mainboard/google/rex/mainboard.c
@@ -41,12 +41,12 @@ static void mainboard_init(void *chip_info)
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 afed754438..bd3d535c16 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 @@ enum s0ix_entry {
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 5955b2adc4..17d39ae139 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 @@ const struct cpu_tdp_power_limits limits[] = {
},
};
-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 02bdca5d01..7c09651046 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 @@ const struct cpu_tdp_power_limits power_optimized_limits[] = {
};
#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 @@ void variant_devtree_update(void)
variant_update_cpu_power_limits(limits, limits_size);
}
+
+void baseboard_devtree_update(void)
+{
+ variant_devtree_update();
+}