All of lore.kernel.org
 help / color / mirror / Atom feed
From: jason.hui@linaro.org (Jason Liu)
To: linux-arm-kernel@lists.infradead.org
Subject: [[PATCH v3 1/6] ARM: imx: Introduce generic function for displaying silicon revision
Date: Fri, 26 Aug 2011 13:35:18 +0800	[thread overview]
Message-ID: <1314336923-25162-2-git-send-email-jason.hui@linaro.org> (raw)
In-Reply-To: <1314336923-25162-1-git-send-email-jason.hui@linaro.org>

From: Fabio Estevam <fabio.estevam@freescale.com>

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 <fabio.estevam@freescale.com>
Signed-off-by: Jason Liu <jason.hui@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
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 <linux/module.h>
+#include <mach/hardware.h>
 
 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
-- 
1.7.4.1

  reply	other threads:[~2011-08-26  5:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-26  5:35 [[PATCH v3 0/6] imx soc revision clean up Jason Liu
2011-08-26  5:35 ` Jason Liu [this message]
2011-08-26  5:35 ` [[PATCH v3 2/6] ARM: mx25: Print silicon revision on boot Jason Liu
2011-08-26  5:35 ` [[PATCH v3 3/6] ARM: mx27: " Jason Liu
2011-08-26  5:35 ` [[PATCH v3 4/6] ARM: mx31: use generic function for displaying silicon revision Jason Liu
2011-08-26  5:35 ` [[PATCH v3 5/6] ARM: mx35: " Jason Liu
2011-08-26  5:35 ` [[PATCH v3 6/6] ARM: mx5: " Jason Liu
2011-08-26  8:18 ` [[PATCH v3 0/6] imx soc revision clean up Sascha Hauer

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=1314336923-25162-2-git-send-email-jason.hui@linaro.org \
    --to=jason.hui@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.