Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Broadcom specific AMBA |
| 3 | * Broadcom MIPS32 74K core driver |
| 4 | * |
| 5 | * Copyright 2009, Broadcom Corporation |
| 6 | * Copyright 2006, 2007, Michael Buesch <mb@bu3sch.de> |
| 7 | * Copyright 2010, Bernhard Loos <bernhardloos@googlemail.com> |
| 8 | * Copyright 2011, Hauke Mehrtens <hauke@hauke-m.de> |
| 9 | * |
| 10 | * Licensed under the GNU/GPL. See COPYING for details. |
| 11 | */ |
| 12 | |
| 13 | #include "bcma_private.h" |
| 14 | |
| 15 | #include <linux/bcma/bcma.h> |
| 16 | |
| 17 | #include <linux/serial.h> |
| 18 | #include <linux/serial_core.h> |
| 19 | #include <linux/serial_reg.h> |
| 20 | #include <linux/time.h> |
Rafał Miłecki | 7177efc | 2014-10-28 13:30:23 +0100 | [diff] [blame] | 21 | #ifdef CONFIG_BCM47XX |
Rafał Miłecki | 138173d | 2014-12-01 07:58:18 +0100 | [diff] [blame] | 22 | #include <linux/bcm47xx_nvram.h> |
Rafał Miłecki | 7177efc | 2014-10-28 13:30:23 +0100 | [diff] [blame] | 23 | #endif |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 24 | |
Rafał Miłecki | 87fed55 | 2014-09-03 10:35:13 +0200 | [diff] [blame] | 25 | enum bcma_boot_dev { |
| 26 | BCMA_BOOT_DEV_UNK = 0, |
| 27 | BCMA_BOOT_DEV_ROM, |
| 28 | BCMA_BOOT_DEV_PARALLEL, |
| 29 | BCMA_BOOT_DEV_SERIAL, |
| 30 | BCMA_BOOT_DEV_NAND, |
| 31 | }; |
| 32 | |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 33 | /* The 47162a0 hangs when reading MIPS DMP registers registers */ |
| 34 | static inline bool bcma_core_mips_bcm47162a0_quirk(struct bcma_device *dev) |
| 35 | { |
Hauke Mehrtens | 4b4f5be | 2012-06-30 01:44:38 +0200 | [diff] [blame] | 36 | return dev->bus->chipinfo.id == BCMA_CHIP_ID_BCM47162 && |
| 37 | dev->bus->chipinfo.rev == 0 && dev->id.id == BCMA_CORE_MIPS_74K; |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | /* The 5357b0 hangs when reading USB20H DMP registers */ |
| 41 | static inline bool bcma_core_mips_bcm5357b0_quirk(struct bcma_device *dev) |
| 42 | { |
Hauke Mehrtens | 4b4f5be | 2012-06-30 01:44:38 +0200 | [diff] [blame] | 43 | return (dev->bus->chipinfo.id == BCMA_CHIP_ID_BCM5357 || |
| 44 | dev->bus->chipinfo.id == BCMA_CHIP_ID_BCM4749) && |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 45 | dev->bus->chipinfo.pkg == 11 && |
| 46 | dev->id.id == BCMA_CORE_USB20_HOST; |
| 47 | } |
| 48 | |
| 49 | static inline u32 mips_read32(struct bcma_drv_mips *mcore, |
| 50 | u16 offset) |
| 51 | { |
| 52 | return bcma_read32(mcore->core, offset); |
| 53 | } |
| 54 | |
| 55 | static inline void mips_write32(struct bcma_drv_mips *mcore, |
| 56 | u16 offset, |
| 57 | u32 value) |
| 58 | { |
| 59 | bcma_write32(mcore->core, offset, value); |
| 60 | } |
| 61 | |
| 62 | static const u32 ipsflag_irq_mask[] = { |
| 63 | 0, |
| 64 | BCMA_MIPS_IPSFLAG_IRQ1, |
| 65 | BCMA_MIPS_IPSFLAG_IRQ2, |
| 66 | BCMA_MIPS_IPSFLAG_IRQ3, |
| 67 | BCMA_MIPS_IPSFLAG_IRQ4, |
| 68 | }; |
| 69 | |
| 70 | static const u32 ipsflag_irq_shift[] = { |
| 71 | 0, |
| 72 | BCMA_MIPS_IPSFLAG_IRQ1_SHIFT, |
| 73 | BCMA_MIPS_IPSFLAG_IRQ2_SHIFT, |
| 74 | BCMA_MIPS_IPSFLAG_IRQ3_SHIFT, |
| 75 | BCMA_MIPS_IPSFLAG_IRQ4_SHIFT, |
| 76 | }; |
| 77 | |
| 78 | static u32 bcma_core_mips_irqflag(struct bcma_device *dev) |
| 79 | { |
| 80 | u32 flag; |
| 81 | |
| 82 | if (bcma_core_mips_bcm47162a0_quirk(dev)) |
| 83 | return dev->core_index; |
| 84 | if (bcma_core_mips_bcm5357b0_quirk(dev)) |
| 85 | return dev->core_index; |
| 86 | flag = bcma_aread32(dev, BCMA_MIPS_OOBSELOUTA30); |
| 87 | |
Hauke Mehrtens | db5230d | 2013-01-04 00:51:23 +0100 | [diff] [blame] | 88 | if (flag) |
| 89 | return flag & 0x1F; |
| 90 | else |
| 91 | return 0x3f; |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | /* Get the MIPS IRQ assignment for a specified device. |
| 95 | * If unassigned, 0 is returned. |
Hauke Mehrtens | db5230d | 2013-01-04 00:51:23 +0100 | [diff] [blame] | 96 | * If disabled, 5 is returned. |
| 97 | * If not supported, 6 is returned. |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 98 | */ |
Hauke Mehrtens | 85eb92e | 2014-11-01 16:54:55 +0100 | [diff] [blame] | 99 | unsigned int bcma_core_mips_irq(struct bcma_device *dev) |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 100 | { |
| 101 | struct bcma_device *mdev = dev->bus->drv_mips.core; |
| 102 | u32 irqflag; |
| 103 | unsigned int irq; |
| 104 | |
| 105 | irqflag = bcma_core_mips_irqflag(dev); |
Hauke Mehrtens | db5230d | 2013-01-04 00:51:23 +0100 | [diff] [blame] | 106 | if (irqflag == 0x3f) |
| 107 | return 6; |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 108 | |
Hauke Mehrtens | db5230d | 2013-01-04 00:51:23 +0100 | [diff] [blame] | 109 | for (irq = 0; irq <= 4; irq++) |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 110 | if (bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(irq)) & |
| 111 | (1 << irqflag)) |
| 112 | return irq; |
| 113 | |
Hauke Mehrtens | db5230d | 2013-01-04 00:51:23 +0100 | [diff] [blame] | 114 | return 5; |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 115 | } |
Nathan Hintz | e2aa19f | 2013-01-10 17:54:09 +0100 | [diff] [blame] | 116 | |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 117 | static void bcma_core_mips_set_irq(struct bcma_device *dev, unsigned int irq) |
| 118 | { |
| 119 | unsigned int oldirq = bcma_core_mips_irq(dev); |
| 120 | struct bcma_bus *bus = dev->bus; |
| 121 | struct bcma_device *mdev = bus->drv_mips.core; |
| 122 | u32 irqflag; |
| 123 | |
| 124 | irqflag = bcma_core_mips_irqflag(dev); |
| 125 | BUG_ON(oldirq == 6); |
| 126 | |
| 127 | dev->irq = irq + 2; |
| 128 | |
| 129 | /* clear the old irq */ |
| 130 | if (oldirq == 0) |
| 131 | bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0), |
| 132 | bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0)) & |
| 133 | ~(1 << irqflag)); |
Hauke Mehrtens | db5230d | 2013-01-04 00:51:23 +0100 | [diff] [blame] | 134 | else if (oldirq != 5) |
Rafał Miłecki | cbbc013 | 2012-12-10 07:53:56 +0100 | [diff] [blame] | 135 | bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(oldirq), 0); |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 136 | |
| 137 | /* assign the new one */ |
| 138 | if (irq == 0) { |
| 139 | bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0), |
| 140 | bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0)) | |
| 141 | (1 << irqflag)); |
| 142 | } else { |
Hauke Mehrtens | 6ba1eaf | 2013-01-04 00:51:25 +0100 | [diff] [blame] | 143 | u32 irqinitmask = bcma_read32(mdev, |
| 144 | BCMA_MIPS_MIPS74K_INTMASK(irq)); |
| 145 | if (irqinitmask) { |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 146 | struct bcma_device *core; |
| 147 | |
| 148 | /* backplane irq line is in use, find out who uses |
| 149 | * it and set user to irq 0 |
| 150 | */ |
Hauke Mehrtens | d8f1bd2 | 2012-07-26 17:44:12 +0200 | [diff] [blame] | 151 | list_for_each_entry(core, &bus->cores, list) { |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 152 | if ((1 << bcma_core_mips_irqflag(core)) == |
Hauke Mehrtens | 6ba1eaf | 2013-01-04 00:51:25 +0100 | [diff] [blame] | 153 | irqinitmask) { |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 154 | bcma_core_mips_set_irq(core, 0); |
| 155 | break; |
| 156 | } |
| 157 | } |
| 158 | } |
| 159 | bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(irq), |
| 160 | 1 << irqflag); |
| 161 | } |
| 162 | |
Hauke Mehrtens | 7401cb6 | 2013-01-04 00:51:22 +0100 | [diff] [blame] | 163 | bcma_debug(bus, "set_irq: core 0x%04x, irq %d => %d\n", |
Hauke Mehrtens | db5230d | 2013-01-04 00:51:23 +0100 | [diff] [blame] | 164 | dev->id.id, oldirq <= 4 ? oldirq + 2 : 0, irq + 2); |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 165 | } |
| 166 | |
Hauke Mehrtens | e3f05a4 | 2013-01-04 00:51:21 +0100 | [diff] [blame] | 167 | static void bcma_core_mips_set_irq_name(struct bcma_bus *bus, unsigned int irq, |
| 168 | u16 coreid, u8 unit) |
| 169 | { |
| 170 | struct bcma_device *core; |
| 171 | |
| 172 | core = bcma_find_core_unit(bus, coreid, unit); |
| 173 | if (!core) { |
| 174 | bcma_warn(bus, |
| 175 | "Can not find core (id: 0x%x, unit %i) for IRQ configuration.\n", |
| 176 | coreid, unit); |
| 177 | return; |
| 178 | } |
| 179 | |
| 180 | bcma_core_mips_set_irq(core, irq); |
| 181 | } |
| 182 | |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 183 | static void bcma_core_mips_print_irq(struct bcma_device *dev, unsigned int irq) |
| 184 | { |
| 185 | int i; |
| 186 | static const char *irq_name[] = {"2(S)", "3", "4", "5", "6", "D", "I"}; |
Hauke Mehrtens | 7401cb6 | 2013-01-04 00:51:22 +0100 | [diff] [blame] | 187 | printk(KERN_DEBUG KBUILD_MODNAME ": core 0x%04x, irq :", dev->id.id); |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 188 | for (i = 0; i <= 6; i++) |
| 189 | printk(" %s%s", irq_name[i], i == irq ? "*" : " "); |
| 190 | printk("\n"); |
| 191 | } |
| 192 | |
| 193 | static void bcma_core_mips_dump_irq(struct bcma_bus *bus) |
| 194 | { |
| 195 | struct bcma_device *core; |
| 196 | |
Hauke Mehrtens | d8f1bd2 | 2012-07-26 17:44:12 +0200 | [diff] [blame] | 197 | list_for_each_entry(core, &bus->cores, list) { |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 198 | bcma_core_mips_print_irq(core, bcma_core_mips_irq(core)); |
| 199 | } |
| 200 | } |
| 201 | |
Hauke Mehrtens | 908debc | 2011-07-23 01:20:11 +0200 | [diff] [blame] | 202 | u32 bcma_cpu_clock(struct bcma_drv_mips *mcore) |
| 203 | { |
| 204 | struct bcma_bus *bus = mcore->core->bus; |
| 205 | |
| 206 | if (bus->drv_cc.capabilities & BCMA_CC_CAP_PMU) |
Rafał Miłecki | 5b5ac41 | 2012-12-07 12:56:56 +0100 | [diff] [blame] | 207 | return bcma_pmu_get_cpu_clock(&bus->drv_cc); |
Hauke Mehrtens | 908debc | 2011-07-23 01:20:11 +0200 | [diff] [blame] | 208 | |
Rafał Miłecki | 3d9d8af | 2012-07-05 22:07:32 +0200 | [diff] [blame] | 209 | bcma_err(bus, "No PMU available, need this to get the cpu clock\n"); |
Hauke Mehrtens | 908debc | 2011-07-23 01:20:11 +0200 | [diff] [blame] | 210 | return 0; |
| 211 | } |
| 212 | EXPORT_SYMBOL(bcma_cpu_clock); |
| 213 | |
Rafał Miłecki | 87fed55 | 2014-09-03 10:35:13 +0200 | [diff] [blame] | 214 | static enum bcma_boot_dev bcma_boot_dev(struct bcma_bus *bus) |
| 215 | { |
| 216 | struct bcma_drv_cc *cc = &bus->drv_cc; |
| 217 | u8 cc_rev = cc->core->id.rev; |
| 218 | |
| 219 | if (cc_rev == 42) { |
| 220 | struct bcma_device *core; |
| 221 | |
| 222 | core = bcma_find_core(bus, BCMA_CORE_NS_ROM); |
| 223 | if (core) { |
| 224 | switch (bcma_aread32(core, BCMA_IOST) & |
| 225 | BCMA_NS_ROM_IOST_BOOT_DEV_MASK) { |
| 226 | case BCMA_NS_ROM_IOST_BOOT_DEV_NOR: |
| 227 | return BCMA_BOOT_DEV_SERIAL; |
| 228 | case BCMA_NS_ROM_IOST_BOOT_DEV_NAND: |
| 229 | return BCMA_BOOT_DEV_NAND; |
| 230 | case BCMA_NS_ROM_IOST_BOOT_DEV_ROM: |
| 231 | default: |
| 232 | return BCMA_BOOT_DEV_ROM; |
| 233 | } |
| 234 | } |
| 235 | } else { |
| 236 | if (cc_rev == 38) { |
| 237 | if (cc->status & BCMA_CC_CHIPST_5357_NAND_BOOT) |
| 238 | return BCMA_BOOT_DEV_NAND; |
| 239 | else if (cc->status & BIT(5)) |
| 240 | return BCMA_BOOT_DEV_ROM; |
| 241 | } |
| 242 | |
| 243 | if ((cc->capabilities & BCMA_CC_CAP_FLASHT) == |
| 244 | BCMA_CC_FLASHT_PARA) |
| 245 | return BCMA_BOOT_DEV_PARALLEL; |
| 246 | else |
| 247 | return BCMA_BOOT_DEV_SERIAL; |
| 248 | } |
| 249 | |
| 250 | return BCMA_BOOT_DEV_SERIAL; |
| 251 | } |
| 252 | |
Rafał Miłecki | 0ea6f0c | 2016-02-12 10:15:45 +0100 | [diff] [blame] | 253 | static void bcma_core_mips_nvram_init(struct bcma_drv_mips *mcore) |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 254 | { |
| 255 | struct bcma_bus *bus = mcore->core->bus; |
Rafał Miłecki | 87fed55 | 2014-09-03 10:35:13 +0200 | [diff] [blame] | 256 | enum bcma_boot_dev boot_dev; |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 257 | |
Rafał Miłecki | 87fed55 | 2014-09-03 10:35:13 +0200 | [diff] [blame] | 258 | /* Determine flash type this SoC boots from */ |
| 259 | boot_dev = bcma_boot_dev(bus); |
| 260 | switch (boot_dev) { |
| 261 | case BCMA_BOOT_DEV_PARALLEL: |
| 262 | case BCMA_BOOT_DEV_SERIAL: |
Rafał Miłecki | 7177efc | 2014-10-28 13:30:23 +0100 | [diff] [blame] | 263 | #ifdef CONFIG_BCM47XX |
| 264 | bcm47xx_nvram_init_from_mem(BCMA_SOC_FLASH2, |
| 265 | BCMA_SOC_FLASH2_SZ); |
| 266 | #endif |
Rafał Miłecki | 87fed55 | 2014-09-03 10:35:13 +0200 | [diff] [blame] | 267 | break; |
| 268 | case BCMA_BOOT_DEV_NAND: |
Rafał Miłecki | 7177efc | 2014-10-28 13:30:23 +0100 | [diff] [blame] | 269 | #ifdef CONFIG_BCM47XX |
| 270 | bcm47xx_nvram_init_from_mem(BCMA_SOC_FLASH1, |
| 271 | BCMA_SOC_FLASH1_SZ); |
| 272 | #endif |
Rafał Miłecki | 87fed55 | 2014-09-03 10:35:13 +0200 | [diff] [blame] | 273 | break; |
| 274 | default: |
| 275 | break; |
| 276 | } |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 277 | } |
| 278 | |
Hauke Mehrtens | 49655bb | 2012-09-29 20:29:49 +0200 | [diff] [blame] | 279 | void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) |
| 280 | { |
Hauke Mehrtens | 49655bb | 2012-09-29 20:29:49 +0200 | [diff] [blame] | 281 | if (mcore->early_setup_done) |
| 282 | return; |
| 283 | |
Rafał Miłecki | 0ea6f0c | 2016-02-12 10:15:45 +0100 | [diff] [blame] | 284 | bcma_core_mips_nvram_init(mcore); |
Hauke Mehrtens | 49655bb | 2012-09-29 20:29:49 +0200 | [diff] [blame] | 285 | |
| 286 | mcore->early_setup_done = true; |
| 287 | } |
| 288 | |
Nathan Hintz | 6bf2e54 | 2013-01-11 22:07:22 -0800 | [diff] [blame] | 289 | static void bcma_fix_i2s_irqflag(struct bcma_bus *bus) |
| 290 | { |
| 291 | struct bcma_device *cpu, *pcie, *i2s; |
| 292 | |
| 293 | /* Fixup the interrupts in 4716/4748 for i2s core (2010 Broadcom SDK) |
| 294 | * (IRQ flags > 7 are ignored when setting the interrupt masks) |
| 295 | */ |
| 296 | if (bus->chipinfo.id != BCMA_CHIP_ID_BCM4716 && |
| 297 | bus->chipinfo.id != BCMA_CHIP_ID_BCM4748) |
| 298 | return; |
| 299 | |
| 300 | cpu = bcma_find_core(bus, BCMA_CORE_MIPS_74K); |
| 301 | pcie = bcma_find_core(bus, BCMA_CORE_PCIE); |
| 302 | i2s = bcma_find_core(bus, BCMA_CORE_I2S); |
| 303 | if (cpu && pcie && i2s && |
| 304 | bcma_aread32(cpu, BCMA_MIPS_OOBSELINA74) == 0x08060504 && |
| 305 | bcma_aread32(pcie, BCMA_MIPS_OOBSELINA74) == 0x08060504 && |
| 306 | bcma_aread32(i2s, BCMA_MIPS_OOBSELOUTA30) == 0x88) { |
| 307 | bcma_awrite32(cpu, BCMA_MIPS_OOBSELINA74, 0x07060504); |
| 308 | bcma_awrite32(pcie, BCMA_MIPS_OOBSELINA74, 0x07060504); |
| 309 | bcma_awrite32(i2s, BCMA_MIPS_OOBSELOUTA30, 0x87); |
| 310 | bcma_debug(bus, |
| 311 | "Moved i2s interrupt to oob line 7 instead of 8\n"); |
| 312 | } |
| 313 | } |
| 314 | |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 315 | void bcma_core_mips_init(struct bcma_drv_mips *mcore) |
| 316 | { |
| 317 | struct bcma_bus *bus; |
| 318 | struct bcma_device *core; |
| 319 | bus = mcore->core->bus; |
| 320 | |
Hauke Mehrtens | 49655bb | 2012-09-29 20:29:49 +0200 | [diff] [blame] | 321 | if (mcore->setup_done) |
| 322 | return; |
| 323 | |
Hauke Mehrtens | 7401cb6 | 2013-01-04 00:51:22 +0100 | [diff] [blame] | 324 | bcma_debug(bus, "Initializing MIPS core...\n"); |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 325 | |
Hauke Mehrtens | 49655bb | 2012-09-29 20:29:49 +0200 | [diff] [blame] | 326 | bcma_core_mips_early_init(mcore); |
| 327 | |
Nathan Hintz | 6bf2e54 | 2013-01-11 22:07:22 -0800 | [diff] [blame] | 328 | bcma_fix_i2s_irqflag(bus); |
| 329 | |
Hauke Mehrtens | e3f05a4 | 2013-01-04 00:51:21 +0100 | [diff] [blame] | 330 | switch (bus->chipinfo.id) { |
| 331 | case BCMA_CHIP_ID_BCM4716: |
| 332 | case BCMA_CHIP_ID_BCM4748: |
| 333 | bcma_core_mips_set_irq_name(bus, 1, BCMA_CORE_80211, 0); |
| 334 | bcma_core_mips_set_irq_name(bus, 2, BCMA_CORE_MAC_GBIT, 0); |
| 335 | bcma_core_mips_set_irq_name(bus, 3, BCMA_CORE_USB20_HOST, 0); |
| 336 | bcma_core_mips_set_irq_name(bus, 4, BCMA_CORE_PCIE, 0); |
| 337 | bcma_core_mips_set_irq_name(bus, 0, BCMA_CORE_CHIPCOMMON, 0); |
| 338 | bcma_core_mips_set_irq_name(bus, 0, BCMA_CORE_I2S, 0); |
| 339 | break; |
| 340 | case BCMA_CHIP_ID_BCM5356: |
| 341 | case BCMA_CHIP_ID_BCM47162: |
| 342 | case BCMA_CHIP_ID_BCM53572: |
| 343 | bcma_core_mips_set_irq_name(bus, 1, BCMA_CORE_80211, 0); |
| 344 | bcma_core_mips_set_irq_name(bus, 2, BCMA_CORE_MAC_GBIT, 0); |
| 345 | bcma_core_mips_set_irq_name(bus, 0, BCMA_CORE_CHIPCOMMON, 0); |
| 346 | break; |
| 347 | case BCMA_CHIP_ID_BCM5357: |
| 348 | case BCMA_CHIP_ID_BCM4749: |
| 349 | bcma_core_mips_set_irq_name(bus, 1, BCMA_CORE_80211, 0); |
| 350 | bcma_core_mips_set_irq_name(bus, 2, BCMA_CORE_MAC_GBIT, 0); |
| 351 | bcma_core_mips_set_irq_name(bus, 3, BCMA_CORE_USB20_HOST, 0); |
| 352 | bcma_core_mips_set_irq_name(bus, 0, BCMA_CORE_CHIPCOMMON, 0); |
| 353 | bcma_core_mips_set_irq_name(bus, 0, BCMA_CORE_I2S, 0); |
| 354 | break; |
| 355 | case BCMA_CHIP_ID_BCM4706: |
| 356 | bcma_core_mips_set_irq_name(bus, 1, BCMA_CORE_PCIE, 0); |
| 357 | bcma_core_mips_set_irq_name(bus, 2, BCMA_CORE_4706_MAC_GBIT, |
| 358 | 0); |
| 359 | bcma_core_mips_set_irq_name(bus, 3, BCMA_CORE_PCIE, 1); |
| 360 | bcma_core_mips_set_irq_name(bus, 4, BCMA_CORE_USB20_HOST, 0); |
| 361 | bcma_core_mips_set_irq_name(bus, 0, BCMA_CORE_4706_CHIPCOMMON, |
| 362 | 0); |
| 363 | break; |
| 364 | default: |
| 365 | list_for_each_entry(core, &bus->cores, list) { |
Hauke Mehrtens | 85eb92e | 2014-11-01 16:54:55 +0100 | [diff] [blame] | 366 | core->irq = bcma_core_irq(core, 0); |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 367 | } |
Hauke Mehrtens | e3f05a4 | 2013-01-04 00:51:21 +0100 | [diff] [blame] | 368 | bcma_err(bus, |
| 369 | "Unknown device (0x%x) found, can not configure IRQs\n", |
| 370 | bus->chipinfo.id); |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 371 | } |
Hauke Mehrtens | 7401cb6 | 2013-01-04 00:51:22 +0100 | [diff] [blame] | 372 | bcma_debug(bus, "IRQ reconfiguration done\n"); |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 373 | bcma_core_mips_dump_irq(bus); |
| 374 | |
Hauke Mehrtens | 21e0534 | 2011-07-23 01:20:09 +0200 | [diff] [blame] | 375 | mcore->setup_done = true; |
| 376 | } |