Skip to content

Commit

Permalink
Merge tag 'wireless-drivers-next-for-davem-2015-03-06' of git://git.k…
Browse files Browse the repository at this point in the history
…ernel.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 <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 6, 2015
2 parents 89650ad + 1ca2760 commit 28c0f02
Show file tree
Hide file tree
Showing 137 changed files with 3,304 additions and 2,340 deletions.
19 changes: 18 additions & 1 deletion drivers/bcma/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config BCMA_POSSIBLE
bool
depends on HAS_IOMEM && HAS_DMA
depends on HAS_IOMEM && HAS_DMA && PCI
default y

menu "Broadcom specific AMBA"
Expand All @@ -26,6 +26,7 @@ config BCMA_HOST_PCI_POSSIBLE
config BCMA_HOST_PCI
bool "Support for BCMA on PCI-host bus"
depends on BCMA_HOST_PCI_POSSIBLE
select BCMA_DRIVER_PCI
default y

config BCMA_DRIVER_PCI_HOSTMODE
Expand All @@ -44,6 +45,22 @@ config BCMA_HOST_SOC

If unsure, say N

# TODO: make it depend on PCI when ready
config BCMA_DRIVER_PCI
bool
default y
help
BCMA bus may have many versions of PCIe core. This driver
supports:
1) PCIe core working in clientmode
2) PCIe Gen 2 clientmode core

In general PCIe (Gen 2) clientmode core is required on PCIe
hosted buses. It's responsible for initialization and basic
hardware management.
This driver is also prerequisite for a hostmode PCIe core
support.

config BCMA_DRIVER_MIPS
bool "BCMA Broadcom MIPS core driver"
depends on BCMA && MIPS
Expand Down
4 changes: 2 additions & 2 deletions drivers/bcma/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ bcma-y += driver_chipcommon.o driver_chipcommon_pmu.o
bcma-y += driver_chipcommon_b.o
bcma-$(CONFIG_BCMA_SFLASH) += driver_chipcommon_sflash.o
bcma-$(CONFIG_BCMA_NFLASH) += driver_chipcommon_nflash.o
bcma-y += driver_pci.o
bcma-y += driver_pcie2.o
bcma-$(CONFIG_BCMA_DRIVER_PCI) += driver_pci.o
bcma-$(CONFIG_BCMA_DRIVER_PCI) += driver_pcie2.o
bcma-$(CONFIG_BCMA_DRIVER_PCI_HOSTMODE) += driver_pci_host.o
bcma-$(CONFIG_BCMA_DRIVER_MIPS) += driver_mips.o
bcma-$(CONFIG_BCMA_DRIVER_GMAC_CMN) += driver_gmac_cmn.o
Expand Down
47 changes: 47 additions & 0 deletions drivers/bcma/bcma_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value,
int timeout);
void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core);
void bcma_init_bus(struct bcma_bus *bus);
void bcma_unregister_cores(struct bcma_bus *bus);
int bcma_bus_register(struct bcma_bus *bus);
void bcma_bus_unregister(struct bcma_bus *bus);
int __init bcma_bus_early_register(struct bcma_bus *bus);
Expand All @@ -42,6 +43,9 @@ int bcma_bus_scan(struct bcma_bus *bus);
int bcma_sprom_get(struct bcma_bus *bus);

/* driver_chipcommon.c */
void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc);
void bcma_core_chipcommon_init(struct bcma_drv_cc *cc);
void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable);
#ifdef CONFIG_BCMA_DRIVER_MIPS
void bcma_chipco_serial_init(struct bcma_drv_cc *cc);
extern struct platform_device bcma_pflash_dev;
Expand All @@ -52,6 +56,8 @@ int bcma_core_chipcommon_b_init(struct bcma_drv_cc_b *ccb);
void bcma_core_chipcommon_b_free(struct bcma_drv_cc_b *ccb);

/* driver_chipcommon_pmu.c */
void bcma_pmu_early_init(struct bcma_drv_cc *cc);
void bcma_pmu_init(struct bcma_drv_cc *cc);
u32 bcma_pmu_get_alp_clock(struct bcma_drv_cc *cc);
u32 bcma_pmu_get_cpu_clock(struct bcma_drv_cc *cc);

Expand Down Expand Up @@ -101,6 +107,14 @@ static inline void __exit bcma_host_soc_unregister_driver(void)

/* driver_pci.c */
u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);
void bcma_core_pci_early_init(struct bcma_drv_pci *pc);
void bcma_core_pci_init(struct bcma_drv_pci *pc);
void bcma_core_pci_up(struct bcma_drv_pci *pc);
void bcma_core_pci_down(struct bcma_drv_pci *pc);

/* driver_pcie2.c */
void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2);
void bcma_core_pcie2_up(struct bcma_drv_pcie2 *pcie2);

extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc);

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

/**************************************************
* driver_mips.c
**************************************************/

#ifdef CONFIG_BCMA_DRIVER_MIPS
unsigned int bcma_core_mips_irq(struct bcma_device *dev);
void bcma_core_mips_early_init(struct bcma_drv_mips *mcore);
void bcma_core_mips_init(struct bcma_drv_mips *mcore);
#else
static inline unsigned int bcma_core_mips_irq(struct bcma_device *dev)
{
return 0;
}
static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore)
{
}
static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore)
{
}
#endif

/**************************************************
* driver_gmac_cmn.c
**************************************************/

#ifdef CONFIG_BCMA_DRIVER_GMAC_CMN
void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc);
#else
static inline void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc)
{
}
#endif

#ifdef CONFIG_BCMA_DRIVER_GPIO
/* driver_gpio.c */
int bcma_gpio_init(struct bcma_drv_cc *cc);
Expand Down
4 changes: 2 additions & 2 deletions drivers/bcma/driver_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static void bcma_gpio_free(struct gpio_chip *chip, unsigned gpio)
bcma_chipco_gpio_pullup(cc, 1 << gpio, 0);
}

#if IS_BUILTIN(CONFIG_BCM47XX)
#if IS_BUILTIN(CONFIG_BCM47XX) || IS_BUILTIN(CONFIG_ARCH_BCM_5301X)
static int bcma_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
{
struct bcma_drv_cc *cc = bcma_gpio_get_cc(chip);
Expand Down Expand Up @@ -215,7 +215,7 @@ int bcma_gpio_init(struct bcma_drv_cc *cc)
chip->set = bcma_gpio_set_value;
chip->direction_input = bcma_gpio_direction_input;
chip->direction_output = bcma_gpio_direction_output;
#if IS_BUILTIN(CONFIG_BCM47XX)
#if IS_BUILTIN(CONFIG_BCM47XX) || IS_BUILTIN(CONFIG_ARCH_BCM_5301X)
chip->to_irq = bcma_gpio_to_irq;
#endif
#if IS_BUILTIN(CONFIG_OF)
Expand Down
26 changes: 5 additions & 21 deletions drivers/bcma/driver_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,21 +282,21 @@ void bcma_core_pci_power_save(struct bcma_bus *bus, bool up)
}
EXPORT_SYMBOL_GPL(bcma_core_pci_power_save);

int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
int bcma_core_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core,
bool enable)
{
struct pci_dev *pdev;
u32 coremask, tmp;
int err = 0;

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

pdev = pc->core->bus->host_pci;
pdev = bus->host_pci;

err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp);
if (err)
Expand Down Expand Up @@ -328,28 +328,12 @@ static void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend)
bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG);
}

void bcma_core_pci_up(struct bcma_bus *bus)
void bcma_core_pci_up(struct bcma_drv_pci *pc)
{
struct bcma_drv_pci *pc;

if (bus->hosttype != BCMA_HOSTTYPE_PCI)
return;

pc = &bus->drv_pci[0];

bcma_core_pci_extend_L1timer(pc, true);
}
EXPORT_SYMBOL_GPL(bcma_core_pci_up);

void bcma_core_pci_down(struct bcma_bus *bus)
void bcma_core_pci_down(struct bcma_drv_pci *pc)
{
struct bcma_drv_pci *pc;

if (bus->hosttype != BCMA_HOSTTYPE_PCI)
return;

pc = &bus->drv_pci[0];

bcma_core_pci_extend_L1timer(pc, false);
}
EXPORT_SYMBOL_GPL(bcma_core_pci_down);
1 change: 1 addition & 0 deletions drivers/bcma/driver_pci_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "bcma_private.h"
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/export.h>
#include <linux/bcma/bcma.h>
#include <asm/paccess.h>
Expand Down
29 changes: 27 additions & 2 deletions drivers/bcma/driver_pcie2.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "bcma_private.h"
#include <linux/bcma/bcma.h>
#include <linux/pci.h>

/**************************************************
* R/W ops.
Expand Down Expand Up @@ -156,14 +157,23 @@ static void pciedev_reg_pm_clk_period(struct bcma_drv_pcie2 *pcie2)

void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2)
{
struct bcma_chipinfo *ci = &pcie2->core->bus->chipinfo;
struct bcma_bus *bus = pcie2->core->bus;
struct bcma_chipinfo *ci = &bus->chipinfo;
u32 tmp;

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

/* TODO: Do we need pcie_reqsize? */
switch (bus->chipinfo.id) {
case BCMA_CHIP_ID_BCM4360:
case BCMA_CHIP_ID_BCM4352:
pcie2->reqsize = 1024;
break;
default:
pcie2->reqsize = 128;
break;
}

if (ci->id == BCMA_CHIP_ID_BCM4360 && ci->rev > 3)
bcma_core_pcie2_war_delay_perst_enab(pcie2, true);
Expand All @@ -173,3 +183,18 @@ void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2)
pciedev_crwlpciegen2_180(pcie2);
pciedev_crwlpciegen2_182(pcie2);
}

/**************************************************
* Runtime ops.
**************************************************/

void bcma_core_pcie2_up(struct bcma_drv_pcie2 *pcie2)
{
struct bcma_bus *bus = pcie2->core->bus;
struct pci_dev *dev = bus->host_pci;
int err;

err = pcie_set_readrq(dev, pcie2->reqsize);
if (err)
bcma_err(bus, "Error setting PCI_EXP_DEVCTL_READRQ: %d\n", err);
}
43 changes: 42 additions & 1 deletion drivers/bcma/host_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,26 @@ static int bcma_host_pci_probe(struct pci_dev *dev,
/* Initialize struct, detect chip */
bcma_init_bus(bus);

/* Scan bus to find out generation of PCIe core */
err = bcma_bus_scan(bus);
if (err)
goto err_pci_unmap_mmio;

if (bcma_find_core(bus, BCMA_CORE_PCIE2))
bus->host_is_pcie2 = true;

/* Register */
err = bcma_bus_register(bus);
if (err)
goto err_pci_unmap_mmio;
goto err_unregister_cores;

pci_set_drvdata(dev, bus);

out:
return err;

err_unregister_cores:
bcma_unregister_cores(bus);
err_pci_unmap_mmio:
pci_iounmap(dev, bus->mmio);
err_pci_release_regions:
Expand Down Expand Up @@ -283,9 +293,12 @@ static const struct pci_device_id bcma_pci_bridge_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4357) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4358) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4359) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4360) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4365) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a0) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43aa) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43b1) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4727) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43227) }, /* 0xa8db, BCM43217 (sic!) */
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43228) }, /* 0xa8dc */
Expand All @@ -310,3 +323,31 @@ void __exit bcma_host_pci_exit(void)
{
pci_unregister_driver(&bcma_pci_bridge_driver);
}

/**************************************************
* Runtime ops for drivers.
**************************************************/

/* See also pcicore_up */
void bcma_host_pci_up(struct bcma_bus *bus)
{
if (bus->hosttype != BCMA_HOSTTYPE_PCI)
return;

if (bus->host_is_pcie2)
bcma_core_pcie2_up(&bus->drv_pcie2);
else
bcma_core_pci_up(&bus->drv_pci[0]);
}
EXPORT_SYMBOL_GPL(bcma_host_pci_up);

/* See also pcicore_down */
void bcma_host_pci_down(struct bcma_bus *bus)
{
if (bus->hosttype != BCMA_HOSTTYPE_PCI)
return;

if (!bus->host_is_pcie2)
bcma_core_pci_down(&bus->drv_pci[0]);
}
EXPORT_SYMBOL_GPL(bcma_host_pci_down);
2 changes: 1 addition & 1 deletion drivers/bcma/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ static int bcma_register_devices(struct bcma_bus *bus)
return 0;
}

static void bcma_unregister_cores(struct bcma_bus *bus)
void bcma_unregister_cores(struct bcma_bus *bus)
{
struct bcma_device *core, *tmp;

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath10k/ce.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct ath10k_ce_pipe;
#define CE_DESC_FLAGS_GATHER (1 << 0)
#define CE_DESC_FLAGS_BYTE_SWAP (1 << 1)
#define CE_DESC_FLAGS_META_DATA_MASK 0xFFFC
#define CE_DESC_FLAGS_META_DATA_LSB 3
#define CE_DESC_FLAGS_META_DATA_LSB 2

struct ce_desc {
__le32 addr;
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/wireless/ath/ath10k/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,16 +436,16 @@ static int ath10k_download_fw(struct ath10k *ar, enum ath10k_firmware_mode mode)

static void ath10k_core_free_firmware_files(struct ath10k *ar)
{
if (ar->board && !IS_ERR(ar->board))
if (!IS_ERR(ar->board))
release_firmware(ar->board);

if (ar->otp && !IS_ERR(ar->otp))
if (!IS_ERR(ar->otp))
release_firmware(ar->otp);

if (ar->firmware && !IS_ERR(ar->firmware))
if (!IS_ERR(ar->firmware))
release_firmware(ar->firmware);

if (ar->cal_file && !IS_ERR(ar->cal_file))
if (!IS_ERR(ar->cal_file))
release_firmware(ar->cal_file);

ar->board = NULL;
Expand Down
Loading

0 comments on commit 28c0f02

Please sign in to comment.