ar71xx: add support for TP-Link TL-MR11U
[openwrt.git] / target / linux / ar71xx / patches-3.2 / 019-MIPS-ath79-Store-the-SoC-revision-in-a-global-variab.patch
1 From d3cdd75072bc5df5b18dcafb45cbe9a3a62b840b Mon Sep 17 00:00:00 2001
2 From: Gabor Juhos <juhosg@openwrt.org>
3 Date: Fri, 18 Nov 2011 00:17:46 +0000
4 Subject: [PATCH 19/27] MIPS: ath79: Store the SoC revision in a global variable
5
6 Knowing the exact revision of the SoC is required to make runtime decisions
7 in various code paths.  We have determined the SoC revision already, so we
8 only need to store that in a global variable.
9
10 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
11 Cc: Imre Kaloz <kaloz@openwrt.org>
12 Cc: linux-mips@linux-mips.org
13 Patchwork: https://patchwork.linux-mips.org/patch/3027/
14 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 ---
16  arch/mips/ath79/common.c                 |    1 +
17  arch/mips/ath79/setup.c                  |    2 ++
18  arch/mips/include/asm/mach-ath79/ath79.h |    1 +
19  3 files changed, 4 insertions(+), 0 deletions(-)
20
21 --- a/arch/mips/ath79/common.c
22 +++ b/arch/mips/ath79/common.c
23 @@ -30,6 +30,7 @@ u32 ath79_ddr_freq;
24  EXPORT_SYMBOL_GPL(ath79_ddr_freq);
25  
26  enum ath79_soc_type ath79_soc;
27 +unsigned int ath79_soc_rev;
28  
29  void __iomem *ath79_pll_base;
30  void __iomem *ath79_reset_base;
31 --- a/arch/mips/ath79/setup.c
32 +++ b/arch/mips/ath79/setup.c
33 @@ -149,6 +149,8 @@ static void __init ath79_detect_sys_type
34                 panic("ath79: unknown SoC, id:0x%08x\n", id);
35         }
36  
37 +       ath79_soc_rev = rev;
38 +
39         sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev);
40         pr_info("SoC: %s\n", ath79_sys_type);
41  }
42 --- a/arch/mips/include/asm/mach-ath79/ath79.h
43 +++ b/arch/mips/include/asm/mach-ath79/ath79.h
44 @@ -32,6 +32,7 @@ enum ath79_soc_type {
45  };
46  
47  extern enum ath79_soc_type ath79_soc;
48 +extern unsigned int ath79_soc_rev;
49  
50  static inline int soc_is_ar71xx(void)
51  {