aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2012-10-23 07:00:39 -0400
committerShawn Guo <shawn.guo@linaro.org>2012-11-16 01:18:54 -0500
commitb29b3e6f6c5a71a48475ac5ea7015ff267d60af8 (patch)
tree11cb1a96dc42d26e39824bb783f1d73d65d521a2 /arch/arm/mach-imx
parent7b7d6727344a2a7727255d61fa1bd3ff447c4f6c (diff)
ARM: imx6q: print silicon version on boot
i.MX6Q has 3 revisions 1.0, 1.1 and 1.2. Print revision on boot. Signed-off-by: Drew Moseley <drew_moseley@mentor.com> [drew: add proper error checking for function imx6q_revision()] Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 978b6dd00de4..9511142d436c 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -38,6 +38,40 @@
38#include "cpuidle.h" 38#include "cpuidle.h"
39#include "hardware.h" 39#include "hardware.h"
40 40
41#define IMX6Q_ANALOG_DIGPROG 0x260
42
43static int imx6q_revision(void)
44{
45 struct device_node *np;
46 void __iomem *base;
47 static u32 rev;
48
49 if (!rev) {
50 np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-anatop");
51 if (!np)
52 return IMX_CHIP_REVISION_UNKNOWN;
53 base = of_iomap(np, 0);
54 if (!base) {
55 of_node_put(np);
56 return IMX_CHIP_REVISION_UNKNOWN;
57 }
58 rev = readl_relaxed(base + IMX6Q_ANALOG_DIGPROG);
59 iounmap(base);
60 of_node_put(np);
61 }
62
63 switch (rev & 0xff) {
64 case 0:
65 return IMX_CHIP_REVISION_1_0;
66 case 1:
67 return IMX_CHIP_REVISION_1_1;
68 case 2:
69 return IMX_CHIP_REVISION_1_2;
70 default:
71 return IMX_CHIP_REVISION_UNKNOWN;
72 }
73}
74
41void imx6q_restart(char mode, const char *cmd) 75void imx6q_restart(char mode, const char *cmd)
42{ 76{
43 struct device_node *np; 77 struct device_node *np;
@@ -192,6 +226,7 @@ static void __init imx6q_timer_init(void)
192{ 226{
193 mx6q_clocks_init(); 227 mx6q_clocks_init();
194 twd_local_timer_of_register(); 228 twd_local_timer_of_register();
229 imx_print_silicon_rev("i.MX6Q", imx6q_revision());
195} 230}
196 231
197static struct sys_timer imx6q_timer = { 232static struct sys_timer imx6q_timer = {