imx6: add initial 3.13 support
[openwrt.git] / target / linux / imx6 / patches-3.12 / 0003-ARM-imx-add-soc-revision-helper-functions.patch
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
5
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.
9
10 Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
11 ---
12  arch/arm/mach-imx/common.h |  2 ++
13  arch/arm/mach-imx/cpu.c    | 12 ++++++++++++
14  2 files changed, 14 insertions(+)
15
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);
24  
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
29 @@ -8,11 +8,23 @@
30  unsigned int __mxc_cpu_type;
31  EXPORT_SYMBOL(__mxc_cpu_type);
32  
33 +static unsigned int imx_soc_revision;
34 +
35  void mxc_set_cpu_type(unsigned int type)
36  {
37         __mxc_cpu_type = type;
38  }
39  
40 +void imx_set_soc_revision(unsigned int rev)
41 +{
42 +       imx_soc_revision = rev;
43 +}
44 +
45 +unsigned int imx_get_soc_revision(void)
46 +{
47 +       return imx_soc_revision;
48 +}
49 +
50  void imx_print_silicon_rev(const char *cpu, int srev)
51  {
52         if (srev == IMX_CHIP_REVISION_UNKNOWN)