1 From bfefdff8f91aa0a9ff1291d18d54498af276a6e5 Mon Sep 17 00:00:00 2001
2 From: Shawn Guo <shawn.guo@linaro.org>
3 Date: Tue, 13 Aug 2013 13:54:02 +0800
4 Subject: [PATCH] ARM: imx: add soc revision helper functions
6 Similar to what we do for cpu type, the patch adds helper functions
7 imx_set_soc_revision() and imx_get_soc_revision() to maintain
8 imx_soc_revision in cpu.c.
10 Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
12 arch/arm/mach-imx/common.h | 2 ++
13 arch/arm/mach-imx/cpu.c | 12 ++++++++++++
14 2 files changed, 14 insertions(+)
16 --- a/arch/arm/mach-imx/common.h
17 +++ b/arch/arm/mach-imx/common.h
18 @@ -81,6 +81,8 @@ extern int imx6q_revision(void);
19 extern int mx53_display_revision(void);
20 extern void imx_set_aips(void __iomem *);
21 extern int mxc_device_init(void);
22 +void imx_set_soc_revision(unsigned int rev);
23 +unsigned int imx_get_soc_revision(void);
25 enum mxc_cpu_pwr_mode {
26 WAIT_CLOCKED, /* wfi only */
27 --- a/arch/arm/mach-imx/cpu.c
28 +++ b/arch/arm/mach-imx/cpu.c
30 unsigned int __mxc_cpu_type;
31 EXPORT_SYMBOL(__mxc_cpu_type);
33 +static unsigned int imx_soc_revision;
35 void mxc_set_cpu_type(unsigned int type)
37 __mxc_cpu_type = type;
40 +void imx_set_soc_revision(unsigned int rev)
42 + imx_soc_revision = rev;
45 +unsigned int imx_get_soc_revision(void)
47 + return imx_soc_revision;
50 void imx_print_silicon_rev(const char *cpu, int srev)
52 if (srev == IMX_CHIP_REVISION_UNKNOWN)