aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/cpu/ivybridge/model_206ax.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-09-25 08:11:35 -0600
committerBin Meng <bmeng.cn@gmail.com>2019-10-08 13:57:35 +0800
commitd3abc5d1ee5ffea5647a22ddfff82c01d507f962 (patch)
treed8d587df264e55eed155acd965fe430e37238aa6 /arch/x86/cpu/ivybridge/model_206ax.c
parent46dd41fa5a8f08af903c7f0cfde9abfc16d7efe3 (diff)
downloadu-boot-d3abc5d1ee5ffea5647a22ddfff82c01d507f962.zip
u-boot-d3abc5d1ee5ffea5647a22ddfff82c01d507f962.tar.gz
u-boot-d3abc5d1ee5ffea5647a22ddfff82c01d507f962.tar.bz2
x86: Move common Intel CPU info code into a function
Add cpu_intel_get_info() to find out the CPU info on modern Intel CPUs. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: add parameter and return value descriptions] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/cpu/ivybridge/model_206ax.c')
-rw-r--r--arch/x86/cpu/ivybridge/model_206ax.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/x86/cpu/ivybridge/model_206ax.c b/arch/x86/cpu/ivybridge/model_206ax.c
index 6edc3e2..68e78e9 100644
--- a/arch/x86/cpu/ivybridge/model_206ax.c
+++ b/arch/x86/cpu/ivybridge/model_206ax.c
@@ -12,6 +12,7 @@
#include <fdtdec.h>
#include <malloc.h>
#include <asm/cpu.h>
+#include <asm/cpu_common.h>
#include <asm/cpu_x86.h>
#include <asm/msr.h>
#include <asm/msr-index.h>
@@ -436,12 +437,7 @@ static int model_206ax_init(struct udevice *dev)
static int model_206ax_get_info(struct udevice *dev, struct cpu_info *info)
{
- msr_t msr;
-
- msr = msr_read(MSR_IA32_PERF_CTL);
- info->cpu_freq = ((msr.lo >> 8) & 0xff) * SANDYBRIDGE_BCLK * 1000000;
- info->features = 1 << CPU_FEAT_L1_CACHE | 1 << CPU_FEAT_MMU |
- 1 << CPU_FEAT_UCODE;
+ return cpu_intel_get_info(info, SANDYBRIDGE_BCLK);
return 0;
}