From 7424576e4183112c7a902925cbde5919b1f2c689 Mon Sep 17 00:00:00 2001 From: Sridahr Siricilla Date: Thu, 11 Nov 2021 01:42:30 +0530 Subject: soc/intel/common: Add CPU related APIs The patch defines below APIs : cpu_is_hybrid_supported() : Check whether CPU is hybrid CPU or not. cpu_get_bus_frequency() : Get CPU's bus frequency in MHz cpu_get_max_non_turbo_ratio() : Get CPU's max non-turbo ratio cpu_get_cpu_type() : Get CPU type. The function must be called if executing CPU is hybrid. TEST=Verified the APIs on the Brya board Signed-off-by: Sridhar Siricilla Change-Id: I680f43952ab4abce6e342206688ad32814970a91 Reviewed-on: https://review.coreboot.org/c/coreboot/+/59124 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak --- src/soc/intel/common/block/include/intelblocks/cpulib.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/soc/intel/common/block/include/intelblocks') diff --git a/src/soc/intel/common/block/include/intelblocks/cpulib.h b/src/soc/intel/common/block/include/intelblocks/cpulib.h index 7e3deb0fd4..094acebd54 100644 --- a/src/soc/intel/common/block/include/intelblocks/cpulib.h +++ b/src/soc/intel/common/block/include/intelblocks/cpulib.h @@ -11,6 +11,21 @@ */ void cpu_set_max_ratio(void); +/* Get CPU bus frequency in MHz */ +u32 cpu_get_bus_frequency(void); + +/* Get CPU's max non-turbo ratio */ +u8 cpu_get_max_non_turbo_ratio(void); + +/* Check if CPU is hybrid CPU or not */ +bool cpu_is_hybrid_supported(void); + +/* + * Returns type of CPU that executing the function. It returns 0x20 + * if CPU is atom, otherwise 0x40 if CPU is CORE. The API must be called + * if CPU is hybrid. + */ +uint8_t cpu_get_cpu_type(void); /* * Get the TDP Nominal Ratio from MSR 0x648 Bits 7:0. */ -- cgit v1.2.3