summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2017-07-26 03:12:01 (GMT)
committerBin Meng <bmeng.cn@gmail.com>2017-08-01 12:17:02 (GMT)
commit0b992e4932303b0a379f590f67ec9759fc97275e (patch)
tree9cfd3fca8d2935e6697c9a1f4b3afc079eee7ab0 /drivers
parentd92e9c8d313134f2ebde14a393f820b2191f4011 (diff)
downloadu-boot-fsl-qoriq-0b992e4932303b0a379f590f67ec9759fc97275e.tar.xz
x86: tsc: Identify Intel-specific code
try_msr_calibrate_tsc() is currently Intel-specific, and should not execute on any other vendor's parts. This keeps in sync with Linux kernel commit: ba82683: x86/tsc_msr: Identify Intel-specific code Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/timer/tsc_timer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/timer/tsc_timer.c b/drivers/timer/tsc_timer.c
index ffbc709..4d01c9b 100644
--- a/drivers/timer/tsc_timer.c
+++ b/drivers/timer/tsc_timer.c
@@ -11,6 +11,7 @@
#include <dm.h>
#include <malloc.h>
#include <timer.h>
+#include <asm/cpu.h>
#include <asm/io.h>
#include <asm/i8254.h>
#include <asm/ibmpc.h>
@@ -86,6 +87,9 @@ static unsigned long __maybe_unused try_msr_calibrate_tsc(void)
unsigned long res;
int cpu_index;
+ if (gd->arch.x86_vendor != X86_VENDOR_INTEL)
+ return 0;
+
cpu_index = match_cpu(gd->arch.x86, gd->arch.x86_model);
if (cpu_index < 0)
return 0;