aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/cpu-imx5.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-imx/cpu-imx5.c')
-rw-r--r--arch/arm/mach-imx/cpu-imx5.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/arch/arm/mach-imx/cpu-imx5.c b/arch/arm/mach-imx/cpu-imx5.c
index d88760014ff9..d7ce72252a4e 100644
--- a/arch/arm/mach-imx/cpu-imx5.c
+++ b/arch/arm/mach-imx/cpu-imx5.c
@@ -22,7 +22,6 @@
22static int mx5_cpu_rev = -1; 22static int mx5_cpu_rev = -1;
23 23
24#define IIM_SREV 0x24 24#define IIM_SREV 0x24
25#define MX50_HW_ADADIG_DIGPROG 0xB0
26 25
27static int get_mx51_srev(void) 26static int get_mx51_srev(void)
28{ 27{
@@ -108,41 +107,3 @@ int mx53_revision(void)
108 return mx5_cpu_rev; 107 return mx5_cpu_rev;
109} 108}
110EXPORT_SYMBOL(mx53_revision); 109EXPORT_SYMBOL(mx53_revision);
111
112static int get_mx50_srev(void)
113{
114 void __iomem *anatop = ioremap(MX50_ANATOP_BASE_ADDR, SZ_8K);
115 u32 rev;
116
117 if (!anatop) {
118 mx5_cpu_rev = -EINVAL;
119 return 0;
120 }
121
122 rev = readl(anatop + MX50_HW_ADADIG_DIGPROG);
123 rev &= 0xff;
124
125 iounmap(anatop);
126 if (rev == 0x0)
127 return IMX_CHIP_REVISION_1_0;
128 else if (rev == 0x1)
129 return IMX_CHIP_REVISION_1_1;
130 return 0;
131}
132
133/*
134 * Returns:
135 * the silicon revision of the cpu
136 * -EINVAL - not a mx50
137 */
138int mx50_revision(void)
139{
140 if (!cpu_is_mx50())
141 return -EINVAL;
142
143 if (mx5_cpu_rev == -1)
144 mx5_cpu_rev = get_mx50_srev();
145
146 return mx5_cpu_rev;
147}
148EXPORT_SYMBOL(mx50_revision);