aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/cpu/intel_common/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/cpu/intel_common/cpu.c')
-rw-r--r--arch/x86/cpu/intel_common/cpu.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/cpu/intel_common/cpu.c b/arch/x86/cpu/intel_common/cpu.c
index cb4ef84013..d8a3d60ae7 100644
--- a/arch/x86/cpu/intel_common/cpu.c
+++ b/arch/x86/cpu/intel_common/cpu.c
@@ -291,3 +291,17 @@ int cpu_get_max_turbo_ratio(void)
return msr.lo & 0xff;
}
+
+int cpu_get_cores_per_package(void)
+{
+ struct cpuid_result result;
+ int cores = 1;
+
+ if (gd->arch.x86_vendor != X86_VENDOR_INTEL)
+ return 1;
+
+ result = cpuid_ext(0xb, 1);
+ cores = result.ebx & 0xff;
+
+ return cores;
+}