aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/bcm63xx/cpu.c
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2013-06-18 12:55:40 -0400
committerRalf Baechle <ralf@linux-mips.org>2013-07-01 09:10:53 -0400
commit7b9334215f53135fb9cbdf0b44833cbc8e7d57b2 (patch)
treebe404d8c6355d162e5a8c9042cbf93d4c6861147 /arch/mips/bcm63xx/cpu.c
parentae8de61c726f4f2c4b1b4d8263c9c71b82503e0d (diff)
MIPS: BCM63XX: add support for BCM3368 Cable Modem
The Broadcom BCM3368 Cable Modem SoC is extremely similar to the existing BCM63xx DSL SoCs, in particular BCM6358, therefore little effort in the existing code base is required to get it supported. This patch adds support for the following on-chip peripherals: - two UARTS - GPIO - Ethernet - SPI - PCI - NOR Flash The most noticeable difference with 3368 is that it has its peripheral register at 0xfff8_0000 we check that separately in ioremap.h. Since 3368 is identical to 6358 for its clock and reset bits, we use them verbatim. Signed-off-by: Florian Fainelli <florian@openwrt.org> Cc: linux-mips@linux-mips.org Cc: cernekee@gmail.com Cc: jogo@openwrt.org Patchwork: https://patchwork.linux-mips.org/patch/5499/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/bcm63xx/cpu.c')
-rw-r--r--arch/mips/bcm63xx/cpu.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/arch/mips/bcm63xx/cpu.c b/arch/mips/bcm63xx/cpu.c
index 79fe32df5e96..7e17374a9ae8 100644
--- a/arch/mips/bcm63xx/cpu.c
+++ b/arch/mips/bcm63xx/cpu.c
@@ -29,6 +29,14 @@ static u8 bcm63xx_cpu_rev;
29static unsigned int bcm63xx_cpu_freq; 29static unsigned int bcm63xx_cpu_freq;
30static unsigned int bcm63xx_memory_size; 30static unsigned int bcm63xx_memory_size;
31 31
32static const unsigned long bcm3368_regs_base[] = {
33 __GEN_CPU_REGS_TABLE(3368)
34};
35
36static const int bcm3368_irqs[] = {
37 __GEN_CPU_IRQ_TABLE(3368)
38};
39
32static const unsigned long bcm6328_regs_base[] = { 40static const unsigned long bcm6328_regs_base[] = {
33 __GEN_CPU_REGS_TABLE(6328) 41 __GEN_CPU_REGS_TABLE(6328)
34}; 42};
@@ -116,6 +124,9 @@ unsigned int bcm63xx_get_memory_size(void)
116static unsigned int detect_cpu_clock(void) 124static unsigned int detect_cpu_clock(void)
117{ 125{
118 switch (bcm63xx_get_cpu_id()) { 126 switch (bcm63xx_get_cpu_id()) {
127 case BCM3368_CPU_ID:
128 return 300000000;
129
119 case BCM6328_CPU_ID: 130 case BCM6328_CPU_ID:
120 { 131 {
121 unsigned int tmp, mips_pll_fcvo; 132 unsigned int tmp, mips_pll_fcvo;
@@ -266,7 +277,7 @@ static unsigned int detect_memory_size(void)
266 banks = (val & SDRAM_CFG_BANK_MASK) ? 2 : 1; 277 banks = (val & SDRAM_CFG_BANK_MASK) ? 2 : 1;
267 } 278 }
268 279
269 if (BCMCPU_IS_6358() || BCMCPU_IS_6368()) { 280 if (BCMCPU_IS_3368() || BCMCPU_IS_6358() || BCMCPU_IS_6368()) {
270 val = bcm_memc_readl(MEMC_CFG_REG); 281 val = bcm_memc_readl(MEMC_CFG_REG);
271 rows = (val & MEMC_CFG_ROW_MASK) >> MEMC_CFG_ROW_SHIFT; 282 rows = (val & MEMC_CFG_ROW_MASK) >> MEMC_CFG_ROW_SHIFT;
272 cols = (val & MEMC_CFG_COL_MASK) >> MEMC_CFG_COL_SHIFT; 283 cols = (val & MEMC_CFG_COL_MASK) >> MEMC_CFG_COL_SHIFT;
@@ -302,10 +313,17 @@ void __init bcm63xx_cpu_init(void)
302 chipid_reg = BCM_6345_PERF_BASE; 313 chipid_reg = BCM_6345_PERF_BASE;
303 break; 314 break;
304 case CPU_BMIPS4350: 315 case CPU_BMIPS4350:
305 if ((read_c0_prid() & 0xf0) == 0x10) 316 switch ((read_c0_prid() & 0xff)) {
317 case 0x04:
318 chipid_reg = BCM_3368_PERF_BASE;
319 break;
320 case 0x10:
306 chipid_reg = BCM_6345_PERF_BASE; 321 chipid_reg = BCM_6345_PERF_BASE;
307 else 322 break;
323 default:
308 chipid_reg = BCM_6368_PERF_BASE; 324 chipid_reg = BCM_6368_PERF_BASE;
325 break;
326 }
309 break; 327 break;
310 } 328 }
311 329
@@ -322,6 +340,10 @@ void __init bcm63xx_cpu_init(void)
322 bcm63xx_cpu_rev = (tmp & REV_REVID_MASK) >> REV_REVID_SHIFT; 340 bcm63xx_cpu_rev = (tmp & REV_REVID_MASK) >> REV_REVID_SHIFT;
323 341
324 switch (bcm63xx_cpu_id) { 342 switch (bcm63xx_cpu_id) {
343 case BCM3368_CPU_ID:
344 bcm63xx_regs_base = bcm3368_regs_base;
345 bcm63xx_irqs = bcm3368_irqs;
346 break;
325 case BCM6328_CPU_ID: 347 case BCM6328_CPU_ID:
326 bcm63xx_regs_base = bcm6328_regs_base; 348 bcm63xx_regs_base = bcm6328_regs_base;
327 bcm63xx_irqs = bcm6328_irqs; 349 bcm63xx_irqs = bcm6328_irqs;