Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Sonics Silicon Backplane |
| 3 | * Broadcom MIPS core driver |
| 4 | * |
| 5 | * Copyright 2005, Broadcom Corporation |
Michael Büsch | eb032b9 | 2011-07-04 20:50:05 +0200 | [diff] [blame] | 6 | * Copyright 2006, 2007, Michael Buesch <m@bues.ch> |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 7 | * |
| 8 | * Licensed under the GNU/GPL. See COPYING for details. |
| 9 | */ |
| 10 | |
| 11 | #include <linux/ssb/ssb.h> |
| 12 | |
Rafał Miłecki | c7a4a9e | 2013-01-25 11:36:26 +0100 | [diff] [blame] | 13 | #include <linux/mtd/physmap.h> |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 14 | #include <linux/serial.h> |
| 15 | #include <linux/serial_core.h> |
| 16 | #include <linux/serial_reg.h> |
| 17 | #include <linux/time.h> |
Rafał Miłecki | 21400f2 | 2014-09-03 22:59:45 +0200 | [diff] [blame] | 18 | #ifdef CONFIG_BCM47XX |
Rafał Miłecki | 138173d | 2014-12-01 07:58:18 +0100 | [diff] [blame^] | 19 | #include <linux/bcm47xx_nvram.h> |
Rafał Miłecki | 21400f2 | 2014-09-03 22:59:45 +0200 | [diff] [blame] | 20 | #endif |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 21 | |
| 22 | #include "ssb_private.h" |
| 23 | |
Artem Bityutskiy | 255e9fd | 2013-03-12 10:37:29 +0200 | [diff] [blame] | 24 | static const char * const part_probes[] = { "bcm47xxpart", NULL }; |
Rafał Miłecki | c7a4a9e | 2013-01-25 11:36:26 +0100 | [diff] [blame] | 25 | |
| 26 | static struct physmap_flash_data ssb_pflash_data = { |
| 27 | .part_probe_types = part_probes, |
| 28 | }; |
| 29 | |
| 30 | static struct resource ssb_pflash_resource = { |
| 31 | .name = "ssb_pflash", |
| 32 | .flags = IORESOURCE_MEM, |
| 33 | }; |
| 34 | |
| 35 | struct platform_device ssb_pflash_dev = { |
| 36 | .name = "physmap-flash", |
| 37 | .dev = { |
| 38 | .platform_data = &ssb_pflash_data, |
| 39 | }, |
| 40 | .resource = &ssb_pflash_resource, |
| 41 | .num_resources = 1, |
| 42 | }; |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 43 | |
| 44 | static inline u32 mips_read32(struct ssb_mipscore *mcore, |
| 45 | u16 offset) |
| 46 | { |
| 47 | return ssb_read32(mcore->dev, offset); |
| 48 | } |
| 49 | |
| 50 | static inline void mips_write32(struct ssb_mipscore *mcore, |
| 51 | u16 offset, |
| 52 | u32 value) |
| 53 | { |
| 54 | ssb_write32(mcore->dev, offset, value); |
| 55 | } |
| 56 | |
| 57 | static const u32 ipsflag_irq_mask[] = { |
| 58 | 0, |
| 59 | SSB_IPSFLAG_IRQ1, |
| 60 | SSB_IPSFLAG_IRQ2, |
| 61 | SSB_IPSFLAG_IRQ3, |
| 62 | SSB_IPSFLAG_IRQ4, |
| 63 | }; |
| 64 | |
| 65 | static const u32 ipsflag_irq_shift[] = { |
| 66 | 0, |
| 67 | SSB_IPSFLAG_IRQ1_SHIFT, |
| 68 | SSB_IPSFLAG_IRQ2_SHIFT, |
| 69 | SSB_IPSFLAG_IRQ3_SHIFT, |
| 70 | SSB_IPSFLAG_IRQ4_SHIFT, |
| 71 | }; |
| 72 | |
| 73 | static inline u32 ssb_irqflag(struct ssb_device *dev) |
| 74 | { |
matthieu castet | ea4bbfd | 2009-06-30 23:04:55 +0200 | [diff] [blame] | 75 | u32 tpsflag = ssb_read32(dev, SSB_TPSFLAG); |
| 76 | if (tpsflag) |
| 77 | return ssb_read32(dev, SSB_TPSFLAG) & SSB_TPSFLAG_BPFLAG; |
| 78 | else |
| 79 | /* not irq supported */ |
| 80 | return 0x3f; |
| 81 | } |
| 82 | |
| 83 | static struct ssb_device *find_device(struct ssb_device *rdev, int irqflag) |
| 84 | { |
| 85 | struct ssb_bus *bus = rdev->bus; |
| 86 | int i; |
| 87 | for (i = 0; i < bus->nr_devices; i++) { |
| 88 | struct ssb_device *dev; |
| 89 | dev = &(bus->devices[i]); |
| 90 | if (ssb_irqflag(dev) == irqflag) |
| 91 | return dev; |
| 92 | } |
| 93 | return NULL; |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 94 | } |
| 95 | |
| 96 | /* Get the MIPS IRQ assignment for a specified device. |
| 97 | * If unassigned, 0 is returned. |
matthieu castet | ea4bbfd | 2009-06-30 23:04:55 +0200 | [diff] [blame] | 98 | * If disabled, 5 is returned. |
| 99 | * If not supported, 6 is returned. |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 100 | */ |
| 101 | unsigned int ssb_mips_irq(struct ssb_device *dev) |
| 102 | { |
| 103 | struct ssb_bus *bus = dev->bus; |
matthieu castet | ea4bbfd | 2009-06-30 23:04:55 +0200 | [diff] [blame] | 104 | struct ssb_device *mdev = bus->mipscore.dev; |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 105 | u32 irqflag; |
| 106 | u32 ipsflag; |
| 107 | u32 tmp; |
| 108 | unsigned int irq; |
| 109 | |
| 110 | irqflag = ssb_irqflag(dev); |
matthieu castet | ea4bbfd | 2009-06-30 23:04:55 +0200 | [diff] [blame] | 111 | if (irqflag == 0x3f) |
| 112 | return 6; |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 113 | ipsflag = ssb_read32(bus->mipscore.dev, SSB_IPSFLAG); |
| 114 | for (irq = 1; irq <= 4; irq++) { |
| 115 | tmp = ((ipsflag & ipsflag_irq_mask[irq]) >> ipsflag_irq_shift[irq]); |
| 116 | if (tmp == irqflag) |
| 117 | break; |
| 118 | } |
matthieu castet | ea4bbfd | 2009-06-30 23:04:55 +0200 | [diff] [blame] | 119 | if (irq == 5) { |
| 120 | if ((1 << irqflag) & ssb_read32(mdev, SSB_INTVEC)) |
| 121 | irq = 0; |
| 122 | } |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 123 | |
| 124 | return irq; |
| 125 | } |
| 126 | |
| 127 | static void clear_irq(struct ssb_bus *bus, unsigned int irq) |
| 128 | { |
| 129 | struct ssb_device *dev = bus->mipscore.dev; |
| 130 | |
| 131 | /* Clear the IRQ in the MIPScore backplane registers */ |
| 132 | if (irq == 0) { |
| 133 | ssb_write32(dev, SSB_INTVEC, 0); |
| 134 | } else { |
| 135 | ssb_write32(dev, SSB_IPSFLAG, |
| 136 | ssb_read32(dev, SSB_IPSFLAG) | |
| 137 | ipsflag_irq_mask[irq]); |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | static void set_irq(struct ssb_device *dev, unsigned int irq) |
| 142 | { |
| 143 | unsigned int oldirq = ssb_mips_irq(dev); |
| 144 | struct ssb_bus *bus = dev->bus; |
| 145 | struct ssb_device *mdev = bus->mipscore.dev; |
| 146 | u32 irqflag = ssb_irqflag(dev); |
| 147 | |
matthieu castet | ea4bbfd | 2009-06-30 23:04:55 +0200 | [diff] [blame] | 148 | BUG_ON(oldirq == 6); |
| 149 | |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 150 | dev->irq = irq + 2; |
| 151 | |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 152 | /* clear the old irq */ |
| 153 | if (oldirq == 0) |
| 154 | ssb_write32(mdev, SSB_INTVEC, (~(1 << irqflag) & ssb_read32(mdev, SSB_INTVEC))); |
matthieu castet | ea4bbfd | 2009-06-30 23:04:55 +0200 | [diff] [blame] | 155 | else if (oldirq != 5) |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 156 | clear_irq(bus, oldirq); |
| 157 | |
| 158 | /* assign the new one */ |
Michael Buesch | 2633da2 | 2008-04-08 11:17:29 +0200 | [diff] [blame] | 159 | if (irq == 0) { |
| 160 | ssb_write32(mdev, SSB_INTVEC, ((1 << irqflag) | ssb_read32(mdev, SSB_INTVEC))); |
| 161 | } else { |
matthieu castet | ea4bbfd | 2009-06-30 23:04:55 +0200 | [diff] [blame] | 162 | u32 ipsflag = ssb_read32(mdev, SSB_IPSFLAG); |
| 163 | if ((ipsflag & ipsflag_irq_mask[irq]) != ipsflag_irq_mask[irq]) { |
| 164 | u32 oldipsflag = (ipsflag & ipsflag_irq_mask[irq]) >> ipsflag_irq_shift[irq]; |
| 165 | struct ssb_device *olddev = find_device(dev, oldipsflag); |
| 166 | if (olddev) |
| 167 | set_irq(olddev, 0); |
| 168 | } |
Michael Buesch | 2633da2 | 2008-04-08 11:17:29 +0200 | [diff] [blame] | 169 | irqflag <<= ipsflag_irq_shift[irq]; |
matthieu castet | ea4bbfd | 2009-06-30 23:04:55 +0200 | [diff] [blame] | 170 | irqflag |= (ipsflag & ~ipsflag_irq_mask[irq]); |
Michael Buesch | 2633da2 | 2008-04-08 11:17:29 +0200 | [diff] [blame] | 171 | ssb_write32(mdev, SSB_IPSFLAG, irqflag); |
| 172 | } |
Joe Perches | 33a606a | 2013-02-20 12:16:13 -0800 | [diff] [blame] | 173 | ssb_dbg("set_irq: core 0x%04x, irq %d => %d\n", |
| 174 | dev->id.coreid, oldirq+2, irq+2); |
matthieu castet | ea4bbfd | 2009-06-30 23:04:55 +0200 | [diff] [blame] | 175 | } |
| 176 | |
| 177 | static void print_irq(struct ssb_device *dev, unsigned int irq) |
| 178 | { |
matthieu castet | ea4bbfd | 2009-06-30 23:04:55 +0200 | [diff] [blame] | 179 | static const char *irq_name[] = {"2(S)", "3", "4", "5", "6", "D", "I"}; |
Joe Perches | 33a606a | 2013-02-20 12:16:13 -0800 | [diff] [blame] | 180 | ssb_dbg("core 0x%04x, irq : %s%s %s%s %s%s %s%s %s%s %s%s %s%s\n", |
| 181 | dev->id.coreid, |
| 182 | irq_name[0], irq == 0 ? "*" : " ", |
| 183 | irq_name[1], irq == 1 ? "*" : " ", |
| 184 | irq_name[2], irq == 2 ? "*" : " ", |
| 185 | irq_name[3], irq == 3 ? "*" : " ", |
| 186 | irq_name[4], irq == 4 ? "*" : " ", |
| 187 | irq_name[5], irq == 5 ? "*" : " ", |
| 188 | irq_name[6], irq == 6 ? "*" : " "); |
matthieu castet | ea4bbfd | 2009-06-30 23:04:55 +0200 | [diff] [blame] | 189 | } |
| 190 | |
| 191 | static void dump_irq(struct ssb_bus *bus) |
| 192 | { |
| 193 | int i; |
| 194 | for (i = 0; i < bus->nr_devices; i++) { |
| 195 | struct ssb_device *dev; |
| 196 | dev = &(bus->devices[i]); |
| 197 | print_irq(dev, ssb_mips_irq(dev)); |
| 198 | } |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 199 | } |
| 200 | |
| 201 | static void ssb_mips_serial_init(struct ssb_mipscore *mcore) |
| 202 | { |
| 203 | struct ssb_bus *bus = mcore->dev->bus; |
| 204 | |
Hauke Mehrtens | 0362063 | 2012-11-27 00:31:55 +0100 | [diff] [blame] | 205 | if (ssb_extif_available(&bus->extif)) |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 206 | mcore->nr_serial_ports = ssb_extif_serial_init(&bus->extif, mcore->serial_ports); |
Hauke Mehrtens | 0362063 | 2012-11-27 00:31:55 +0100 | [diff] [blame] | 207 | else if (ssb_chipco_available(&bus->chipco)) |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 208 | mcore->nr_serial_ports = ssb_chipco_serial_init(&bus->chipco, mcore->serial_ports); |
| 209 | else |
| 210 | mcore->nr_serial_ports = 0; |
| 211 | } |
| 212 | |
| 213 | static void ssb_mips_flash_detect(struct ssb_mipscore *mcore) |
| 214 | { |
| 215 | struct ssb_bus *bus = mcore->dev->bus; |
Rafał Miłecki | 21400f2 | 2014-09-03 22:59:45 +0200 | [diff] [blame] | 216 | struct ssb_sflash *sflash = &mcore->sflash; |
Rafał Miłecki | f1ab57e | 2013-01-25 11:36:25 +0100 | [diff] [blame] | 217 | struct ssb_pflash *pflash = &mcore->pflash; |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 218 | |
Rafał Miłecki | 902d9e0 | 2012-08-08 19:37:04 +0200 | [diff] [blame] | 219 | /* When there is no chipcommon on the bus there is 4MB flash */ |
Hauke Mehrtens | 0362063 | 2012-11-27 00:31:55 +0100 | [diff] [blame] | 220 | if (!ssb_chipco_available(&bus->chipco)) { |
Rafał Miłecki | f1ab57e | 2013-01-25 11:36:25 +0100 | [diff] [blame] | 221 | pflash->present = true; |
| 222 | pflash->buswidth = 2; |
| 223 | pflash->window = SSB_FLASH1; |
| 224 | pflash->window_size = SSB_FLASH1_SZ; |
Rafał Miłecki | c7a4a9e | 2013-01-25 11:36:26 +0100 | [diff] [blame] | 225 | goto ssb_pflash; |
Rafał Miłecki | 902d9e0 | 2012-08-08 19:37:04 +0200 | [diff] [blame] | 226 | } |
| 227 | |
| 228 | /* There is ChipCommon, so use it to read info about flash */ |
| 229 | switch (bus->chipco.capabilities & SSB_CHIPCO_CAP_FLASHT) { |
| 230 | case SSB_CHIPCO_FLASHT_STSER: |
| 231 | case SSB_CHIPCO_FLASHT_ATSER: |
Rafał Miłecki | 72a525c | 2013-01-06 21:48:50 +0100 | [diff] [blame] | 232 | pr_debug("Found serial flash\n"); |
| 233 | ssb_sflash_init(&bus->chipco); |
Rafał Miłecki | 902d9e0 | 2012-08-08 19:37:04 +0200 | [diff] [blame] | 234 | break; |
| 235 | case SSB_CHIPCO_FLASHT_PARA: |
| 236 | pr_debug("Found parallel flash\n"); |
Rafał Miłecki | f1ab57e | 2013-01-25 11:36:25 +0100 | [diff] [blame] | 237 | pflash->present = true; |
| 238 | pflash->window = SSB_FLASH2; |
| 239 | pflash->window_size = SSB_FLASH2_SZ; |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 240 | if ((ssb_read32(bus->chipco.dev, SSB_CHIPCO_FLASH_CFG) |
| 241 | & SSB_CHIPCO_CFG_DS16) == 0) |
Rafał Miłecki | f1ab57e | 2013-01-25 11:36:25 +0100 | [diff] [blame] | 242 | pflash->buswidth = 1; |
Rafał Miłecki | 902d9e0 | 2012-08-08 19:37:04 +0200 | [diff] [blame] | 243 | else |
Rafał Miłecki | f1ab57e | 2013-01-25 11:36:25 +0100 | [diff] [blame] | 244 | pflash->buswidth = 2; |
Rafał Miłecki | 902d9e0 | 2012-08-08 19:37:04 +0200 | [diff] [blame] | 245 | break; |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 246 | } |
Rafał Miłecki | c7a4a9e | 2013-01-25 11:36:26 +0100 | [diff] [blame] | 247 | |
| 248 | ssb_pflash: |
Rafał Miłecki | 21400f2 | 2014-09-03 22:59:45 +0200 | [diff] [blame] | 249 | if (sflash->present) { |
| 250 | #ifdef CONFIG_BCM47XX |
| 251 | bcm47xx_nvram_init_from_mem(sflash->window, sflash->size); |
| 252 | #endif |
| 253 | } else if (pflash->present) { |
| 254 | #ifdef CONFIG_BCM47XX |
| 255 | bcm47xx_nvram_init_from_mem(pflash->window, pflash->window_size); |
| 256 | #endif |
| 257 | |
Rafał Miłecki | c7a4a9e | 2013-01-25 11:36:26 +0100 | [diff] [blame] | 258 | ssb_pflash_data.width = pflash->buswidth; |
| 259 | ssb_pflash_resource.start = pflash->window; |
| 260 | ssb_pflash_resource.end = pflash->window + pflash->window_size; |
| 261 | } |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 262 | } |
| 263 | |
| 264 | u32 ssb_cpu_clock(struct ssb_mipscore *mcore) |
| 265 | { |
| 266 | struct ssb_bus *bus = mcore->dev->bus; |
| 267 | u32 pll_type, n, m, rate = 0; |
| 268 | |
Hauke Mehrtens | d486a5b | 2012-02-01 00:13:56 +0100 | [diff] [blame] | 269 | if (bus->chipco.capabilities & SSB_CHIPCO_CAP_PMU) |
| 270 | return ssb_pmu_get_cpu_clock(&bus->chipco); |
| 271 | |
Hauke Mehrtens | 0362063 | 2012-11-27 00:31:55 +0100 | [diff] [blame] | 272 | if (ssb_extif_available(&bus->extif)) { |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 273 | ssb_extif_get_clockcontrol(&bus->extif, &pll_type, &n, &m); |
Hauke Mehrtens | 0362063 | 2012-11-27 00:31:55 +0100 | [diff] [blame] | 274 | } else if (ssb_chipco_available(&bus->chipco)) { |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 275 | ssb_chipco_get_clockcpu(&bus->chipco, &pll_type, &n, &m); |
| 276 | } else |
| 277 | return 0; |
| 278 | |
| 279 | if ((pll_type == SSB_PLLTYPE_5) || (bus->chip_id == 0x5365)) { |
| 280 | rate = 200000000; |
| 281 | } else { |
| 282 | rate = ssb_calc_clock_rate(pll_type, n, m); |
| 283 | } |
| 284 | |
| 285 | if (pll_type == SSB_PLLTYPE_6) { |
| 286 | rate *= 2; |
| 287 | } |
| 288 | |
| 289 | return rate; |
| 290 | } |
| 291 | |
| 292 | void ssb_mipscore_init(struct ssb_mipscore *mcore) |
| 293 | { |
Felix Fietkau | 7007d00ca | 2007-10-14 21:04:22 +0200 | [diff] [blame] | 294 | struct ssb_bus *bus; |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 295 | struct ssb_device *dev; |
| 296 | unsigned long hz, ns; |
| 297 | unsigned int irq, i; |
| 298 | |
| 299 | if (!mcore->dev) |
| 300 | return; /* We don't have a MIPS core */ |
| 301 | |
Joe Perches | 33a606a | 2013-02-20 12:16:13 -0800 | [diff] [blame] | 302 | ssb_dbg("Initializing MIPS core...\n"); |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 303 | |
Felix Fietkau | 7007d00ca | 2007-10-14 21:04:22 +0200 | [diff] [blame] | 304 | bus = mcore->dev->bus; |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 305 | hz = ssb_clockspeed(bus); |
| 306 | if (!hz) |
| 307 | hz = 100000000; |
| 308 | ns = 1000000000 / hz; |
| 309 | |
Hauke Mehrtens | 0362063 | 2012-11-27 00:31:55 +0100 | [diff] [blame] | 310 | if (ssb_extif_available(&bus->extif)) |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 311 | ssb_extif_timing_init(&bus->extif, ns); |
Hauke Mehrtens | 0362063 | 2012-11-27 00:31:55 +0100 | [diff] [blame] | 312 | else if (ssb_chipco_available(&bus->chipco)) |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 313 | ssb_chipco_timing_init(&bus->chipco, ns); |
| 314 | |
| 315 | /* Assign IRQs to all cores on the bus, start with irq line 2, because serial usually takes 1 */ |
| 316 | for (irq = 2, i = 0; i < bus->nr_devices; i++) { |
matthieu castet | ea4bbfd | 2009-06-30 23:04:55 +0200 | [diff] [blame] | 317 | int mips_irq; |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 318 | dev = &(bus->devices[i]); |
matthieu castet | ea4bbfd | 2009-06-30 23:04:55 +0200 | [diff] [blame] | 319 | mips_irq = ssb_mips_irq(dev); |
| 320 | if (mips_irq > 4) |
| 321 | dev->irq = 0; |
| 322 | else |
| 323 | dev->irq = mips_irq + 2; |
| 324 | if (dev->irq > 5) |
| 325 | continue; |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 326 | switch (dev->id.coreid) { |
| 327 | case SSB_DEV_USB11_HOST: |
| 328 | /* shouldn't need a separate irq line for non-4710, most of them have a proper |
| 329 | * external usb controller on the pci */ |
| 330 | if ((bus->chip_id == 0x4710) && (irq <= 4)) { |
| 331 | set_irq(dev, irq++); |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 332 | } |
matthieu castet | ea4bbfd | 2009-06-30 23:04:55 +0200 | [diff] [blame] | 333 | break; |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 334 | case SSB_DEV_PCI: |
| 335 | case SSB_DEV_ETHERNET: |
Michael Buesch | aab547c | 2008-02-29 11:36:12 +0100 | [diff] [blame] | 336 | case SSB_DEV_ETHERNET_GBIT: |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 337 | case SSB_DEV_80211: |
| 338 | case SSB_DEV_USB20_HOST: |
| 339 | /* These devices get their own IRQ line if available, the rest goes on IRQ0 */ |
| 340 | if (irq <= 4) { |
| 341 | set_irq(dev, irq++); |
| 342 | break; |
| 343 | } |
Jochen Friedrich | 83e34f0 | 2010-02-03 21:28:11 +0100 | [diff] [blame] | 344 | /* fallthrough */ |
| 345 | case SSB_DEV_EXTIF: |
| 346 | set_irq(dev, 0); |
| 347 | break; |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 348 | } |
| 349 | } |
Joe Perches | 33a606a | 2013-02-20 12:16:13 -0800 | [diff] [blame] | 350 | ssb_dbg("after irq reconfiguration\n"); |
matthieu castet | ea4bbfd | 2009-06-30 23:04:55 +0200 | [diff] [blame] | 351 | dump_irq(bus); |
Michael Buesch | 61e115a | 2007-09-18 15:12:50 -0400 | [diff] [blame] | 352 | |
| 353 | ssb_mips_serial_init(mcore); |
| 354 | ssb_mips_flash_detect(mcore); |
| 355 | } |