提交 e3f05a42 编写于 作者: H Hauke Mehrtens 提交者: John W. Linville

bcma: mips: explicit assign IRQ numbers

The assignment of the IRQs to the cores of the chips by iterating over
the cores is complicated and causes problems with SoC like the BCM4706
with two GMAC core where just one should get a dedicated IRQ number.
Now the code assigns the same IRQs to the cores as the code from the
Broadcom SDK does. If the SoC is not know the current assigned IRQs are
only read out and an error message is printed.
Signed-off-by: NHauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 929a03ae
...@@ -147,6 +147,22 @@ static void bcma_core_mips_set_irq(struct bcma_device *dev, unsigned int irq) ...@@ -147,6 +147,22 @@ static void bcma_core_mips_set_irq(struct bcma_device *dev, unsigned int irq)
dev->id.id, oldirq + 2, irq + 2); dev->id.id, oldirq + 2, irq + 2);
} }
static void bcma_core_mips_set_irq_name(struct bcma_bus *bus, unsigned int irq,
u16 coreid, u8 unit)
{
struct bcma_device *core;
core = bcma_find_core_unit(bus, coreid, unit);
if (!core) {
bcma_warn(bus,
"Can not find core (id: 0x%x, unit %i) for IRQ configuration.\n",
coreid, unit);
return;
}
bcma_core_mips_set_irq(core, irq);
}
static void bcma_core_mips_print_irq(struct bcma_device *dev, unsigned int irq) static void bcma_core_mips_print_irq(struct bcma_device *dev, unsigned int irq)
{ {
int i; int i;
...@@ -242,35 +258,47 @@ void bcma_core_mips_init(struct bcma_drv_mips *mcore) ...@@ -242,35 +258,47 @@ void bcma_core_mips_init(struct bcma_drv_mips *mcore)
mcore->assigned_irqs = 1; mcore->assigned_irqs = 1;
/* Assign IRQs to all cores on the bus */ switch (bus->chipinfo.id) {
list_for_each_entry(core, &bus->cores, list) { case BCMA_CHIP_ID_BCM4716:
int mips_irq; case BCMA_CHIP_ID_BCM4748:
if (core->irq) bcma_core_mips_set_irq_name(bus, 1, BCMA_CORE_80211, 0);
continue; bcma_core_mips_set_irq_name(bus, 2, BCMA_CORE_MAC_GBIT, 0);
bcma_core_mips_set_irq_name(bus, 3, BCMA_CORE_USB20_HOST, 0);
mips_irq = bcma_core_mips_irq(core); bcma_core_mips_set_irq_name(bus, 4, BCMA_CORE_PCIE, 0);
if (mips_irq > 4) bcma_core_mips_set_irq_name(bus, 0, BCMA_CORE_CHIPCOMMON, 0);
core->irq = 0; bcma_core_mips_set_irq_name(bus, 0, BCMA_CORE_I2S, 0);
else break;
core->irq = mips_irq + 2; case BCMA_CHIP_ID_BCM5356:
if (core->irq > 5) case BCMA_CHIP_ID_BCM47162:
continue; case BCMA_CHIP_ID_BCM53572:
switch (core->id.id) { bcma_core_mips_set_irq_name(bus, 1, BCMA_CORE_80211, 0);
case BCMA_CORE_PCI: bcma_core_mips_set_irq_name(bus, 2, BCMA_CORE_MAC_GBIT, 0);
case BCMA_CORE_PCIE: bcma_core_mips_set_irq_name(bus, 0, BCMA_CORE_CHIPCOMMON, 0);
case BCMA_CORE_ETHERNET: break;
case BCMA_CORE_ETHERNET_GBIT: case BCMA_CHIP_ID_BCM5357:
case BCMA_CORE_MAC_GBIT: case BCMA_CHIP_ID_BCM4749:
case BCMA_CORE_80211: bcma_core_mips_set_irq_name(bus, 1, BCMA_CORE_80211, 0);
case BCMA_CORE_USB20_HOST: bcma_core_mips_set_irq_name(bus, 2, BCMA_CORE_MAC_GBIT, 0);
/* These devices get their own IRQ line if available, bcma_core_mips_set_irq_name(bus, 3, BCMA_CORE_USB20_HOST, 0);
* the rest goes on IRQ0 bcma_core_mips_set_irq_name(bus, 0, BCMA_CORE_CHIPCOMMON, 0);
*/ bcma_core_mips_set_irq_name(bus, 0, BCMA_CORE_I2S, 0);
if (mcore->assigned_irqs <= 4) break;
bcma_core_mips_set_irq(core, case BCMA_CHIP_ID_BCM4706:
mcore->assigned_irqs++); bcma_core_mips_set_irq_name(bus, 1, BCMA_CORE_PCIE, 0);
break; bcma_core_mips_set_irq_name(bus, 2, BCMA_CORE_4706_MAC_GBIT,
0);
bcma_core_mips_set_irq_name(bus, 3, BCMA_CORE_PCIE, 1);
bcma_core_mips_set_irq_name(bus, 4, BCMA_CORE_USB20_HOST, 0);
bcma_core_mips_set_irq_name(bus, 0, BCMA_CORE_4706_CHIPCOMMON,
0);
break;
default:
list_for_each_entry(core, &bus->cores, list) {
core->irq = bcma_core_irq(core);
} }
bcma_err(bus,
"Unknown device (0x%x) found, can not configure IRQs\n",
bus->chipinfo.id);
} }
bcma_info(bus, "IRQ reconfiguration done\n"); bcma_info(bus, "IRQ reconfiguration done\n");
bcma_core_mips_dump_irq(bus); bcma_core_mips_dump_irq(bus);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册