diff options
author | Jonas Gorski <jogo@openwrt.org> | 2013-03-21 10:03:17 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2013-05-07 19:19:03 -0400 |
commit | 2c8aaf71b0a4738ae8cb70d9367089bdb892aea3 (patch) | |
tree | 5ed40900de84142b9c4ed3812001154538f7cdde /arch/mips/bcm63xx/cpu.c | |
parent | 13be798c57ebe5df09254832330f48c936ac39fd (diff) |
MIPS: BCM63XX: add basic BCM6362 support
Add basic support for detecting and booting the BCM6362.
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5009/
Acked-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'arch/mips/bcm63xx/cpu.c')
-rw-r--r-- | arch/mips/bcm63xx/cpu.c | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/arch/mips/bcm63xx/cpu.c b/arch/mips/bcm63xx/cpu.c index fef168d85884..79fe32df5e96 100644 --- a/arch/mips/bcm63xx/cpu.c +++ b/arch/mips/bcm63xx/cpu.c | |||
@@ -71,6 +71,15 @@ static const int bcm6358_irqs[] = { | |||
71 | 71 | ||
72 | }; | 72 | }; |
73 | 73 | ||
74 | static const unsigned long bcm6362_regs_base[] = { | ||
75 | __GEN_CPU_REGS_TABLE(6362) | ||
76 | }; | ||
77 | |||
78 | static const int bcm6362_irqs[] = { | ||
79 | __GEN_CPU_IRQ_TABLE(6362) | ||
80 | |||
81 | }; | ||
82 | |||
74 | static const unsigned long bcm6368_regs_base[] = { | 83 | static const unsigned long bcm6368_regs_base[] = { |
75 | __GEN_CPU_REGS_TABLE(6368) | 84 | __GEN_CPU_REGS_TABLE(6368) |
76 | }; | 85 | }; |
@@ -169,6 +178,42 @@ static unsigned int detect_cpu_clock(void) | |||
169 | return (16 * 1000000 * n1 * n2) / m1; | 178 | return (16 * 1000000 * n1 * n2) / m1; |
170 | } | 179 | } |
171 | 180 | ||
181 | case BCM6362_CPU_ID: | ||
182 | { | ||
183 | unsigned int tmp, mips_pll_fcvo; | ||
184 | |||
185 | tmp = bcm_misc_readl(MISC_STRAPBUS_6362_REG); | ||
186 | mips_pll_fcvo = (tmp & STRAPBUS_6362_FCVO_MASK) | ||
187 | >> STRAPBUS_6362_FCVO_SHIFT; | ||
188 | switch (mips_pll_fcvo) { | ||
189 | case 0x03: | ||
190 | case 0x0b: | ||
191 | case 0x13: | ||
192 | case 0x1b: | ||
193 | return 240000000; | ||
194 | case 0x04: | ||
195 | case 0x0c: | ||
196 | case 0x14: | ||
197 | case 0x1c: | ||
198 | return 160000000; | ||
199 | case 0x05: | ||
200 | case 0x0e: | ||
201 | case 0x16: | ||
202 | case 0x1e: | ||
203 | case 0x1f: | ||
204 | return 400000000; | ||
205 | case 0x06: | ||
206 | return 440000000; | ||
207 | case 0x07: | ||
208 | case 0x17: | ||
209 | return 384000000; | ||
210 | case 0x15: | ||
211 | case 0x1d: | ||
212 | return 200000000; | ||
213 | default: | ||
214 | return 320000000; | ||
215 | } | ||
216 | } | ||
172 | case BCM6368_CPU_ID: | 217 | case BCM6368_CPU_ID: |
173 | { | 218 | { |
174 | unsigned int tmp, p1, p2, ndiv, m1; | 219 | unsigned int tmp, p1, p2, ndiv, m1; |
@@ -205,7 +250,7 @@ static unsigned int detect_memory_size(void) | |||
205 | unsigned int cols = 0, rows = 0, is_32bits = 0, banks = 0; | 250 | unsigned int cols = 0, rows = 0, is_32bits = 0, banks = 0; |
206 | u32 val; | 251 | u32 val; |
207 | 252 | ||
208 | if (BCMCPU_IS_6328()) | 253 | if (BCMCPU_IS_6328() || BCMCPU_IS_6362()) |
209 | return bcm_ddr_readl(DDR_CSEND_REG) << 24; | 254 | return bcm_ddr_readl(DDR_CSEND_REG) << 24; |
210 | 255 | ||
211 | if (BCMCPU_IS_6345()) { | 256 | if (BCMCPU_IS_6345()) { |
@@ -297,6 +342,10 @@ void __init bcm63xx_cpu_init(void) | |||
297 | bcm63xx_regs_base = bcm6358_regs_base; | 342 | bcm63xx_regs_base = bcm6358_regs_base; |
298 | bcm63xx_irqs = bcm6358_irqs; | 343 | bcm63xx_irqs = bcm6358_irqs; |
299 | break; | 344 | break; |
345 | case BCM6362_CPU_ID: | ||
346 | bcm63xx_regs_base = bcm6362_regs_base; | ||
347 | bcm63xx_irqs = bcm6362_irqs; | ||
348 | break; | ||
300 | case BCM6368_CPU_ID: | 349 | case BCM6368_CPU_ID: |
301 | bcm63xx_regs_base = bcm6368_regs_base; | 350 | bcm63xx_regs_base = bcm6368_regs_base; |
302 | bcm63xx_irqs = bcm6368_irqs; | 351 | bcm63xx_irqs = bcm6368_irqs; |