From 5a2de49baa761d0d2bdc5ac446d1db1fbc92ec39 Mon Sep 17 00:00:00 2001 From: Jeremy Compostella Date: Tue, 10 Jun 2025 13:18:52 -0700 Subject: [PATCH] soc/intel/cmn/blk/power_limit: Add helper functions to romstage This commit makes power limit helper functions accessible during romstage by updating the Makefile to include `power_limit.c` for both ramstage and romstage. It also modifies a preprocessor directive to ensure `variant_update_cpu_power_limits()` is not compiled in romstage as it is only intended for late-in-the-boot usage and will not compile properly in romstage. This change enables power management configuration identification early in the boot process, allowing for better control over power settings at this stage. TEST=Successfully compile the Fatcat board target. Change-Id: Ibf4d85c71dd8963063ca014d151438b68ea918db Signed-off-by: Jeremy Compostella Reviewed-on: https://review.coreboot.org/c/coreboot/+/88038 Reviewed-by: Subrata Banik Tested-by: build bot (Jenkins) --- src/soc/intel/common/block/power_limit/Makefile.mk | 1 + src/soc/intel/common/block/power_limit/power_limit.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/soc/intel/common/block/power_limit/Makefile.mk b/src/soc/intel/common/block/power_limit/Makefile.mk index 8211eb7a4f..8168bd942c 100644 --- a/src/soc/intel/common/block/power_limit/Makefile.mk +++ b/src/soc/intel/common/block/power_limit/Makefile.mk @@ -1,2 +1,3 @@ ## SPDX-License-Identifier: GPL-2.0-only ramstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_POWER_LIMIT) += power_limit.c +romstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_POWER_LIMIT) += power_limit.c 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 16917835cd..4758f09f82 100644 --- a/src/soc/intel/common/block/power_limit/power_limit.c +++ b/src/soc/intel/common/block/power_limit/power_limit.c @@ -243,7 +243,7 @@ u8 get_cpu_tdp(void) WEAK_DEV_PTR(dptf_policy); -#if CONFIG(SOC_INTEL_COMMON_BLOCK_VARIANT_POWER_LIMIT) +#if ENV_RAMSTAGE && CONFIG(SOC_INTEL_COMMON_BLOCK_VARIANT_POWER_LIMIT) void variant_update_cpu_power_limits(const struct cpu_tdp_power_limits *limits, size_t num_entries) {