From: Bin Meng Date: Tue, 25 Jul 2017 20:12:01 -0700 Subject: [U-Boot] [PATCH 2/6] x86: tsc: Identify Intel-specific code In-Reply-To: <1501038725-20850-1-git-send-email-bmeng.cn@gmail.com> References: <1501038725-20850-1-git-send-email-bmeng.cn@gmail.com> Message-ID: <1501038725-20850-2-git-send-email-bmeng.cn@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de cpu_mhz_from_msr() 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 --- drivers/timer/tsc_timer.c | 4 ++++ 1 file changed, 4 insertions(+) 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 #include #include +#include #include #include #include @@ -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; -- 2.9.2