From 4610bbc7d0934d85e248b95b70efc788d662d855 Mon Sep 17 00:00:00 2001 From: Tim Wawrzynczak Date: Mon, 23 Aug 2021 13:50:32 -0600 Subject: mb/google/brya: Fix PL4 limits Commit e7f3e6a0558 added PL4 limits for brya0, but the units were mW, whereas the `tdp_pl4` field is expected to be in whole Watts, therefore divide all of the settings by 1000. BUG=b:197468828 TEST=boot brya0 to OS Signed-off-by: Tim Wawrzynczak Change-Id: I6da6bae4eb8c83188d813828cdc4f7c1e20f1b5f Reviewed-on: https://review.coreboot.org/c/coreboot/+/57099 Tested-by: build bot (Jenkins) Reviewed-by: EricR Lai Reviewed-by: Sumeet R Pawnikar --- src/mainboard/google/brya/variants/baseboard/brya/ramstage.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mainboard/google/brya/variants/baseboard') diff --git a/src/mainboard/google/brya/variants/baseboard/brya/ramstage.c b/src/mainboard/google/brya/variants/baseboard/brya/ramstage.c index 6504d5b864..d329f4378f 100644 --- a/src/mainboard/google/brya/variants/baseboard/brya/ramstage.c +++ b/src/mainboard/google/brya/variants/baseboard/brya/ramstage.c @@ -9,6 +9,8 @@ #include #include +#define MILLIWATTS_TO_WATTS 1000 + void variant_update_power_limits(const struct cpu_power_limits *limits, size_t num_entries) { if (!num_entries) @@ -37,7 +39,8 @@ void variant_update_power_limits(const struct cpu_power_limits *limits, size_t n settings->pl1.max_power = limits[i].pl1_max_power; settings->pl2.min_power = limits[i].pl2_min_power; settings->pl2.max_power = limits[i].pl2_max_power; - soc_config->tdp_pl4 = limits[i].pl4_power; + soc_config->tdp_pl4 = DIV_ROUND_UP(limits[i].pl4_power, + MILLIWATTS_TO_WATTS); printk(BIOS_INFO, "Overriding power limits PL1 (%u, %u) PL2 (%u, %u) PL4 (%u)\n", limits[i].pl1_min_power, limits[i].pl1_max_power, -- cgit v1.2.3