Skip to content

Commit 28c0f02

Browse files
committed
Merge tag 'wireless-drivers-next-for-davem-2015-03-06' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
Major changes: brcmfmac: * sdio improvements * add a debugfs file so users can provide us all the revinfo we could ask for iwlwifi: * add triggers for firmware dump collection * remove support for -9.ucode * new statitics API * rate control improvements ath9k: * add per-vif TX power capability * BT coexistance fixes ath10k: * qca6174: enable STA transmit beamforming (TxBF) support * disable multi-vif power save by default bcma: * enable support for PCIe Gen 2 host devices Signed-off-by: David S. Miller <[email protected]>
2 parents 89650ad + 1ca2760 commit 28c0f02

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+3304
-2340
lines changed

drivers/bcma/Kconfig

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
config BCMA_POSSIBLE
22
bool
3-
depends on HAS_IOMEM && HAS_DMA
3+
depends on HAS_IOMEM && HAS_DMA && PCI
44
default y
55

66
menu "Broadcom specific AMBA"
@@ -26,6 +26,7 @@ config BCMA_HOST_PCI_POSSIBLE
2626
config BCMA_HOST_PCI
2727
bool "Support for BCMA on PCI-host bus"
2828
depends on BCMA_HOST_PCI_POSSIBLE
29+
select BCMA_DRIVER_PCI
2930
default y
3031

3132
config BCMA_DRIVER_PCI_HOSTMODE
@@ -44,6 +45,22 @@ config BCMA_HOST_SOC
4445

4546
If unsure, say N
4647

48+
# TODO: make it depend on PCI when ready
49+
config BCMA_DRIVER_PCI
50+
bool
51+
default y
52+
help
53+
BCMA bus may have many versions of PCIe core. This driver
54+
supports:
55+
1) PCIe core working in clientmode
56+
2) PCIe Gen 2 clientmode core
57+
58+
In general PCIe (Gen 2) clientmode core is required on PCIe
59+
hosted buses. It's responsible for initialization and basic
60+
hardware management.
61+
This driver is also prerequisite for a hostmode PCIe core
62+
support.
63+
4764
config BCMA_DRIVER_MIPS
4865
bool "BCMA Broadcom MIPS core driver"
4966
depends on BCMA && MIPS

drivers/bcma/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ bcma-y += driver_chipcommon.o driver_chipcommon_pmu.o
33
bcma-y += driver_chipcommon_b.o
44
bcma-$(CONFIG_BCMA_SFLASH) += driver_chipcommon_sflash.o
55
bcma-$(CONFIG_BCMA_NFLASH) += driver_chipcommon_nflash.o
6-
bcma-y += driver_pci.o
7-
bcma-y += driver_pcie2.o
6+
bcma-$(CONFIG_BCMA_DRIVER_PCI) += driver_pci.o
7+
bcma-$(CONFIG_BCMA_DRIVER_PCI) += driver_pcie2.o
88
bcma-$(CONFIG_BCMA_DRIVER_PCI_HOSTMODE) += driver_pci_host.o
99
bcma-$(CONFIG_BCMA_DRIVER_MIPS) += driver_mips.o
1010
bcma-$(CONFIG_BCMA_DRIVER_GMAC_CMN) += driver_gmac_cmn.o

drivers/bcma/bcma_private.h

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value,
2626
int timeout);
2727
void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core);
2828
void bcma_init_bus(struct bcma_bus *bus);
29+
void bcma_unregister_cores(struct bcma_bus *bus);
2930
int bcma_bus_register(struct bcma_bus *bus);
3031
void bcma_bus_unregister(struct bcma_bus *bus);
3132
int __init bcma_bus_early_register(struct bcma_bus *bus);
@@ -42,6 +43,9 @@ int bcma_bus_scan(struct bcma_bus *bus);
4243
int bcma_sprom_get(struct bcma_bus *bus);
4344

4445
/* driver_chipcommon.c */
46+
void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc);
47+
void bcma_core_chipcommon_init(struct bcma_drv_cc *cc);
48+
void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable);
4549
#ifdef CONFIG_BCMA_DRIVER_MIPS
4650
void bcma_chipco_serial_init(struct bcma_drv_cc *cc);
4751
extern struct platform_device bcma_pflash_dev;
@@ -52,6 +56,8 @@ int bcma_core_chipcommon_b_init(struct bcma_drv_cc_b *ccb);
5256
void bcma_core_chipcommon_b_free(struct bcma_drv_cc_b *ccb);
5357

5458
/* driver_chipcommon_pmu.c */
59+
void bcma_pmu_early_init(struct bcma_drv_cc *cc);
60+
void bcma_pmu_init(struct bcma_drv_cc *cc);
5561
u32 bcma_pmu_get_alp_clock(struct bcma_drv_cc *cc);
5662
u32 bcma_pmu_get_cpu_clock(struct bcma_drv_cc *cc);
5763

@@ -101,6 +107,14 @@ static inline void __exit bcma_host_soc_unregister_driver(void)
101107

102108
/* driver_pci.c */
103109
u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);
110+
void bcma_core_pci_early_init(struct bcma_drv_pci *pc);
111+
void bcma_core_pci_init(struct bcma_drv_pci *pc);
112+
void bcma_core_pci_up(struct bcma_drv_pci *pc);
113+
void bcma_core_pci_down(struct bcma_drv_pci *pc);
114+
115+
/* driver_pcie2.c */
116+
void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2);
117+
void bcma_core_pcie2_up(struct bcma_drv_pcie2 *pcie2);
104118

105119
extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc);
106120

@@ -117,6 +131,39 @@ static inline void bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc)
117131
}
118132
#endif /* CONFIG_BCMA_DRIVER_PCI_HOSTMODE */
119133

134+
/**************************************************
135+
* driver_mips.c
136+
**************************************************/
137+
138+
#ifdef CONFIG_BCMA_DRIVER_MIPS
139+
unsigned int bcma_core_mips_irq(struct bcma_device *dev);
140+
void bcma_core_mips_early_init(struct bcma_drv_mips *mcore);
141+
void bcma_core_mips_init(struct bcma_drv_mips *mcore);
142+
#else
143+
static inline unsigned int bcma_core_mips_irq(struct bcma_device *dev)
144+
{
145+
return 0;
146+
}
147+
static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore)
148+
{
149+
}
150+
static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore)
151+
{
152+
}
153+
#endif
154+
155+
/**************************************************
156+
* driver_gmac_cmn.c
157+
**************************************************/
158+
159+
#ifdef CONFIG_BCMA_DRIVER_GMAC_CMN
160+
void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc);
161+
#else
162+
static inline void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc)
163+
{
164+
}
165+
#endif
166+
120167
#ifdef CONFIG_BCMA_DRIVER_GPIO
121168
/* driver_gpio.c */
122169
int bcma_gpio_init(struct bcma_drv_cc *cc);

drivers/bcma/driver_gpio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static void bcma_gpio_free(struct gpio_chip *chip, unsigned gpio)
7676
bcma_chipco_gpio_pullup(cc, 1 << gpio, 0);
7777
}
7878

79-
#if IS_BUILTIN(CONFIG_BCM47XX)
79+
#if IS_BUILTIN(CONFIG_BCM47XX) || IS_BUILTIN(CONFIG_ARCH_BCM_5301X)
8080
static int bcma_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
8181
{
8282
struct bcma_drv_cc *cc = bcma_gpio_get_cc(chip);
@@ -215,7 +215,7 @@ int bcma_gpio_init(struct bcma_drv_cc *cc)
215215
chip->set = bcma_gpio_set_value;
216216
chip->direction_input = bcma_gpio_direction_input;
217217
chip->direction_output = bcma_gpio_direction_output;
218-
#if IS_BUILTIN(CONFIG_BCM47XX)
218+
#if IS_BUILTIN(CONFIG_BCM47XX) || IS_BUILTIN(CONFIG_ARCH_BCM_5301X)
219219
chip->to_irq = bcma_gpio_to_irq;
220220
#endif
221221
#if IS_BUILTIN(CONFIG_OF)

drivers/bcma/driver_pci.c

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -282,21 +282,21 @@ void bcma_core_pci_power_save(struct bcma_bus *bus, bool up)
282282
}
283283
EXPORT_SYMBOL_GPL(bcma_core_pci_power_save);
284284

285-
int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
285+
int bcma_core_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core,
286286
bool enable)
287287
{
288288
struct pci_dev *pdev;
289289
u32 coremask, tmp;
290290
int err = 0;
291291

292-
if (!pc || core->bus->hosttype != BCMA_HOSTTYPE_PCI) {
292+
if (bus->hosttype != BCMA_HOSTTYPE_PCI) {
293293
/* This bcma device is not on a PCI host-bus. So the IRQs are
294294
* not routed through the PCI core.
295295
* So we must not enable routing through the PCI core. */
296296
goto out;
297297
}
298298

299-
pdev = pc->core->bus->host_pci;
299+
pdev = bus->host_pci;
300300

301301
err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp);
302302
if (err)
@@ -328,28 +328,12 @@ static void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend)
328328
bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG);
329329
}
330330

331-
void bcma_core_pci_up(struct bcma_bus *bus)
331+
void bcma_core_pci_up(struct bcma_drv_pci *pc)
332332
{
333-
struct bcma_drv_pci *pc;
334-
335-
if (bus->hosttype != BCMA_HOSTTYPE_PCI)
336-
return;
337-
338-
pc = &bus->drv_pci[0];
339-
340333
bcma_core_pci_extend_L1timer(pc, true);
341334
}
342-
EXPORT_SYMBOL_GPL(bcma_core_pci_up);
343335

344-
void bcma_core_pci_down(struct bcma_bus *bus)
336+
void bcma_core_pci_down(struct bcma_drv_pci *pc)
345337
{
346-
struct bcma_drv_pci *pc;
347-
348-
if (bus->hosttype != BCMA_HOSTTYPE_PCI)
349-
return;
350-
351-
pc = &bus->drv_pci[0];
352-
353338
bcma_core_pci_extend_L1timer(pc, false);
354339
}
355-
EXPORT_SYMBOL_GPL(bcma_core_pci_down);

drivers/bcma/driver_pci_host.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "bcma_private.h"
1313
#include <linux/pci.h>
14+
#include <linux/slab.h>
1415
#include <linux/export.h>
1516
#include <linux/bcma/bcma.h>
1617
#include <asm/paccess.h>

drivers/bcma/driver_pcie2.c

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include "bcma_private.h"
1212
#include <linux/bcma/bcma.h>
13+
#include <linux/pci.h>
1314

1415
/**************************************************
1516
* R/W ops.
@@ -156,14 +157,23 @@ static void pciedev_reg_pm_clk_period(struct bcma_drv_pcie2 *pcie2)
156157

157158
void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2)
158159
{
159-
struct bcma_chipinfo *ci = &pcie2->core->bus->chipinfo;
160+
struct bcma_bus *bus = pcie2->core->bus;
161+
struct bcma_chipinfo *ci = &bus->chipinfo;
160162
u32 tmp;
161163

162164
tmp = pcie2_read32(pcie2, BCMA_CORE_PCIE2_SPROM(54));
163165
if ((tmp & 0xe) >> 1 == 2)
164166
bcma_core_pcie2_cfg_write(pcie2, 0x4e0, 0x17);
165167

166-
/* TODO: Do we need pcie_reqsize? */
168+
switch (bus->chipinfo.id) {
169+
case BCMA_CHIP_ID_BCM4360:
170+
case BCMA_CHIP_ID_BCM4352:
171+
pcie2->reqsize = 1024;
172+
break;
173+
default:
174+
pcie2->reqsize = 128;
175+
break;
176+
}
167177

168178
if (ci->id == BCMA_CHIP_ID_BCM4360 && ci->rev > 3)
169179
bcma_core_pcie2_war_delay_perst_enab(pcie2, true);
@@ -173,3 +183,18 @@ void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2)
173183
pciedev_crwlpciegen2_180(pcie2);
174184
pciedev_crwlpciegen2_182(pcie2);
175185
}
186+
187+
/**************************************************
188+
* Runtime ops.
189+
**************************************************/
190+
191+
void bcma_core_pcie2_up(struct bcma_drv_pcie2 *pcie2)
192+
{
193+
struct bcma_bus *bus = pcie2->core->bus;
194+
struct pci_dev *dev = bus->host_pci;
195+
int err;
196+
197+
err = pcie_set_readrq(dev, pcie2->reqsize);
198+
if (err)
199+
bcma_err(bus, "Error setting PCI_EXP_DEVCTL_READRQ: %d\n", err);
200+
}

drivers/bcma/host_pci.c

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,16 +213,26 @@ static int bcma_host_pci_probe(struct pci_dev *dev,
213213
/* Initialize struct, detect chip */
214214
bcma_init_bus(bus);
215215

216+
/* Scan bus to find out generation of PCIe core */
217+
err = bcma_bus_scan(bus);
218+
if (err)
219+
goto err_pci_unmap_mmio;
220+
221+
if (bcma_find_core(bus, BCMA_CORE_PCIE2))
222+
bus->host_is_pcie2 = true;
223+
216224
/* Register */
217225
err = bcma_bus_register(bus);
218226
if (err)
219-
goto err_pci_unmap_mmio;
227+
goto err_unregister_cores;
220228

221229
pci_set_drvdata(dev, bus);
222230

223231
out:
224232
return err;
225233

234+
err_unregister_cores:
235+
bcma_unregister_cores(bus);
226236
err_pci_unmap_mmio:
227237
pci_iounmap(dev, bus->mmio);
228238
err_pci_release_regions:
@@ -283,9 +293,12 @@ static const struct pci_device_id bcma_pci_bridge_tbl[] = {
283293
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4357) },
284294
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4358) },
285295
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4359) },
296+
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4360) },
286297
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4365) },
298+
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a0) },
287299
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) },
288300
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43aa) },
301+
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43b1) },
289302
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4727) },
290303
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43227) }, /* 0xa8db, BCM43217 (sic!) */
291304
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43228) }, /* 0xa8dc */
@@ -310,3 +323,31 @@ void __exit bcma_host_pci_exit(void)
310323
{
311324
pci_unregister_driver(&bcma_pci_bridge_driver);
312325
}
326+
327+
/**************************************************
328+
* Runtime ops for drivers.
329+
**************************************************/
330+
331+
/* See also pcicore_up */
332+
void bcma_host_pci_up(struct bcma_bus *bus)
333+
{
334+
if (bus->hosttype != BCMA_HOSTTYPE_PCI)
335+
return;
336+
337+
if (bus->host_is_pcie2)
338+
bcma_core_pcie2_up(&bus->drv_pcie2);
339+
else
340+
bcma_core_pci_up(&bus->drv_pci[0]);
341+
}
342+
EXPORT_SYMBOL_GPL(bcma_host_pci_up);
343+
344+
/* See also pcicore_down */
345+
void bcma_host_pci_down(struct bcma_bus *bus)
346+
{
347+
if (bus->hosttype != BCMA_HOSTTYPE_PCI)
348+
return;
349+
350+
if (!bus->host_is_pcie2)
351+
bcma_core_pci_down(&bus->drv_pci[0]);
352+
}
353+
EXPORT_SYMBOL_GPL(bcma_host_pci_down);

drivers/bcma/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ static int bcma_register_devices(struct bcma_bus *bus)
363363
return 0;
364364
}
365365

366-
static void bcma_unregister_cores(struct bcma_bus *bus)
366+
void bcma_unregister_cores(struct bcma_bus *bus)
367367
{
368368
struct bcma_device *core, *tmp;
369369

drivers/net/wireless/ath/ath10k/ce.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct ath10k_ce_pipe;
3939
#define CE_DESC_FLAGS_GATHER (1 << 0)
4040
#define CE_DESC_FLAGS_BYTE_SWAP (1 << 1)
4141
#define CE_DESC_FLAGS_META_DATA_MASK 0xFFFC
42-
#define CE_DESC_FLAGS_META_DATA_LSB 3
42+
#define CE_DESC_FLAGS_META_DATA_LSB 2
4343

4444
struct ce_desc {
4545
__le32 addr;

drivers/net/wireless/ath/ath10k/core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,16 +436,16 @@ static int ath10k_download_fw(struct ath10k *ar, enum ath10k_firmware_mode mode)
436436

437437
static void ath10k_core_free_firmware_files(struct ath10k *ar)
438438
{
439-
if (ar->board && !IS_ERR(ar->board))
439+
if (!IS_ERR(ar->board))
440440
release_firmware(ar->board);
441441

442-
if (ar->otp && !IS_ERR(ar->otp))
442+
if (!IS_ERR(ar->otp))
443443
release_firmware(ar->otp);
444444

445-
if (ar->firmware && !IS_ERR(ar->firmware))
445+
if (!IS_ERR(ar->firmware))
446446
release_firmware(ar->firmware);
447447

448-
if (ar->cal_file && !IS_ERR(ar->cal_file))
448+
if (!IS_ERR(ar->cal_file))
449449
release_firmware(ar->cal_file);
450450

451451
ar->board = NULL;

0 commit comments

Comments
 (0)