aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bcma
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2013-01-03 18:51:23 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-01-07 15:18:28 -0500
commitdb5230d1b3c5f7c62564de2ef07ea1c633548959 (patch)
tree321466ce514db44f57614ddabd9e09c83c6f8af8 /drivers/bcma
parent7401cb63d00994dbdfdc2916b949b22e27475436 (diff)
bcma: mips: show also disabled IRQs
Some cores do not have a IRQ assigned and some do not support when an IRQ is assigned to them, this is now handled and printed out in the code. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma')
-rw-r--r--drivers/bcma/driver_mips.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/bcma/driver_mips.c b/drivers/bcma/driver_mips.c
index 486aa2dba581..69815079a6dd 100644
--- a/drivers/bcma/driver_mips.c
+++ b/drivers/bcma/driver_mips.c
@@ -74,11 +74,16 @@ static u32 bcma_core_mips_irqflag(struct bcma_device *dev)
74 return dev->core_index; 74 return dev->core_index;
75 flag = bcma_aread32(dev, BCMA_MIPS_OOBSELOUTA30); 75 flag = bcma_aread32(dev, BCMA_MIPS_OOBSELOUTA30);
76 76
77 return flag & 0x1F; 77 if (flag)
78 return flag & 0x1F;
79 else
80 return 0x3f;
78} 81}
79 82
80/* Get the MIPS IRQ assignment for a specified device. 83/* Get the MIPS IRQ assignment for a specified device.
81 * If unassigned, 0 is returned. 84 * If unassigned, 0 is returned.
85 * If disabled, 5 is returned.
86 * If not supported, 6 is returned.
82 */ 87 */
83unsigned int bcma_core_mips_irq(struct bcma_device *dev) 88unsigned int bcma_core_mips_irq(struct bcma_device *dev)
84{ 89{
@@ -87,13 +92,15 @@ unsigned int bcma_core_mips_irq(struct bcma_device *dev)
87 unsigned int irq; 92 unsigned int irq;
88 93
89 irqflag = bcma_core_mips_irqflag(dev); 94 irqflag = bcma_core_mips_irqflag(dev);
95 if (irqflag == 0x3f)
96 return 6;
90 97
91 for (irq = 1; irq <= 4; irq++) 98 for (irq = 0; irq <= 4; irq++)
92 if (bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(irq)) & 99 if (bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(irq)) &
93 (1 << irqflag)) 100 (1 << irqflag))
94 return irq; 101 return irq;
95 102
96 return 0; 103 return 5;
97} 104}
98EXPORT_SYMBOL(bcma_core_mips_irq); 105EXPORT_SYMBOL(bcma_core_mips_irq);
99 106
@@ -114,7 +121,7 @@ static void bcma_core_mips_set_irq(struct bcma_device *dev, unsigned int irq)
114 bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0), 121 bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0),
115 bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0)) & 122 bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0)) &
116 ~(1 << irqflag)); 123 ~(1 << irqflag));
117 else 124 else if (oldirq != 5)
118 bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(oldirq), 0); 125 bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(oldirq), 0);
119 126
120 /* assign the new one */ 127 /* assign the new one */
@@ -144,7 +151,7 @@ static void bcma_core_mips_set_irq(struct bcma_device *dev, unsigned int irq)
144 } 151 }
145 152
146 bcma_debug(bus, "set_irq: core 0x%04x, irq %d => %d\n", 153 bcma_debug(bus, "set_irq: core 0x%04x, irq %d => %d\n",
147 dev->id.id, oldirq + 2, irq + 2); 154 dev->id.id, oldirq <= 4 ? oldirq + 2 : 0, irq + 2);
148} 155}
149 156
150static void bcma_core_mips_set_irq_name(struct bcma_bus *bus, unsigned int irq, 157static void bcma_core_mips_set_irq_name(struct bcma_bus *bus, unsigned int irq,