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 <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88038
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Jeremy Compostella 2025-06-10 13:18:52 -07:00 committed by Jérémy Compostella
commit 5a2de49baa
2 changed files with 2 additions and 1 deletions

View file

@ -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

View file

@ -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)
{