Commit 8d75a262 authored by Jason Liu's avatar Jason Liu Committed by Sascha Hauer

ARM: mx35: use generic function for displaying silicon revision

update to use generic function for displaying silicon revision
Signed-off-by: default avatarJason Liu <jason.hui@linaro.org>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
parent ab116a86
......@@ -537,7 +537,8 @@ int __init mx35_clocks_init()
__raw_writel(cgr3, CCM_BASE + CCM_CGR3);
clk_enable(&iim_clk);
mx35_read_cpu_rev();
imx_print_silicon_rev("i.MX35", mx35_revision());
clk_disable(&iim_clk);
#ifdef CONFIG_MXC_USE_EPIT
epit_timer_init(&epit1_clk,
......
......@@ -13,32 +13,30 @@
#include <mach/hardware.h>
#include <mach/iim.h>
unsigned int mx35_cpu_rev;
EXPORT_SYMBOL(mx35_cpu_rev);
static int mx35_cpu_rev = -1;
void __init mx35_read_cpu_rev(void)
static int mx35_read_cpu_rev(void)
{
u32 rev;
char *srev;
rev = __raw_readl(MX35_IO_ADDRESS(MX35_IIM_BASE_ADDR + MXC_IIMSREV));
switch (rev) {
case 0x00:
mx35_cpu_rev = IMX_CHIP_REVISION_1_0;
srev = "1.0";
break;
return IMX_CHIP_REVISION_1_0;
case 0x10:
mx35_cpu_rev = IMX_CHIP_REVISION_2_0;
srev = "2.0";
break;
return IMX_CHIP_REVISION_2_0;
case 0x11:
mx35_cpu_rev = IMX_CHIP_REVISION_2_1;
srev = "2.1";
break;
return IMX_CHIP_REVISION_2_1;
default:
mx35_cpu_rev = IMX_CHIP_REVISION_UNKNOWN;
srev = "unknown";
return IMX_CHIP_REVISION_UNKNOWN;
}
}
int mx35_revision(void)
{
if (mx35_cpu_rev == -1)
mx35_cpu_rev = mx35_read_cpu_rev();
printk(KERN_INFO "CPU identified as i.MX35, silicon rev %s\n", srev);
return mx35_cpu_rev;
}
EXPORT_SYMBOL(mx35_revision);
......@@ -187,14 +187,7 @@
/* Mandatory defines used globally */
#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS)
extern unsigned int mx35_cpu_rev;
extern void mx35_read_cpu_rev(void);
static inline int mx35_revision(void)
{
return mx35_cpu_rev;
}
extern int mx35_revision(void);
extern int mx31_revision(void);
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment