From patchwork Tue Aug 23 13:07:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Hui X-Patchwork-Id: 3628 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 1BCE623FA2 for ; Tue, 23 Aug 2011 13:04:52 +0000 (UTC) Received: from mail-bw0-f52.google.com (mail-bw0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 04DF8A18728 for ; Tue, 23 Aug 2011 13:04:51 +0000 (UTC) Received: by bkbzs2 with SMTP id zs2so102077bkb.11 for ; Tue, 23 Aug 2011 06:04:51 -0700 (PDT) Received: by 10.204.143.130 with SMTP id v2mr1479890bku.18.1314104691619; Tue, 23 Aug 2011 06:04:51 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.204.41.75 with SMTP id n11cs209865bke; Tue, 23 Aug 2011 06:04:51 -0700 (PDT) Received: by 10.216.63.79 with SMTP id z57mr697071wec.34.1314104690792; Tue, 23 Aug 2011 06:04:50 -0700 (PDT) Received: from AM1EHSOBE002.bigfish.com (am1ehsobe002.messaging.microsoft.com [213.199.154.205]) by mx.google.com with ESMTPS id u44si398356weq.94.2011.08.23.06.04.50 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Aug 2011 06:04:50 -0700 (PDT) Received-SPF: neutral (google.com: 213.199.154.205 is neither permitted nor denied by best guess record for domain of jason.hui@linaro.org) client-ip=213.199.154.205; Authentication-Results: mx.google.com; spf=neutral (google.com: 213.199.154.205 is neither permitted nor denied by best guess record for domain of jason.hui@linaro.org) smtp.mail=jason.hui@linaro.org Received: from mail28-am1-R.bigfish.com (10.3.201.247) by AM1EHSOBE002.bigfish.com (10.3.204.22) with Microsoft SMTP Server id 14.1.225.22; Tue, 23 Aug 2011 13:04:49 +0000 Received: from mail28-am1 (localhost.localdomain [127.0.0.1]) by mail28-am1-R.bigfish.com (Postfix) with ESMTP id 1373AFE0330; Tue, 23 Aug 2011 13:04:50 +0000 (UTC) X-SpamScore: 7 X-BigFish: VS7(z1039ozzz1202hzz8275bhz2dh87h2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-DOMAIN-IP-MATCH: fail Received: from mail28-am1 (localhost.localdomain [127.0.0.1]) by mail28-am1 (MessageSwitch) id 1314104658585636_1784; Tue, 23 Aug 2011 13:04:18 +0000 (UTC) Received: from AM1EHSMHS016.bigfish.com (unknown [10.3.201.242]) by mail28-am1.bigfish.com (Postfix) with ESMTP id DE59A1098106; Tue, 23 Aug 2011 13:02:42 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by AM1EHSMHS016.bigfish.com (10.3.207.154) with Microsoft SMTP Server (TLS) id 14.1.225.22; Tue, 23 Aug 2011 13:02:38 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.323.2; Tue, 23 Aug 2011 08:02:36 -0500 Received: from r64343-desktop.ap.freescale.net (r64343-desktop.ap.freescale.net [10.192.242.36]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p7ND2Wd2022085; Tue, 23 Aug 2011 08:02:35 -0500 (CDT) From: Jason Liu To: CC: , Subject: [PATCH 1/6] ARM: imx: Introduce generic function for displaying silicon revision Date: Tue, 23 Aug 2011 21:07:39 +0800 Message-ID: <1314104864-3725-2-git-send-email-jason.hui@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1314104864-3725-1-git-send-email-jason.hui@linaro.org> References: <1314104864-3725-1-git-send-email-jason.hui@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com From: Fabio Estevam Currently each i.MX processor has its own function for displaying the silicon revision. Introduce a generic function for this purpose, so that all i.MX processors can reuse it. Signed-off-by: Fabio Estevam --- arch/arm/plat-mxc/cpu.c | 10 ++++++++++ arch/arm/plat-mxc/include/mach/common.h | 1 + 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/arch/arm/plat-mxc/cpu.c b/arch/arm/plat-mxc/cpu.c index 386e0d5..f081ef0 100644 --- a/arch/arm/plat-mxc/cpu.c +++ b/arch/arm/plat-mxc/cpu.c @@ -1,5 +1,6 @@ #include +#include unsigned int __mxc_cpu_type; EXPORT_SYMBOL(__mxc_cpu_type); @@ -9,3 +10,12 @@ void mxc_set_cpu_type(unsigned int type) __mxc_cpu_type = type; } +void imx_print_silicon_rev(const char *cpu, int srev) +{ + if (srev == IMX_CHIP_REVISION_UNKNOWN) + pr_info("CPU identified as %s, unknown revision\n", cpu); + else + pr_info("CPU identified as %s, silicon rev %d.%d\n", + cpu, (srev >> 4) & 0xf, srev & 0xf); +} +EXPORT_SYMBOL(imx_print_silicon_rev); diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h index 4e3d978..318e0da 100644 --- a/arch/arm/plat-mxc/include/mach/common.h +++ b/arch/arm/plat-mxc/include/mach/common.h @@ -72,4 +72,5 @@ extern void mxc_arch_reset_init(void __iomem *); extern void mx51_efikamx_reset(void); extern int mx53_revision(void); extern int mx53_display_revision(void); +extern void imx_print_silicon_rev(const char *cpu, int srev); #endif