kernel: update bcma with most patches from wireless-drivers-next
[openwrt/staging/chunkeey.git] / target / linux / generic / patches-3.18 / 027-bcma-from-4.1.patch
1 --- a/drivers/bcma/bcma_private.h
2 +++ b/drivers/bcma/bcma_private.h
3 @@ -26,6 +26,7 @@ bool bcma_wait_value(struct bcma_device
4 int timeout);
5 void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core);
6 void bcma_init_bus(struct bcma_bus *bus);
7 +void bcma_unregister_cores(struct bcma_bus *bus);
8 int bcma_bus_register(struct bcma_bus *bus);
9 void bcma_bus_unregister(struct bcma_bus *bus);
10 int __init bcma_bus_early_register(struct bcma_bus *bus);
11 @@ -42,6 +43,9 @@ int bcma_bus_scan(struct bcma_bus *bus);
12 int bcma_sprom_get(struct bcma_bus *bus);
13
14 /* driver_chipcommon.c */
15 +void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc);
16 +void bcma_core_chipcommon_init(struct bcma_drv_cc *cc);
17 +void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable);
18 #ifdef CONFIG_BCMA_DRIVER_MIPS
19 void bcma_chipco_serial_init(struct bcma_drv_cc *cc);
20 extern struct platform_device bcma_pflash_dev;
21 @@ -52,6 +56,8 @@ int bcma_core_chipcommon_b_init(struct b
22 void bcma_core_chipcommon_b_free(struct bcma_drv_cc_b *ccb);
23
24 /* driver_chipcommon_pmu.c */
25 +void bcma_pmu_early_init(struct bcma_drv_cc *cc);
26 +void bcma_pmu_init(struct bcma_drv_cc *cc);
27 u32 bcma_pmu_get_alp_clock(struct bcma_drv_cc *cc);
28 u32 bcma_pmu_get_cpu_clock(struct bcma_drv_cc *cc);
29
30 @@ -101,6 +107,14 @@ static inline void __exit bcma_host_soc_
31
32 /* driver_pci.c */
33 u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);
34 +void bcma_core_pci_early_init(struct bcma_drv_pci *pc);
35 +void bcma_core_pci_init(struct bcma_drv_pci *pc);
36 +void bcma_core_pci_up(struct bcma_drv_pci *pc);
37 +void bcma_core_pci_down(struct bcma_drv_pci *pc);
38 +
39 +/* driver_pcie2.c */
40 +void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2);
41 +void bcma_core_pcie2_up(struct bcma_drv_pcie2 *pcie2);
42
43 extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc);
44
45 @@ -117,6 +131,39 @@ static inline void bcma_core_pci_hostmod
46 }
47 #endif /* CONFIG_BCMA_DRIVER_PCI_HOSTMODE */
48
49 +/**************************************************
50 + * driver_mips.c
51 + **************************************************/
52 +
53 +#ifdef CONFIG_BCMA_DRIVER_MIPS
54 +unsigned int bcma_core_mips_irq(struct bcma_device *dev);
55 +void bcma_core_mips_early_init(struct bcma_drv_mips *mcore);
56 +void bcma_core_mips_init(struct bcma_drv_mips *mcore);
57 +#else
58 +static inline unsigned int bcma_core_mips_irq(struct bcma_device *dev)
59 +{
60 + return 0;
61 +}
62 +static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore)
63 +{
64 +}
65 +static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore)
66 +{
67 +}
68 +#endif
69 +
70 +/**************************************************
71 + * driver_gmac_cmn.c
72 + **************************************************/
73 +
74 +#ifdef CONFIG_BCMA_DRIVER_GMAC_CMN
75 +void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc);
76 +#else
77 +static inline void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc)
78 +{
79 +}
80 +#endif
81 +
82 #ifdef CONFIG_BCMA_DRIVER_GPIO
83 /* driver_gpio.c */
84 int bcma_gpio_init(struct bcma_drv_cc *cc);
85 --- a/drivers/bcma/driver_gpio.c
86 +++ b/drivers/bcma/driver_gpio.c
87 @@ -17,6 +17,8 @@
88
89 #include "bcma_private.h"
90
91 +#define BCMA_GPIO_MAX_PINS 32
92 +
93 static inline struct bcma_drv_cc *bcma_gpio_get_cc(struct gpio_chip *chip)
94 {
95 return container_of(chip, struct bcma_drv_cc, gpio);
96 @@ -76,7 +78,7 @@ static void bcma_gpio_free(struct gpio_c
97 bcma_chipco_gpio_pullup(cc, 1 << gpio, 0);
98 }
99
100 -#if IS_BUILTIN(CONFIG_BCM47XX)
101 +#if IS_BUILTIN(CONFIG_BCM47XX) || IS_BUILTIN(CONFIG_ARCH_BCM_5301X)
102 static int bcma_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
103 {
104 struct bcma_drv_cc *cc = bcma_gpio_get_cc(chip);
105 @@ -204,6 +206,7 @@ static void bcma_gpio_irq_domain_exit(st
106
107 int bcma_gpio_init(struct bcma_drv_cc *cc)
108 {
109 + struct bcma_bus *bus = cc->core->bus;
110 struct gpio_chip *chip = &cc->gpio;
111 int err;
112
113 @@ -215,14 +218,14 @@ int bcma_gpio_init(struct bcma_drv_cc *c
114 chip->set = bcma_gpio_set_value;
115 chip->direction_input = bcma_gpio_direction_input;
116 chip->direction_output = bcma_gpio_direction_output;
117 -#if IS_BUILTIN(CONFIG_BCM47XX)
118 +#if IS_BUILTIN(CONFIG_BCM47XX) || IS_BUILTIN(CONFIG_ARCH_BCM_5301X)
119 chip->to_irq = bcma_gpio_to_irq;
120 #endif
121 #if IS_BUILTIN(CONFIG_OF)
122 if (cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC)
123 chip->of_node = cc->core->dev.of_node;
124 #endif
125 - switch (cc->core->bus->chipinfo.id) {
126 + switch (bus->chipinfo.id) {
127 case BCMA_CHIP_ID_BCM5357:
128 case BCMA_CHIP_ID_BCM53572:
129 chip->ngpio = 32;
130 @@ -231,13 +234,17 @@ int bcma_gpio_init(struct bcma_drv_cc *c
131 chip->ngpio = 16;
132 }
133
134 - /* There is just one SoC in one device and its GPIO addresses should be
135 - * deterministic to address them more easily. The other buses could get
136 - * a random base number. */
137 - if (cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC)
138 - chip->base = 0;
139 - else
140 - chip->base = -1;
141 + /*
142 + * On MIPS we register GPIO devices (LEDs, buttons) using absolute GPIO
143 + * pin numbers. We don't have Device Tree there and we can't really use
144 + * relative (per chip) numbers.
145 + * So let's use predictable base for BCM47XX and "random" for all other.
146 + */
147 +#if IS_BUILTIN(CONFIG_BCM47XX)
148 + chip->base = bus->num * BCMA_GPIO_MAX_PINS;
149 +#else
150 + chip->base = -1;
151 +#endif
152
153 err = bcma_gpio_irq_domain_init(cc);
154 if (err)
155 --- a/drivers/bcma/driver_pci.c
156 +++ b/drivers/bcma/driver_pci.c
157 @@ -282,21 +282,21 @@ void bcma_core_pci_power_save(struct bcm
158 }
159 EXPORT_SYMBOL_GPL(bcma_core_pci_power_save);
160
161 -int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
162 +int bcma_core_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core,
163 bool enable)
164 {
165 struct pci_dev *pdev;
166 u32 coremask, tmp;
167 int err = 0;
168
169 - if (!pc || core->bus->hosttype != BCMA_HOSTTYPE_PCI) {
170 + if (bus->hosttype != BCMA_HOSTTYPE_PCI) {
171 /* This bcma device is not on a PCI host-bus. So the IRQs are
172 * not routed through the PCI core.
173 * So we must not enable routing through the PCI core. */
174 goto out;
175 }
176
177 - pdev = pc->core->bus->host_pci;
178 + pdev = bus->host_pci;
179
180 err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp);
181 if (err)
182 @@ -328,28 +328,12 @@ static void bcma_core_pci_extend_L1timer
183 bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG);
184 }
185
186 -void bcma_core_pci_up(struct bcma_bus *bus)
187 +void bcma_core_pci_up(struct bcma_drv_pci *pc)
188 {
189 - struct bcma_drv_pci *pc;
190 -
191 - if (bus->hosttype != BCMA_HOSTTYPE_PCI)
192 - return;
193 -
194 - pc = &bus->drv_pci[0];
195 -
196 bcma_core_pci_extend_L1timer(pc, true);
197 }
198 -EXPORT_SYMBOL_GPL(bcma_core_pci_up);
199
200 -void bcma_core_pci_down(struct bcma_bus *bus)
201 +void bcma_core_pci_down(struct bcma_drv_pci *pc)
202 {
203 - struct bcma_drv_pci *pc;
204 -
205 - if (bus->hosttype != BCMA_HOSTTYPE_PCI)
206 - return;
207 -
208 - pc = &bus->drv_pci[0];
209 -
210 bcma_core_pci_extend_L1timer(pc, false);
211 }
212 -EXPORT_SYMBOL_GPL(bcma_core_pci_down);
213 --- a/drivers/bcma/driver_pci_host.c
214 +++ b/drivers/bcma/driver_pci_host.c
215 @@ -11,6 +11,7 @@
216
217 #include "bcma_private.h"
218 #include <linux/pci.h>
219 +#include <linux/slab.h>
220 #include <linux/export.h>
221 #include <linux/bcma/bcma.h>
222 #include <asm/paccess.h>
223 --- a/drivers/bcma/driver_pcie2.c
224 +++ b/drivers/bcma/driver_pcie2.c
225 @@ -10,6 +10,7 @@
226
227 #include "bcma_private.h"
228 #include <linux/bcma/bcma.h>
229 +#include <linux/pci.h>
230
231 /**************************************************
232 * R/W ops.
233 @@ -156,14 +157,23 @@ static void pciedev_reg_pm_clk_period(st
234
235 void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2)
236 {
237 - struct bcma_chipinfo *ci = &pcie2->core->bus->chipinfo;
238 + struct bcma_bus *bus = pcie2->core->bus;
239 + struct bcma_chipinfo *ci = &bus->chipinfo;
240 u32 tmp;
241
242 tmp = pcie2_read32(pcie2, BCMA_CORE_PCIE2_SPROM(54));
243 if ((tmp & 0xe) >> 1 == 2)
244 bcma_core_pcie2_cfg_write(pcie2, 0x4e0, 0x17);
245
246 - /* TODO: Do we need pcie_reqsize? */
247 + switch (bus->chipinfo.id) {
248 + case BCMA_CHIP_ID_BCM4360:
249 + case BCMA_CHIP_ID_BCM4352:
250 + pcie2->reqsize = 1024;
251 + break;
252 + default:
253 + pcie2->reqsize = 128;
254 + break;
255 + }
256
257 if (ci->id == BCMA_CHIP_ID_BCM4360 && ci->rev > 3)
258 bcma_core_pcie2_war_delay_perst_enab(pcie2, true);
259 @@ -173,3 +183,18 @@ void bcma_core_pcie2_init(struct bcma_dr
260 pciedev_crwlpciegen2_180(pcie2);
261 pciedev_crwlpciegen2_182(pcie2);
262 }
263 +
264 +/**************************************************
265 + * Runtime ops.
266 + **************************************************/
267 +
268 +void bcma_core_pcie2_up(struct bcma_drv_pcie2 *pcie2)
269 +{
270 + struct bcma_bus *bus = pcie2->core->bus;
271 + struct pci_dev *dev = bus->host_pci;
272 + int err;
273 +
274 + err = pcie_set_readrq(dev, pcie2->reqsize);
275 + if (err)
276 + bcma_err(bus, "Error setting PCI_EXP_DEVCTL_READRQ: %d\n", err);
277 +}
278 --- a/drivers/bcma/host_pci.c
279 +++ b/drivers/bcma/host_pci.c
280 @@ -213,16 +213,26 @@ static int bcma_host_pci_probe(struct pc
281 /* Initialize struct, detect chip */
282 bcma_init_bus(bus);
283
284 + /* Scan bus to find out generation of PCIe core */
285 + err = bcma_bus_scan(bus);
286 + if (err)
287 + goto err_pci_unmap_mmio;
288 +
289 + if (bcma_find_core(bus, BCMA_CORE_PCIE2))
290 + bus->host_is_pcie2 = true;
291 +
292 /* Register */
293 err = bcma_bus_register(bus);
294 if (err)
295 - goto err_pci_unmap_mmio;
296 + goto err_unregister_cores;
297
298 pci_set_drvdata(dev, bus);
299
300 out:
301 return err;
302
303 +err_unregister_cores:
304 + bcma_unregister_cores(bus);
305 err_pci_unmap_mmio:
306 pci_iounmap(dev, bus->mmio);
307 err_pci_release_regions:
308 @@ -283,9 +293,12 @@ static const struct pci_device_id bcma_p
309 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4357) },
310 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4358) },
311 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4359) },
312 + { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4360) },
313 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4365) },
314 + { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a0) },
315 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) },
316 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43aa) },
317 + { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43b1) },
318 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4727) },
319 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43227) }, /* 0xa8db, BCM43217 (sic!) */
320 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43228) }, /* 0xa8dc */
321 @@ -310,3 +323,31 @@ void __exit bcma_host_pci_exit(void)
322 {
323 pci_unregister_driver(&bcma_pci_bridge_driver);
324 }
325 +
326 +/**************************************************
327 + * Runtime ops for drivers.
328 + **************************************************/
329 +
330 +/* See also pcicore_up */
331 +void bcma_host_pci_up(struct bcma_bus *bus)
332 +{
333 + if (bus->hosttype != BCMA_HOSTTYPE_PCI)
334 + return;
335 +
336 + if (bus->host_is_pcie2)
337 + bcma_core_pcie2_up(&bus->drv_pcie2);
338 + else
339 + bcma_core_pci_up(&bus->drv_pci[0]);
340 +}
341 +EXPORT_SYMBOL_GPL(bcma_host_pci_up);
342 +
343 +/* See also pcicore_down */
344 +void bcma_host_pci_down(struct bcma_bus *bus)
345 +{
346 + if (bus->hosttype != BCMA_HOSTTYPE_PCI)
347 + return;
348 +
349 + if (!bus->host_is_pcie2)
350 + bcma_core_pci_down(&bus->drv_pci[0]);
351 +}
352 +EXPORT_SYMBOL_GPL(bcma_host_pci_down);
353 --- a/drivers/bcma/main.c
354 +++ b/drivers/bcma/main.c
355 @@ -363,7 +363,7 @@ static int bcma_register_devices(struct
356 return 0;
357 }
358
359 -static void bcma_unregister_cores(struct bcma_bus *bus)
360 +void bcma_unregister_cores(struct bcma_bus *bus)
361 {
362 struct bcma_device *core, *tmp;
363
364 --- a/drivers/net/wireless/b43/main.c
365 +++ b/drivers/net/wireless/b43/main.c
366 @@ -4770,7 +4770,7 @@ static void b43_wireless_core_exit(struc
367 switch (dev->dev->bus_type) {
368 #ifdef CONFIG_B43_BCMA
369 case B43_BUS_BCMA:
370 - bcma_core_pci_down(dev->dev->bdev->bus);
371 + bcma_host_pci_down(dev->dev->bdev->bus);
372 break;
373 #endif
374 #ifdef CONFIG_B43_SSB
375 @@ -4817,9 +4817,9 @@ static int b43_wireless_core_init(struct
376 switch (dev->dev->bus_type) {
377 #ifdef CONFIG_B43_BCMA
378 case B43_BUS_BCMA:
379 - bcma_core_pci_irq_ctl(&dev->dev->bdev->bus->drv_pci[0],
380 + bcma_core_pci_irq_ctl(dev->dev->bdev->bus,
381 dev->dev->bdev, true);
382 - bcma_core_pci_up(dev->dev->bdev->bus);
383 + bcma_host_pci_up(dev->dev->bdev->bus);
384 break;
385 #endif
386 #ifdef CONFIG_B43_SSB
387 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
388 +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
389 @@ -4669,7 +4669,7 @@ static int brcms_b_attach(struct brcms_c
390 brcms_c_coredisable(wlc_hw);
391
392 /* Match driver "down" state */
393 - bcma_core_pci_down(wlc_hw->d11core->bus);
394 + bcma_host_pci_down(wlc_hw->d11core->bus);
395
396 /* turn off pll and xtal to match driver "down" state */
397 brcms_b_xtal(wlc_hw, OFF);
398 @@ -4960,7 +4960,7 @@ static int brcms_b_up_prep(struct brcms_
399 * Configure pci/pcmcia here instead of in brcms_c_attach()
400 * to allow mfg hotswap: down, hotswap (chip power cycle), up.
401 */
402 - bcma_core_pci_irq_ctl(&wlc_hw->d11core->bus->drv_pci[0], wlc_hw->d11core,
403 + bcma_core_pci_irq_ctl(wlc_hw->d11core->bus, wlc_hw->d11core,
404 true);
405
406 /*
407 @@ -4970,12 +4970,12 @@ static int brcms_b_up_prep(struct brcms_
408 */
409 if (brcms_b_radio_read_hwdisabled(wlc_hw)) {
410 /* put SB PCI in down state again */
411 - bcma_core_pci_down(wlc_hw->d11core->bus);
412 + bcma_host_pci_down(wlc_hw->d11core->bus);
413 brcms_b_xtal(wlc_hw, OFF);
414 return -ENOMEDIUM;
415 }
416
417 - bcma_core_pci_up(wlc_hw->d11core->bus);
418 + bcma_host_pci_up(wlc_hw->d11core->bus);
419
420 /* reset the d11 core */
421 brcms_b_corereset(wlc_hw, BRCMS_USE_COREFLAGS);
422 @@ -5172,7 +5172,7 @@ static int brcms_b_down_finish(struct br
423
424 /* turn off primary xtal and pll */
425 if (!wlc_hw->noreset) {
426 - bcma_core_pci_down(wlc_hw->d11core->bus);
427 + bcma_host_pci_down(wlc_hw->d11core->bus);
428 brcms_b_xtal(wlc_hw, OFF);
429 }
430 }
431 --- a/include/linux/bcma/bcma.h
432 +++ b/include/linux/bcma/bcma.h
433 @@ -434,6 +434,18 @@ static inline struct bcma_device *bcma_f
434 return bcma_find_core_unit(bus, coreid, 0);
435 }
436
437 +#ifdef CONFIG_BCMA_HOST_PCI
438 +extern void bcma_host_pci_up(struct bcma_bus *bus);
439 +extern void bcma_host_pci_down(struct bcma_bus *bus);
440 +#else
441 +static inline void bcma_host_pci_up(struct bcma_bus *bus)
442 +{
443 +}
444 +static inline void bcma_host_pci_down(struct bcma_bus *bus)
445 +{
446 +}
447 +#endif
448 +
449 extern bool bcma_core_is_enabled(struct bcma_device *core);
450 extern void bcma_core_disable(struct bcma_device *core, u32 flags);
451 extern int bcma_core_enable(struct bcma_device *core, u32 flags);
452 --- a/include/linux/bcma/bcma_driver_pci.h
453 +++ b/include/linux/bcma/bcma_driver_pci.h
454 @@ -238,12 +238,8 @@ struct bcma_drv_pci {
455 #define pcicore_write16(pc, offset, val) bcma_write16((pc)->core, offset, val)
456 #define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val)
457
458 -extern void bcma_core_pci_early_init(struct bcma_drv_pci *pc);
459 -extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
460 -extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
461 +extern int bcma_core_pci_irq_ctl(struct bcma_bus *bus,
462 struct bcma_device *core, bool enable);
463 -extern void bcma_core_pci_up(struct bcma_bus *bus);
464 -extern void bcma_core_pci_down(struct bcma_bus *bus);
465 extern void bcma_core_pci_power_save(struct bcma_bus *bus, bool up);
466
467 extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev);
468 --- a/include/linux/bcma/bcma_driver_pcie2.h
469 +++ b/include/linux/bcma/bcma_driver_pcie2.h
470 @@ -143,6 +143,8 @@
471
472 struct bcma_drv_pcie2 {
473 struct bcma_device *core;
474 +
475 + u16 reqsize;
476 };
477
478 #define pcie2_read16(pcie2, offset) bcma_read16((pcie2)->core, offset)
479 @@ -153,6 +155,4 @@ struct bcma_drv_pcie2 {
480 #define pcie2_set32(pcie2, offset, set) bcma_set32((pcie2)->core, offset, set)
481 #define pcie2_mask32(pcie2, offset, mask) bcma_mask32((pcie2)->core, offset, mask)
482
483 -void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2);
484 -
485 #endif /* LINUX_BCMA_DRIVER_PCIE2_H_ */
486 --- a/drivers/bcma/Kconfig
487 +++ b/drivers/bcma/Kconfig
488 @@ -1,6 +1,6 @@
489 config BCMA_POSSIBLE
490 bool
491 - depends on HAS_IOMEM && HAS_DMA
492 + depends on HAS_IOMEM && HAS_DMA && PCI
493 default y
494
495 menu "Broadcom specific AMBA"
496 @@ -26,6 +26,7 @@ config BCMA_HOST_PCI_POSSIBLE
497 config BCMA_HOST_PCI
498 bool "Support for BCMA on PCI-host bus"
499 depends on BCMA_HOST_PCI_POSSIBLE
500 + select BCMA_DRIVER_PCI
501 default y
502
503 config BCMA_DRIVER_PCI_HOSTMODE
504 @@ -44,6 +45,22 @@ config BCMA_HOST_SOC
505
506 If unsure, say N
507
508 +# TODO: make it depend on PCI when ready
509 +config BCMA_DRIVER_PCI
510 + bool
511 + default y
512 + help
513 + BCMA bus may have many versions of PCIe core. This driver
514 + supports:
515 + 1) PCIe core working in clientmode
516 + 2) PCIe Gen 2 clientmode core
517 +
518 + In general PCIe (Gen 2) clientmode core is required on PCIe
519 + hosted buses. It's responsible for initialization and basic
520 + hardware management.
521 + This driver is also prerequisite for a hostmode PCIe core
522 + support.
523 +
524 config BCMA_DRIVER_MIPS
525 bool "BCMA Broadcom MIPS core driver"
526 depends on BCMA && MIPS
527 --- a/drivers/bcma/Makefile
528 +++ b/drivers/bcma/Makefile
529 @@ -3,8 +3,8 @@ bcma-y += driver_chipcommon.o driver
530 bcma-y += driver_chipcommon_b.o
531 bcma-$(CONFIG_BCMA_SFLASH) += driver_chipcommon_sflash.o
532 bcma-$(CONFIG_BCMA_NFLASH) += driver_chipcommon_nflash.o
533 -bcma-y += driver_pci.o
534 -bcma-y += driver_pcie2.o
535 +bcma-$(CONFIG_BCMA_DRIVER_PCI) += driver_pci.o
536 +bcma-$(CONFIG_BCMA_DRIVER_PCI) += driver_pcie2.o
537 bcma-$(CONFIG_BCMA_DRIVER_PCI_HOSTMODE) += driver_pci_host.o
538 bcma-$(CONFIG_BCMA_DRIVER_MIPS) += driver_mips.o
539 bcma-$(CONFIG_BCMA_DRIVER_GMAC_CMN) += driver_gmac_cmn.o
540 --- a/include/linux/bcma/bcma_driver_chipcommon.h
541 +++ b/include/linux/bcma/bcma_driver_chipcommon.h
542 @@ -663,14 +663,6 @@ struct bcma_drv_cc_b {
543 #define bcma_cc_maskset32(cc, offset, mask, set) \
544 bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set))
545
546 -extern void bcma_core_chipcommon_init(struct bcma_drv_cc *cc);
547 -extern void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc);
548 -
549 -extern void bcma_chipco_suspend(struct bcma_drv_cc *cc);
550 -extern void bcma_chipco_resume(struct bcma_drv_cc *cc);
551 -
552 -void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable);
553 -
554 extern u32 bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, u32 ticks);
555
556 extern u32 bcma_chipco_get_alp_clock(struct bcma_drv_cc *cc);
557 @@ -690,9 +682,6 @@ u32 bcma_chipco_gpio_pullup(struct bcma_
558 u32 bcma_chipco_gpio_pulldown(struct bcma_drv_cc *cc, u32 mask, u32 value);
559
560 /* PMU support */
561 -extern void bcma_pmu_init(struct bcma_drv_cc *cc);
562 -extern void bcma_pmu_early_init(struct bcma_drv_cc *cc);
563 -
564 extern void bcma_chipco_pll_write(struct bcma_drv_cc *cc, u32 offset,
565 u32 value);
566 extern void bcma_chipco_pll_maskset(struct bcma_drv_cc *cc, u32 offset,
567 --- a/include/linux/bcma/bcma_driver_gmac_cmn.h
568 +++ b/include/linux/bcma/bcma_driver_gmac_cmn.h
569 @@ -91,10 +91,4 @@ struct bcma_drv_gmac_cmn {
570 #define gmac_cmn_write16(gc, offset, val) bcma_write16((gc)->core, offset, val)
571 #define gmac_cmn_write32(gc, offset, val) bcma_write32((gc)->core, offset, val)
572
573 -#ifdef CONFIG_BCMA_DRIVER_GMAC_CMN
574 -extern void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc);
575 -#else
576 -static inline void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc) { }
577 -#endif
578 -
579 #endif /* LINUX_BCMA_DRIVER_GMAC_CMN_H_ */
580 --- a/include/linux/bcma/bcma_driver_mips.h
581 +++ b/include/linux/bcma/bcma_driver_mips.h
582 @@ -39,21 +39,6 @@ struct bcma_drv_mips {
583 u8 early_setup_done:1;
584 };
585
586 -#ifdef CONFIG_BCMA_DRIVER_MIPS
587 -extern void bcma_core_mips_init(struct bcma_drv_mips *mcore);
588 -extern void bcma_core_mips_early_init(struct bcma_drv_mips *mcore);
589 -
590 -extern unsigned int bcma_core_mips_irq(struct bcma_device *dev);
591 -#else
592 -static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { }
593 -static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) { }
594 -
595 -static inline unsigned int bcma_core_mips_irq(struct bcma_device *dev)
596 -{
597 - return 0;
598 -}
599 -#endif
600 -
601 extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore);
602
603 #endif /* LINUX_BCMA_DRIVER_MIPS_H_ */