All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/6] x86: tsc: Identify Intel-specific code
Date: Tue, 25 Jul 2017 20:12:01 -0700	[thread overview]
Message-ID: <1501038725-20850-2-git-send-email-bmeng.cn@gmail.com> (raw)
In-Reply-To: <1501038725-20850-1-git-send-email-bmeng.cn@gmail.com>

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 <bmeng.cn@gmail.com>
---

 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 <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;
-- 
2.9.2

  reply	other threads:[~2017-07-26  3:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-26  3:12 [U-Boot] [PATCH 1/6] x86: tsc: Read all ratio bits from MSR_PLATFORM_INFO Bin Meng
2017-07-26  3:12 ` Bin Meng [this message]
2017-07-26  3:16   ` [U-Boot] [PATCH 2/6] x86: tsc: Identify Intel-specific code Bin Meng
2017-08-01  9:11   ` Simon Glass
2017-08-01 12:21     ` Bin Meng
2017-07-26  3:12 ` [U-Boot] [PATCH 3/6] x86: tsc: Remove the fail handling in try_msr_calibrate_tsc() Bin Meng
2017-08-01  9:11   ` Simon Glass
2017-08-01 12:21     ` Bin Meng
2017-07-26  3:12 ` [U-Boot] [PATCH 4/6] x86: tsc: Update comments and expand definitions in freq_desc_tables[] Bin Meng
2017-08-01  9:11   ` Simon Glass
2017-08-01 12:21     ` Bin Meng
2017-07-26  3:12 ` [U-Boot] [PATCH 5/6] x86: tsc: Correct Silvermont reference clock values Bin Meng
2017-08-01  9:11   ` Simon Glass
2017-08-01 12:21     ` Bin Meng
2017-07-26  3:12 ` [U-Boot] [PATCH 6/6] x86: tsc: Rename try_msr_calibrate_tsc() to cpu_mhz_from_msr() Bin Meng
2017-08-01  9:11   ` Simon Glass
2017-08-01 12:22     ` Bin Meng
2017-08-01  9:10 ` [U-Boot] [PATCH 1/6] x86: tsc: Read all ratio bits from MSR_PLATFORM_INFO Simon Glass
2017-08-01 12:21   ` Bin Meng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1501038725-20850-2-git-send-email-bmeng.cn@gmail.com \
    --to=bmeng.cn@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.