diff options
author | John Crispin <blogic@openwrt.org> | 2014-07-27 04:23:36 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-11-24 01:45:24 -0500 |
commit | 1dc5c2cfc17ec0522eab33913a73726413420410 (patch) | |
tree | 1d57889e4b86cd4f1f3ff7bdaed7341cafc50a3a | |
parent | a097b13c52a3607123d9c65534b7befe493c6d84 (diff) |
MIPS: ralink: add support for MT7620n
This is the small version of MT7620a.
Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/8030/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/include/asm/mach-ralink/mt7620.h | 7 | ||||
-rw-r--r-- | arch/mips/ralink/mt7620.c | 20 |
2 files changed, 15 insertions, 12 deletions
diff --git a/arch/mips/include/asm/mach-ralink/mt7620.h b/arch/mips/include/asm/mach-ralink/mt7620.h index a05c14c23155..863aea5dcf0c 100644 --- a/arch/mips/include/asm/mach-ralink/mt7620.h +++ b/arch/mips/include/asm/mach-ralink/mt7620.h | |||
@@ -25,11 +25,8 @@ | |||
25 | #define SYSC_REG_CPLL_CONFIG0 0x54 | 25 | #define SYSC_REG_CPLL_CONFIG0 0x54 |
26 | #define SYSC_REG_CPLL_CONFIG1 0x58 | 26 | #define SYSC_REG_CPLL_CONFIG1 0x58 |
27 | 27 | ||
28 | #define MT7620N_CHIP_NAME0 0x33365452 | 28 | #define MT7620_CHIP_NAME0 0x3637544d |
29 | #define MT7620N_CHIP_NAME1 0x20203235 | 29 | #define MT7620_CHIP_NAME1 0x20203032 |
30 | |||
31 | #define MT7620A_CHIP_NAME0 0x3637544d | ||
32 | #define MT7620A_CHIP_NAME1 0x20203032 | ||
33 | 30 | ||
34 | #define SYSCFG0_XTAL_FREQ_SEL BIT(6) | 31 | #define SYSCFG0_XTAL_FREQ_SEL BIT(6) |
35 | 32 | ||
diff --git a/arch/mips/ralink/mt7620.c b/arch/mips/ralink/mt7620.c index 24fb40a441ca..e4b1f8251de1 100644 --- a/arch/mips/ralink/mt7620.c +++ b/arch/mips/ralink/mt7620.c | |||
@@ -277,6 +277,7 @@ void __init ralink_clk_init(void) | |||
277 | ralink_clk_add("10000500.uart", periph_rate); | 277 | ralink_clk_add("10000500.uart", periph_rate); |
278 | ralink_clk_add("10000b00.spi", sys_rate); | 278 | ralink_clk_add("10000b00.spi", sys_rate); |
279 | ralink_clk_add("10000c00.uartlite", periph_rate); | 279 | ralink_clk_add("10000c00.uartlite", periph_rate); |
280 | ralink_clk_add("10180000.wmac", xtal_rate); | ||
280 | } | 281 | } |
281 | 282 | ||
282 | void __init ralink_of_remap(void) | 283 | void __init ralink_of_remap(void) |
@@ -298,22 +299,27 @@ void prom_soc_init(struct ralink_soc_info *soc_info) | |||
298 | u32 cfg0; | 299 | u32 cfg0; |
299 | u32 pmu0; | 300 | u32 pmu0; |
300 | u32 pmu1; | 301 | u32 pmu1; |
302 | u32 bga; | ||
301 | 303 | ||
302 | n0 = __raw_readl(sysc + SYSC_REG_CHIP_NAME0); | 304 | n0 = __raw_readl(sysc + SYSC_REG_CHIP_NAME0); |
303 | n1 = __raw_readl(sysc + SYSC_REG_CHIP_NAME1); | 305 | n1 = __raw_readl(sysc + SYSC_REG_CHIP_NAME1); |
306 | rev = __raw_readl(sysc + SYSC_REG_CHIP_REV); | ||
307 | bga = (rev >> CHIP_REV_PKG_SHIFT) & CHIP_REV_PKG_MASK; | ||
304 | 308 | ||
305 | if (n0 == MT7620N_CHIP_NAME0 && n1 == MT7620N_CHIP_NAME1) { | 309 | if (n0 != MT7620_CHIP_NAME0 || n1 != MT7620_CHIP_NAME1) |
306 | name = "MT7620N"; | 310 | panic("mt7620: unknown SoC, n0:%08x n1:%08x\n", n0, n1); |
307 | soc_info->compatible = "ralink,mt7620n-soc"; | 311 | |
308 | } else if (n0 == MT7620A_CHIP_NAME0 && n1 == MT7620A_CHIP_NAME1) { | 312 | if (bga) { |
309 | name = "MT7620A"; | 313 | name = "MT7620A"; |
310 | soc_info->compatible = "ralink,mt7620a-soc"; | 314 | soc_info->compatible = "ralink,mt7620a-soc"; |
311 | } else { | 315 | } else { |
312 | panic("mt7620: unknown SoC, n0:%08x n1:%08x", n0, n1); | 316 | name = "MT7620N"; |
317 | soc_info->compatible = "ralink,mt7620n-soc"; | ||
318 | #ifdef CONFIG_PCI | ||
319 | panic("mt7620n is only supported for non pci kernels"); | ||
320 | #endif | ||
313 | } | 321 | } |
314 | 322 | ||
315 | rev = __raw_readl(sysc + SYSC_REG_CHIP_REV); | ||
316 | |||
317 | snprintf(soc_info->sys_type, RAMIPS_SYS_TYPE_LEN, | 323 | snprintf(soc_info->sys_type, RAMIPS_SYS_TYPE_LEN, |
318 | "Ralink %s ver:%u eco:%u", | 324 | "Ralink %s ver:%u eco:%u", |
319 | name, | 325 | name, |