Commit db5230d1 authored by Hauke Mehrtens's avatar Hauke Mehrtens Committed by John W. Linville

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: default avatarHauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 7401cb63
...@@ -74,11 +74,16 @@ static u32 bcma_core_mips_irqflag(struct bcma_device *dev) ...@@ -74,11 +74,16 @@ static u32 bcma_core_mips_irqflag(struct bcma_device *dev)
return dev->core_index; return dev->core_index;
flag = bcma_aread32(dev, BCMA_MIPS_OOBSELOUTA30); flag = bcma_aread32(dev, BCMA_MIPS_OOBSELOUTA30);
if (flag)
return flag & 0x1F; return flag & 0x1F;
else
return 0x3f;
} }
/* Get the MIPS IRQ assignment for a specified device. /* Get the MIPS IRQ assignment for a specified device.
* If unassigned, 0 is returned. * If unassigned, 0 is returned.
* If disabled, 5 is returned.
* If not supported, 6 is returned.
*/ */
unsigned int bcma_core_mips_irq(struct bcma_device *dev) unsigned int bcma_core_mips_irq(struct bcma_device *dev)
{ {
...@@ -87,13 +92,15 @@ unsigned int bcma_core_mips_irq(struct bcma_device *dev) ...@@ -87,13 +92,15 @@ unsigned int bcma_core_mips_irq(struct bcma_device *dev)
unsigned int irq; unsigned int irq;
irqflag = bcma_core_mips_irqflag(dev); irqflag = bcma_core_mips_irqflag(dev);
if (irqflag == 0x3f)
return 6;
for (irq = 1; irq <= 4; irq++) for (irq = 0; irq <= 4; irq++)
if (bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(irq)) & if (bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(irq)) &
(1 << irqflag)) (1 << irqflag))
return irq; return irq;
return 0; return 5;
} }
EXPORT_SYMBOL(bcma_core_mips_irq); EXPORT_SYMBOL(bcma_core_mips_irq);
...@@ -114,7 +121,7 @@ static void bcma_core_mips_set_irq(struct bcma_device *dev, unsigned int irq) ...@@ -114,7 +121,7 @@ static void bcma_core_mips_set_irq(struct bcma_device *dev, unsigned int irq)
bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0), bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0),
bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0)) & bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0)) &
~(1 << irqflag)); ~(1 << irqflag));
else else if (oldirq != 5)
bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(oldirq), 0); bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(oldirq), 0);
/* assign the new one */ /* assign the new one */
...@@ -144,7 +151,7 @@ static void bcma_core_mips_set_irq(struct bcma_device *dev, unsigned int irq) ...@@ -144,7 +151,7 @@ static void bcma_core_mips_set_irq(struct bcma_device *dev, unsigned int irq)
} }
bcma_debug(bus, "set_irq: core 0x%04x, irq %d => %d\n", bcma_debug(bus, "set_irq: core 0x%04x, irq %d => %d\n",
dev->id.id, oldirq + 2, irq + 2); dev->id.id, oldirq <= 4 ? oldirq + 2 : 0, irq + 2);
} }
static void bcma_core_mips_set_irq_name(struct bcma_bus *bus, unsigned int irq, static void bcma_core_mips_set_irq_name(struct bcma_bus *bus, unsigned int irq,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment