Marc Jones has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48739 )
Change subject: soc/intel/common/block/acpi: Make calculate_power() global ......................................................................
soc/intel/common/block/acpi: Make calculate_power() global
Change static calculate_power() function to global and update the name to common_calculate_power_ratio() for SOC ACPI code use.
Change-Id: I0e2d118ad52b36859bfc6029b7dee946193841f4 Signed-off-by: Marc Jones marcjones@sysproconsulting.com --- M src/soc/intel/common/block/acpi/acpi.c M src/soc/intel/common/block/include/intelblocks/acpi.h 2 files changed, 7 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/48739/1
diff --git a/src/soc/intel/common/block/acpi/acpi.c b/src/soc/intel/common/block/acpi/acpi.c index d2177294..a6c626f 100644 --- a/src/soc/intel/common/block/acpi/acpi.c +++ b/src/soc/intel/common/block/acpi/acpi.c @@ -242,7 +242,7 @@ } }
-static int calculate_power(int tdp, int p1_ratio, int ratio) +int common_calculate_power_ratio(int tdp, int p1_ratio, int ratio) { u32 m; u32 power; @@ -360,7 +360,7 @@ ratio >= ratio_min; ratio -= ratio_step) {
/* Calculate power at this ratio */ - power = calculate_power(power_max, ratio_max, ratio); + power = common_calculate_power_ratio(power_max, ratio_max, ratio); clock = (ratio * cpu_get_bus_clock()) / KHz;
acpigen_write_PSS_package(clock, /* MHz */ diff --git a/src/soc/intel/common/block/include/intelblocks/acpi.h b/src/soc/intel/common/block/include/intelblocks/acpi.h index d058a5d..cd3a309 100644 --- a/src/soc/intel/common/block/include/intelblocks/acpi.h +++ b/src/soc/intel/common/block/include/intelblocks/acpi.h @@ -63,4 +63,9 @@ */ void soc_power_states_generation(int core_id, int cores_per_package);
+/* + * Common function to calculate the power ratio for power state generation + */ +int common_calculate_power_ratio(int tdp, int p1_ratio, int ratio); + #endif /* _SOC_INTEL_COMMON_BLOCK_ACPI_H_ */