From patchwork Fri Aug 26 05:35:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Hui X-Patchwork-Id: 3703 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 715E423F41 for ; Fri, 26 Aug 2011 05:30:14 +0000 (UTC) Received: from mail-gw0-f52.google.com (mail-gw0-f52.google.com [74.125.83.52]) by fiordland.canonical.com (Postfix) with ESMTP id 3E88DA1853F for ; Fri, 26 Aug 2011 05:30:14 +0000 (UTC) Received: by gwj15 with SMTP id 15so3494548gwj.11 for ; Thu, 25 Aug 2011 22:30:13 -0700 (PDT) Received: by 10.150.98.4 with SMTP id v4mr1159327ybb.326.1314336613618; Thu, 25 Aug 2011 22:30:13 -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.151.27.20 with SMTP id e20cs269326ybj; Thu, 25 Aug 2011 22:30:13 -0700 (PDT) Received: by 10.52.76.169 with SMTP id l9mr667906vdw.35.1314336613168; Thu, 25 Aug 2011 22:30:13 -0700 (PDT) Received: from ch1outboundpool.messaging.microsoft.com (ch1ehsobe005.messaging.microsoft.com [216.32.181.185]) by mx.google.com with ESMTPS id f6si3472842vdi.75.2011.08.25.22.30.11 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 25 Aug 2011 22:30:12 -0700 (PDT) Received-SPF: neutral (google.com: 216.32.181.185 is neither permitted nor denied by best guess record for domain of jason.hui@linaro.org) client-ip=216.32.181.185; Authentication-Results: mx.google.com; spf=neutral (google.com: 216.32.181.185 is neither permitted nor denied by best guess record for domain of jason.hui@linaro.org) smtp.mail=jason.hui@linaro.org Received: from mail168-ch1-R.bigfish.com (216.32.181.173) by CH1EHSOBE015.bigfish.com (10.43.70.65) with Microsoft SMTP Server id 14.1.225.22; Fri, 26 Aug 2011 05:30:11 +0000 Received: from mail168-ch1 (localhost.localdomain [127.0.0.1]) by mail168-ch1-R.bigfish.com (Postfix) with ESMTP id 6C2FFF38452; Fri, 26 Aug 2011 05:30:11 +0000 (UTC) X-SpamScore: 7 X-BigFish: VS7(z1039ozzz1202hzz8275bh8275dhz2dh87h2a8h668h839h62h) X-Spam-TCS-SCL: 1: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 mail168-ch1 (localhost.localdomain [127.0.0.1]) by mail168-ch1 (MessageSwitch) id 131433661195020_24877; Fri, 26 Aug 2011 05:30:11 +0000 (UTC) Received: from CH1EHSMHS035.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.243]) by mail168-ch1.bigfish.com (Postfix) with ESMTP id 1298B13E004C; Fri, 26 Aug 2011 05:30:11 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS035.bigfish.com (10.43.70.35) with Microsoft SMTP Server (TLS) id 14.1.225.22; Fri, 26 Aug 2011 05:30:09 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.323.2; Fri, 26 Aug 2011 00:30:08 -0500 Received: from r64343-desktop.ap.freescale.net (r64343-desktop.ap.freescale.net [10.192.242.36]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p7Q5U4oW001702; Fri, 26 Aug 2011 00:30:07 -0500 (CDT) From: Jason Liu To: CC: , Subject: [[PATCH v3 1/6] ARM: imx: Introduce generic function for displaying silicon revision Date: Fri, 26 Aug 2011 13:35:18 +0800 Message-ID: <1314336923-25162-2-git-send-email-jason.hui@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1314336923-25162-1-git-send-email-jason.hui@linaro.org> References: <1314336923-25162-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 Signed-off-by: Jason Liu Cc: Sascha Hauer --- V2: remove EXPORT_SYMBOL --- arch/arm/plat-mxc/cpu.c | 9 +++++++++ arch/arm/plat-mxc/include/mach/common.h | 1 + 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/arch/arm/plat-mxc/cpu.c b/arch/arm/plat-mxc/cpu.c index 386e0d5..f5b7e0f 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,11 @@ 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); +} 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