Skip to content

Commit d841146

Browse files
juhosgralfbaechle
authored andcommitted
MIPS: ath79: add SoC detection code for AR934X
Also add 'soc_is_ar934[124x]' helper functions and a Kconfig symbol for the AR934X SoCs. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Cc: linux-mips@linux-mips.org Cc: mcgrof@infradead.org Patchwork: https://patchwork.linux-mips.org/patch/3506/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 80a7ed8 commit d841146

4 files changed

Lines changed: 49 additions & 1 deletion

File tree

‎arch/mips/ath79/Kconfig‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ config SOC_AR933X
6969
select USB_ARCH_HAS_EHCI
7070
def_bool n
7171

72+
config SOC_AR934X
73+
select USB_ARCH_HAS_EHCI
74+
def_bool n
75+
7276
config ATH79_DEV_GPIO_BUTTONS
7377
def_bool n
7478

‎arch/mips/ath79/setup.c‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/*
22
* Atheros AR71XX/AR724X/AR913X specific setup
33
*
4+
* Copyright (C) 2010-2011 Jaiganesh Narayanan <jnarayanan@atheros.com>
45
* Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
56
* Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
67
*
7-
* Parts of this file are based on Atheros' 2.6.15 BSP
8+
* Parts of this file are based on Atheros' 2.6.15/2.6.31 BSP
89
*
910
* This program is free software; you can redistribute it and/or modify it
1011
* under the terms of the GNU General Public License version 2 as published
@@ -145,6 +146,24 @@ static void __init ath79_detect_sys_type(void)
145146
rev = id & AR933X_REV_ID_REVISION_MASK;
146147
break;
147148

149+
case REV_ID_MAJOR_AR9341:
150+
ath79_soc = ATH79_SOC_AR9341;
151+
chip = "9341";
152+
rev = id & AR934X_REV_ID_REVISION_MASK;
153+
break;
154+
155+
case REV_ID_MAJOR_AR9342:
156+
ath79_soc = ATH79_SOC_AR9342;
157+
chip = "9342";
158+
rev = id & AR934X_REV_ID_REVISION_MASK;
159+
break;
160+
161+
case REV_ID_MAJOR_AR9344:
162+
ath79_soc = ATH79_SOC_AR9344;
163+
chip = "9344";
164+
rev = id & AR934X_REV_ID_REVISION_MASK;
165+
break;
166+
148167
default:
149168
panic("ath79: unknown SoC, id:0x%08x", id);
150169
}

‎arch/mips/include/asm/mach-ath79/ar71xx_regs.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@
271271

272272
#define AR724X_REV_ID_REVISION_MASK 0x3
273273

274+
#define AR934X_REV_ID_REVISION_MASK 0xf
275+
274276
/*
275277
* SPI block
276278
*/

‎arch/mips/include/asm/mach-ath79/ath79.h‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ enum ath79_soc_type {
2929
ATH79_SOC_AR9132,
3030
ATH79_SOC_AR9330,
3131
ATH79_SOC_AR9331,
32+
ATH79_SOC_AR9341,
33+
ATH79_SOC_AR9342,
34+
ATH79_SOC_AR9344,
3235
};
3336

3437
extern enum ath79_soc_type ath79_soc;
@@ -75,6 +78,26 @@ static inline int soc_is_ar933x(void)
7578
ath79_soc == ATH79_SOC_AR9331);
7679
}
7780

81+
static inline int soc_is_ar9341(void)
82+
{
83+
return (ath79_soc == ATH79_SOC_AR9341);
84+
}
85+
86+
static inline int soc_is_ar9342(void)
87+
{
88+
return (ath79_soc == ATH79_SOC_AR9342);
89+
}
90+
91+
static inline int soc_is_ar9344(void)
92+
{
93+
return (ath79_soc == ATH79_SOC_AR9344);
94+
}
95+
96+
static inline int soc_is_ar934x(void)
97+
{
98+
return soc_is_ar9341() || soc_is_ar9342() || soc_is_ar9344();
99+
}
100+
78101
extern void __iomem *ath79_ddr_base;
79102
extern void __iomem *ath79_pll_base;
80103
extern void __iomem *ath79_reset_base;

0 commit comments

Comments
 (0)