aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/bcm63xx
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2012-10-05 09:56:28 -0400
committerRalf Baechle <ralf@linux-mips.org>2012-10-05 09:56:28 -0400
commit382fc33b4a04e2dde89b4c69a6880e0c7d9761e2 (patch)
tree9d13ef333c4e841756c45bf29600ceac28e3f85e /arch/mips/bcm63xx
parent97541ccfb9db2bb9cd1dde6344d5834438d14bda (diff)
parent986936d7c2f83427bb3bf1e629eba4373438e151 (diff)
Merge branch 'master' of git://dev.phrozen.org/mips-next into mips-for-linux-next
Diffstat (limited to 'arch/mips/bcm63xx')
-rw-r--r--arch/mips/bcm63xx/irq.c22
-rw-r--r--arch/mips/bcm63xx/setup.c6
2 files changed, 23 insertions, 5 deletions
diff --git a/arch/mips/bcm63xx/irq.c b/arch/mips/bcm63xx/irq.c
index 18e051ad18a5..da24c2bd9b7c 100644
--- a/arch/mips/bcm63xx/irq.c
+++ b/arch/mips/bcm63xx/irq.c
@@ -56,8 +56,8 @@ static void __internal_irq_unmask_64(unsigned int irq) __maybe_unused;
56#define is_ext_irq_cascaded 0 56#define is_ext_irq_cascaded 0
57#define ext_irq_start 0 57#define ext_irq_start 0
58#define ext_irq_end 0 58#define ext_irq_end 0
59#define ext_irq_count 0 59#define ext_irq_count 4
60#define ext_irq_cfg_reg1 0 60#define ext_irq_cfg_reg1 PERF_EXTIRQ_CFG_REG_6345
61#define ext_irq_cfg_reg2 0 61#define ext_irq_cfg_reg2 0
62#endif 62#endif
63#ifdef CONFIG_BCM63XX_CPU_6348 63#ifdef CONFIG_BCM63XX_CPU_6348
@@ -143,11 +143,15 @@ static void bcm63xx_init_irq(void)
143 irq_stat_addr += PERF_IRQSTAT_6338_REG; 143 irq_stat_addr += PERF_IRQSTAT_6338_REG;
144 irq_mask_addr += PERF_IRQMASK_6338_REG; 144 irq_mask_addr += PERF_IRQMASK_6338_REG;
145 irq_bits = 32; 145 irq_bits = 32;
146 ext_irq_count = 4;
147 ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_6338;
146 break; 148 break;
147 case BCM6345_CPU_ID: 149 case BCM6345_CPU_ID:
148 irq_stat_addr += PERF_IRQSTAT_6345_REG; 150 irq_stat_addr += PERF_IRQSTAT_6345_REG;
149 irq_mask_addr += PERF_IRQMASK_6345_REG; 151 irq_mask_addr += PERF_IRQMASK_6345_REG;
150 irq_bits = 32; 152 irq_bits = 32;
153 ext_irq_count = 4;
154 ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_6345;
151 break; 155 break;
152 case BCM6348_CPU_ID: 156 case BCM6348_CPU_ID:
153 irq_stat_addr += PERF_IRQSTAT_6348_REG; 157 irq_stat_addr += PERF_IRQSTAT_6348_REG;
@@ -434,7 +438,8 @@ static int bcm63xx_external_irq_set_type(struct irq_data *d,
434 reg = bcm_perf_readl(regaddr); 438 reg = bcm_perf_readl(regaddr);
435 irq %= 4; 439 irq %= 4;
436 440
437 if (BCMCPU_IS_6348()) { 441 switch (bcm63xx_get_cpu_id()) {
442 case BCM6348_CPU_ID:
438 if (levelsense) 443 if (levelsense)
439 reg |= EXTIRQ_CFG_LEVELSENSE_6348(irq); 444 reg |= EXTIRQ_CFG_LEVELSENSE_6348(irq);
440 else 445 else
@@ -447,9 +452,13 @@ static int bcm63xx_external_irq_set_type(struct irq_data *d,
447 reg |= EXTIRQ_CFG_BOTHEDGE_6348(irq); 452 reg |= EXTIRQ_CFG_BOTHEDGE_6348(irq);
448 else 453 else
449 reg &= ~EXTIRQ_CFG_BOTHEDGE_6348(irq); 454 reg &= ~EXTIRQ_CFG_BOTHEDGE_6348(irq);
450 } 455 break;
451 456
452 if (BCMCPU_IS_6338() || BCMCPU_IS_6358() || BCMCPU_IS_6368()) { 457 case BCM6328_CPU_ID:
458 case BCM6338_CPU_ID:
459 case BCM6345_CPU_ID:
460 case BCM6358_CPU_ID:
461 case BCM6368_CPU_ID:
453 if (levelsense) 462 if (levelsense)
454 reg |= EXTIRQ_CFG_LEVELSENSE(irq); 463 reg |= EXTIRQ_CFG_LEVELSENSE(irq);
455 else 464 else
@@ -462,6 +471,9 @@ static int bcm63xx_external_irq_set_type(struct irq_data *d,
462 reg |= EXTIRQ_CFG_BOTHEDGE(irq); 471 reg |= EXTIRQ_CFG_BOTHEDGE(irq);
463 else 472 else
464 reg &= ~EXTIRQ_CFG_BOTHEDGE(irq); 473 reg &= ~EXTIRQ_CFG_BOTHEDGE(irq);
474 break;
475 default:
476 BUG();
465 } 477 }
466 478
467 bcm_perf_writel(reg, regaddr); 479 bcm_perf_writel(reg, regaddr);
diff --git a/arch/mips/bcm63xx/setup.c b/arch/mips/bcm63xx/setup.c
index 0e74a13639cd..314231be788c 100644
--- a/arch/mips/bcm63xx/setup.c
+++ b/arch/mips/bcm63xx/setup.c
@@ -74,6 +74,9 @@ void bcm63xx_machine_reboot(void)
74 case BCM6338_CPU_ID: 74 case BCM6338_CPU_ID:
75 perf_regs[0] = PERF_EXTIRQ_CFG_REG_6338; 75 perf_regs[0] = PERF_EXTIRQ_CFG_REG_6338;
76 break; 76 break;
77 case BCM6345_CPU_ID:
78 perf_regs[0] = PERF_EXTIRQ_CFG_REG_6345;
79 break;
77 case BCM6348_CPU_ID: 80 case BCM6348_CPU_ID:
78 perf_regs[0] = PERF_EXTIRQ_CFG_REG_6348; 81 perf_regs[0] = PERF_EXTIRQ_CFG_REG_6348;
79 break; 82 break;
@@ -83,6 +86,9 @@ void bcm63xx_machine_reboot(void)
83 } 86 }
84 87
85 for (i = 0; i < 2; i++) { 88 for (i = 0; i < 2; i++) {
89 if (!perf_regs[i])
90 break;
91
86 reg = bcm_perf_readl(perf_regs[i]); 92 reg = bcm_perf_readl(perf_regs[i]);
87 if (BCMCPU_IS_6348()) { 93 if (BCMCPU_IS_6348()) {
88 reg &= ~EXTIRQ_CFG_MASK_ALL_6348; 94 reg &= ~EXTIRQ_CFG_MASK_ALL_6348;