Aamir Bohra has uploaded this change for review. ( https://review.coreboot.org/20017
Change subject: soc/intel/apollolake: Add config for cpu base clock frequency ......................................................................
soc/intel/apollolake: Add config for cpu base clock frequency
Add config for cpu base clock frequency(Mhz), use and clean up code.
Change-Id: I724c48c11796aa942295d4f19cc629d4c13647e1 Signed-off-by: Aamir Bohra aamir.bohra@intel.com --- M src/soc/intel/apollolake/Kconfig M src/soc/intel/apollolake/include/soc/cpu.h M src/soc/intel/apollolake/tsc_freq.c 3 files changed, 5 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/20017/1
diff --git a/src/soc/intel/apollolake/Kconfig b/src/soc/intel/apollolake/Kconfig index 56f0d20..fe72c07 100644 --- a/src/soc/intel/apollolake/Kconfig +++ b/src/soc/intel/apollolake/Kconfig @@ -322,4 +322,8 @@ string default "aplk"
+config CPU_BCLK_MHZ + int + default 100 + endif diff --git a/src/soc/intel/apollolake/include/soc/cpu.h b/src/soc/intel/apollolake/include/soc/cpu.h index 3391597..0900eef 100644 --- a/src/soc/intel/apollolake/include/soc/cpu.h +++ b/src/soc/intel/apollolake/include/soc/cpu.h @@ -32,8 +32,6 @@ #define CPUID_APOLLOLAKE_A0 0x506c8 #define CPUID_APOLLOLAKE_B0 0x506c9
-#define BASE_CLOCK_MHZ 100 - /* Common Timer Copy (CTC) frequency - 19.2MHz. */ #define CTC_FREQ 19200000
diff --git a/src/soc/intel/apollolake/tsc_freq.c b/src/soc/intel/apollolake/tsc_freq.c index f91a047..885311c 100644 --- a/src/soc/intel/apollolake/tsc_freq.c +++ b/src/soc/intel/apollolake/tsc_freq.c @@ -26,7 +26,7 @@ unsigned long tsc_freq_mhz(void) { msr_t msr = rdmsr(MSR_PLATFORM_INFO); - return (BASE_CLOCK_MHZ * ((msr.lo >> 8) & 0xff)); + return (CONFIG_CPU_BCLK_MHZ * ((msr.lo >> 8) & 0xff)); }
void set_max_freq(void)