From patchwork Wed Aug 24 05:04:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Hui X-Patchwork-Id: 3637 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 DA86423FA2 for ; Wed, 24 Aug 2011 04:59:48 +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 C4800A183CE for ; Wed, 24 Aug 2011 04:59:48 +0000 (UTC) Received: by mail-bw0-f52.google.com with SMTP id zs2so991010bkb.11 for ; Tue, 23 Aug 2011 21:59:48 -0700 (PDT) Received: by 10.204.133.215 with SMTP id g23mr2069939bkt.70.1314161988494; Tue, 23 Aug 2011 21:59:48 -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 n11cs630bke; Tue, 23 Aug 2011 21:59:48 -0700 (PDT) Received: by 10.229.233.74 with SMTP id jx10mr3281633qcb.262.1314161987577; Tue, 23 Aug 2011 21:59:47 -0700 (PDT) Received: from ch1outboundpool.messaging.microsoft.com (ch1ehsobe001.messaging.microsoft.com [216.32.181.181]) by mx.google.com with ESMTPS id b12si385651qcu.40.2011.08.23.21.59.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Aug 2011 21:59:47 -0700 (PDT) Received-SPF: neutral (google.com: 216.32.181.181 is neither permitted nor denied by best guess record for domain of jason.hui@linaro.org) client-ip=216.32.181.181; Authentication-Results: mx.google.com; spf=neutral (google.com: 216.32.181.181 is neither permitted nor denied by best guess record for domain of jason.hui@linaro.org) smtp.mail=jason.hui@linaro.org Received: from mail109-ch1-R.bigfish.com (216.32.181.171) by CH1EHSOBE010.bigfish.com (10.43.70.60) with Microsoft SMTP Server id 14.1.225.22; Wed, 24 Aug 2011 04:59:46 +0000 Received: from mail109-ch1 (localhost.localdomain [127.0.0.1]) by mail109-ch1-R.bigfish.com (Postfix) with ESMTP id AE1AF2803C5; Wed, 24 Aug 2011 04:59:46 +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 mail109-ch1 (localhost.localdomain [127.0.0.1]) by mail109-ch1 (MessageSwitch) id 1314161986399099_24539; Wed, 24 Aug 2011 04:59:46 +0000 (UTC) Received: from CH1EHSMHS013.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.252]) by mail109-ch1.bigfish.com (Postfix) with ESMTP id 5BDF29E004B; Wed, 24 Aug 2011 04:59:46 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS013.bigfish.com (10.43.70.13) with Microsoft SMTP Server (TLS) id 14.1.225.22; Wed, 24 Aug 2011 04:59:41 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.323.2; Tue, 23 Aug 2011 23:59:28 -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 p7O4xOa8004658; Tue, 23 Aug 2011 23:59:26 -0500 (CDT) From: Jason Liu To: CC: , Subject: [[PATCH v2 1/6] ARM: imx: Introduce generic function for displaying silicon revision Date: Wed, 24 Aug 2011 13:04:32 +0800 Message-ID: <1314162277-2840-2-git-send-email-jason.hui@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1314162277-2840-1-git-send-email-jason.hui@linaro.org> References: <1314162277-2840-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