From patchwork Wed Jul 26 03:12:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 793693 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RIw9BLTI"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xHKnT3bcBz9s3T for ; Wed, 26 Jul 2017 13:08:45 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 21A9CC21D9E; Wed, 26 Jul 2017 03:08:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5E361C21DDE; Wed, 26 Jul 2017 03:07:54 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 02FAEC21DAB; Wed, 26 Jul 2017 03:07:47 +0000 (UTC) Received: from mail-it0-f67.google.com (mail-it0-f67.google.com [209.85.214.67]) by lists.denx.de (Postfix) with ESMTPS id 7D0B6C21C2B for ; Wed, 26 Jul 2017 03:07:44 +0000 (UTC) Received: by mail-it0-f67.google.com with SMTP id t78so8787405ita.1 for ; Tue, 25 Jul 2017 20:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=7/cXxlTtTr+3Evdb2+aKYcKTo02nxSTd8hjJW9ioZ8M=; b=RIw9BLTIt9XH9T28Pm1lyd1YCzjV2OEBx9YerWtMWx1/dbU3iXgNY5WBOgeEeRNDGR scXcyjNAQu91bryDckw5AEfbM9p5WGZJWvMAaY0AkJmBAFg1qEe9NBrOUTA0WQDYlMGL 4sncwQw5Bfi16SzTEdPYojsTAEvWVzdSBrN6ZS9wARZ1IYBMKdxnOStAjhH06ZGIvsy8 mmyTLMuHxnOydobB5edeZtcSANmrj+oIZ/NMdd3FvqTRkcgrfx2Sx776VhftxrAHvAp1 va5fcgAIjgDJgwvrdY6wAxe18864tjkDlnUIvJh1WYO58Fu436W3dJJT2fvAAgKTfb92 ONgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=7/cXxlTtTr+3Evdb2+aKYcKTo02nxSTd8hjJW9ioZ8M=; b=ey6DHXnbXco7Vx7XkAPlrXfqB/rrrnesMzuYJ6buyqxRcUlftJTO4/8lDcNqloOXml txVe3CyUNlDTkPu9ZCKcTw28UDLwL6xiJoDBpSIWNfizpysaozLnIcb6LYeoN5TBqwld gjPBj83GMpAQWsrIeRJun23DpUQR7ZGP1BOBwBuWutPqr1OPj780f7549UhVZQeE5Jx+ J5WMZykd93eS5cuxtQ9C9hndioEDVjB4LmzIko0reByTLIn7+quWQvfh8Remqq0n+ivV YlSM5BzMTyzBPBKpu2C/PiQOXJOASI7WmglFx8AN/RLWVA0F2pdMVranAXTUmCqjQcSo Ej5g== X-Gm-Message-State: AIVw113YwqaHT0oKFh0zx7jWUoOB+Hqa1vghBmnFWpzgQlVAfuF/v2ZU OGsylZFyLGYJexBJ X-Received: by 10.36.19.5 with SMTP id 5mr13469368itz.65.1501038463442; Tue, 25 Jul 2017 20:07:43 -0700 (PDT) Received: from ala-d2121-lx1.wrs.com (unknown-156-139.windriver.com. [147.11.156.139]) by smtp.gmail.com with ESMTPSA id n4sm7703502ioi.33.2017.07.25.20.07.42 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Jul 2017 20:07:42 -0700 (PDT) From: Bin Meng To: Simon Glass , U-Boot Mailing List Date: Tue, 25 Jul 2017 20:12:01 -0700 Message-Id: <1501038725-20850-2-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1501038725-20850-1-git-send-email-bmeng.cn@gmail.com> References: <1501038725-20850-1-git-send-email-bmeng.cn@gmail.com> Subject: [U-Boot] [PATCH 2/6] x86: tsc: Identify Intel-specific code X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Reviewed-by: Simon Glass --- 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;