Skip to content

Commit 2e6c91e

Browse files
juhosgJohn Crispin
authored andcommitted
MIPS: ath79: add SoC detection code for the QCA955X SoCs
Also add 'soc_is_qca955[68x]' helper functions and a Kconfig symbol for the SoC family. Cc: Rodriguez, Luis <rodrigue@qca.qualcomm.com> Cc: Giori, Kathy <kgiori@qca.qualcomm.com> Cc: QCA Linux Team <qca-linux-team@qca.qualcomm.com> Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/4943/ Signed-off-by: John Crispin <blogic@openwrt.org>
1 parent 9089877 commit 2e6c91e

4 files changed

Lines changed: 40 additions & 1 deletion

File tree

‎arch/mips/ath79/Kconfig‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ config SOC_AR934X
8888
select PCI_AR724X if PCI
8989
def_bool n
9090

91+
config SOC_QCA955X
92+
select USB_ARCH_HAS_EHCI
93+
def_bool n
94+
9195
config PCI_AR724X
9296
def_bool n
9397

‎arch/mips/ath79/setup.c‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,29 @@ static void __init ath79_detect_sys_type(void)
164164
rev = id & AR934X_REV_ID_REVISION_MASK;
165165
break;
166166

167+
case REV_ID_MAJOR_QCA9556:
168+
ath79_soc = ATH79_SOC_QCA9556;
169+
chip = "9556";
170+
rev = id & QCA955X_REV_ID_REVISION_MASK;
171+
break;
172+
173+
case REV_ID_MAJOR_QCA9558:
174+
ath79_soc = ATH79_SOC_QCA9558;
175+
chip = "9558";
176+
rev = id & QCA955X_REV_ID_REVISION_MASK;
177+
break;
178+
167179
default:
168180
panic("ath79: unknown SoC, id:0x%08x", id);
169181
}
170182

171183
ath79_soc_rev = rev;
172184

173-
sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev);
185+
if (soc_is_qca955x())
186+
sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s rev %u",
187+
chip, rev);
188+
else
189+
sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev);
174190
pr_info("SoC: %s\n", ath79_sys_type);
175191
}
176192

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

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

393393
#define AR934X_REV_ID_REVISION_MASK 0xf
394394

395+
#define QCA955X_REV_ID_REVISION_MASK 0xf
396+
395397
/*
396398
* SPI block
397399
*/

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ enum ath79_soc_type {
3232
ATH79_SOC_AR9341,
3333
ATH79_SOC_AR9342,
3434
ATH79_SOC_AR9344,
35+
ATH79_SOC_QCA9556,
36+
ATH79_SOC_QCA9558,
3537
};
3638

3739
extern enum ath79_soc_type ath79_soc;
@@ -98,6 +100,21 @@ static inline int soc_is_ar934x(void)
98100
return soc_is_ar9341() || soc_is_ar9342() || soc_is_ar9344();
99101
}
100102

103+
static inline int soc_is_qca9556(void)
104+
{
105+
return ath79_soc == ATH79_SOC_QCA9556;
106+
}
107+
108+
static inline int soc_is_qca9558(void)
109+
{
110+
return ath79_soc == ATH79_SOC_QCA9558;
111+
}
112+
113+
static inline int soc_is_qca955x(void)
114+
{
115+
return soc_is_qca9556() || soc_is_qca9558();
116+
}
117+
101118
extern void __iomem *ath79_ddr_base;
102119
extern void __iomem *ath79_pll_base;
103120
extern void __iomem *ath79_reset_base;

0 commit comments

Comments
 (0)