1 From 9c19e86a7eccf8efd159ba213290830164f33a71 Mon Sep 17 00:00:00 2001
2 From: Gabor Juhos <juhosg@openwrt.org>
3 Date: Sun, 11 Dec 2011 17:36:42 +0100
4 Subject: [PATCH 23/35] MIPS: ath79: add SoC detection code for AR934X
6 Also add 'soc_is_ar934[124x]' helper functions and a Kconfig
7 symbol for the AR934X SoCs.
9 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
10 Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
12 arch/mips/ath79/Kconfig | 4 ++++
13 arch/mips/ath79/setup.c | 21 ++++++++++++++++++++-
14 arch/mips/include/asm/mach-ath79/ar71xx_regs.h | 2 ++
15 arch/mips/include/asm/mach-ath79/ath79.h | 23 +++++++++++++++++++++++
16 4 files changed, 49 insertions(+), 1 deletions(-)
18 --- a/arch/mips/ath79/Kconfig
19 +++ b/arch/mips/ath79/Kconfig
20 @@ -69,6 +69,10 @@ config SOC_AR933X
21 select USB_ARCH_HAS_EHCI
25 + select USB_ARCH_HAS_EHCI
28 config ATH79_DEV_GPIO_BUTTONS
31 --- a/arch/mips/ath79/setup.c
32 +++ b/arch/mips/ath79/setup.c
35 * Atheros AR71XX/AR724X/AR913X specific setup
37 + * Copyright (C) 2010-2011 Jaiganesh Narayanan <jnarayanan@atheros.com>
38 * Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
39 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
41 - * Parts of this file are based on Atheros' 2.6.15 BSP
42 + * Parts of this file are based on Atheros' 2.6.15/2.6.31 BSP
44 * This program is free software; you can redistribute it and/or modify it
45 * under the terms of the GNU General Public License version 2 as published
46 @@ -145,6 +146,24 @@ static void __init ath79_detect_sys_type
47 rev = id & AR933X_REV_ID_REVISION_MASK;
50 + case REV_ID_MAJOR_AR9341:
51 + ath79_soc = ATH79_SOC_AR9341;
53 + rev = id & AR934X_REV_ID_REVISION_MASK;
56 + case REV_ID_MAJOR_AR9342:
57 + ath79_soc = ATH79_SOC_AR9342;
59 + rev = id & AR934X_REV_ID_REVISION_MASK;
62 + case REV_ID_MAJOR_AR9344:
63 + ath79_soc = ATH79_SOC_AR9344;
65 + rev = id & AR934X_REV_ID_REVISION_MASK;
69 panic("ath79: unknown SoC, id:0x%08x\n", id);
71 --- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
72 +++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
75 #define AR724X_REV_ID_REVISION_MASK 0x3
77 +#define AR934X_REV_ID_REVISION_MASK 0xf
82 --- a/arch/mips/include/asm/mach-ath79/ath79.h
83 +++ b/arch/mips/include/asm/mach-ath79/ath79.h
84 @@ -29,6 +29,9 @@ enum ath79_soc_type {
93 extern enum ath79_soc_type ath79_soc;
94 @@ -75,6 +78,26 @@ static inline int soc_is_ar933x(void)
95 ath79_soc == ATH79_SOC_AR9331);
98 +static inline int soc_is_ar9341(void)
100 + return (ath79_soc == ATH79_SOC_AR9341);
103 +static inline int soc_is_ar9342(void)
105 + return (ath79_soc == ATH79_SOC_AR9342);
108 +static inline int soc_is_ar9344(void)
110 + return (ath79_soc == ATH79_SOC_AR9344);
113 +static inline int soc_is_ar934x(void)
115 + return soc_is_ar9341() || soc_is_ar9342() || soc_is_ar9344();
118 extern void __iomem *ath79_ddr_base;
119 extern void __iomem *ath79_pll_base;
120 extern void __iomem *ath79_reset_base;