[coreboot-gerrit] Change in coreboot[master]: src/soc/intel/common: Modifies common block acpi files

Shaunak Saha (Code Review) gerrit at coreboot.org
Fri Aug 18 00:32:30 CEST 2017


Shaunak Saha has uploaded this change for review. ( https://review.coreboot.org/21077


Change subject: src/soc/intel/common: Modifies common block acpi files
......................................................................

src/soc/intel/common: Modifies common block acpi files

This patch modifies the common acpi files as few cpu specific
functions are moved from common acpi to cpu library.

TEST= System boots properly and no regression observed.

Change-Id: I05f01278df0ccfdcafed0b3f32040c8c1a05be7e
Signed-off-by: Shaunak Saha <shaunak.saha at intel.com>
---
M src/soc/intel/common/acpi.h
M src/soc/intel/common/acpi/acpi.c
2 files changed, 1 insertion(+), 101 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/21077/1

diff --git a/src/soc/intel/common/acpi.h b/src/soc/intel/common/acpi.h
index 845e0f0..19ab926 100644
--- a/src/soc/intel/common/acpi.h
+++ b/src/soc/intel/common/acpi.h
@@ -32,47 +32,6 @@
 #if IS_ENABLED(CONFIG_SOC_INTEL_COMMON_ACPI)
 
 /*
- * cpu_get_bus_clock returns the bus clock frequency in KHz.
- * This is the value the clock ratio is multiplied with.
- */
-uint32_t cpu_get_bus_clock(void);
-
-/*
- * cpu_get_coord_type returns coordination type (SW_ANY or SW_ALL or HW_ALL)
- * which is used to populate _PSD object.
- */
-int cpu_get_coord_type(void);
-
-/*
- * cpu_config_tdp_levels returns the number of TDP levels supported
- * by this processor
- */
-int cpu_config_tdp_levels(void);
-
-/*
- * cpu_get_min_ratio returns the minimum frequency ratio that is supported
- * by this processor
- */
-uint32_t cpu_get_min_ratio(void);
-
-/*
- * cpu_get_max_ratio returns the nominal TDP ratio if available or the
- * maximum non turbo frequency ratio for this processor
- */
-uint32_t cpu_get_max_ratio(void);
-
-/*
- * cpu_get_power_max calculates CPU TDP in mW
- */
-uint32_t cpu_get_power_max(void);
-
-/*
- * cpu_get_max_turbo_ratio returns the maximum turbo ratio limit for the
- * processor
- */
-uint32_t cpu_get_max_turbo_ratio(void);
-
-/*
  * get_cstate_map returns a table of processor specific acpi_cstate_t entries
  * and number of entries in the table
  */
diff --git a/src/soc/intel/common/acpi/acpi.c b/src/soc/intel/common/acpi/acpi.c
index 458b95f..0934dbd 100644
--- a/src/soc/intel/common/acpi/acpi.c
+++ b/src/soc/intel/common/acpi/acpi.c
@@ -18,6 +18,7 @@
 #include <arch/cpu.h>
 #include <cpu/intel/turbo.h>
 #include <cpu/x86/msr.h>
+#include <intelblocks/cpulib.h>
 #include <soc/intel/common/acpi.h>
 #include <soc/pm.h>
 
@@ -33,66 +34,6 @@
 #define PSS_LATENCY_TRANSITION		10
 #define PSS_LATENCY_BUSMASTER		10
 
-
-__attribute__((weak)) int cpu_get_coord_type(void)
-{
-	return HW_ALL;
-}
-
-__attribute__((weak)) int cpu_config_tdp_levels(void)
-{
-	return 0;
-}
-
-__attribute__((weak)) uint32_t cpu_get_min_ratio(void)
-{
-	msr_t msr;
-	/* Get bus ratio limits and calculate clock speeds */
-	msr = rdmsr(MSR_PLATFORM_INFO);
-	return ((msr.hi >> 8) & 0xff); /* Max Efficiency Ratio */
-}
-
-__attribute__((weak)) uint32_t cpu_get_max_ratio(void)
-{
-	msr_t msr;
-	uint32_t ratio_max;
-	if (cpu_config_tdp_levels()) {
-		/* Set max ratio to nominal TDP ratio */
-		msr = rdmsr(MSR_CONFIG_TDP_NOMINAL);
-		ratio_max = msr.lo & 0xff;
-	} else {
-		msr = rdmsr(MSR_PLATFORM_INFO);
-		/* Max Non-Turbo Ratio */
-		ratio_max = (msr.lo >> 8) & 0xff;
-	}
-	return ratio_max;
-}
-
-__attribute__((weak)) uint32_t cpu_get_bus_clock(void)
-{
-	/* CPU bus clock is set by default here to 100MHz.
-	 * This function returns the bus clock in KHz.
-	 */
-	return 100 * KHz;
-}
-
-__attribute__((weak)) uint32_t cpu_get_power_max(void)
-{
-	msr_t msr;
-	int power_unit;
-
-	msr = rdmsr(MSR_RAPL_POWER_UNIT);
-	power_unit = 2 << ((msr.lo & 0xf) - 1);
-	msr = rdmsr(MSR_PKG_POWER_INFO);
-	return ((msr.lo & 0x7fff) / power_unit) * 1000;
-}
-
-__attribute__((weak)) uint32_t cpu_get_max_turbo_ratio(void)
-{
-	msr_t msr;
-	msr = rdmsr(MSR_TURBO_RATIO_LIMIT);
-	return msr.lo & 0xff;
-}
 
 __attribute__((weak)) acpi_cstate_t *soc_get_cstate_map(int *entries)
 {

-- 
To view, visit https://review.coreboot.org/21077
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I05f01278df0ccfdcafed0b3f32040c8c1a05be7e
Gerrit-Change-Number: 21077
Gerrit-PatchSet: 1
Gerrit-Owner: Shaunak Saha <shaunak.saha at intel.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170817/128cebdf/attachment-0001.html>


More information about the coreboot-gerrit mailing list