mca80211: add support for b43 on bcma bus.

This makes b43 work on broadcom SoCs using bcma as system bus.

SVN-Revision: 27734
lede-17.01
Hauke Mehrtens 2011-07-23 11:25:05 +00:00
parent 49f4d4217e
commit 96b6f27271
6 changed files with 2700 additions and 6 deletions

View File

@ -852,6 +852,7 @@ endef
define KernelPackage/b43
$(call KernelPackage/b43-common)
DEPENDS+= +@DRIVER_11N_SUPPORT +!TARGET_brcm47xx:kmod-bcma
TITLE:=Broadcom 43xx wireless support
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43/b43.ko
AUTOLOAD:=$(call AutoLoad,30,b43)
@ -864,7 +865,7 @@ define KernelPackage/b43/config
choice
prompt "b43 firmware version"
default B43_FW_4_150
default B43_FW_5_10
help
This option allows you to select the version of the b43 firmware.
@ -922,8 +923,7 @@ define KernelPackage/b43/config
config B43_FW_SQUASH_COREREVS
string "Core revisions to include"
depends on B43_FW_SQUASH
default "5,6,7,8,9,10,11,13,14,15,16" if PACKAGE_B43_PHY_N
default "5,6,7,8,9,10,13,14,15" if !PACKAGE_B43_PHY_N
default "5,6,7,8,9,10,11,13,14,15,16"
help
This is a comma seperated list of core revision numbers.
@ -936,8 +936,7 @@ define KernelPackage/b43/config
config B43_FW_SQUASH_PHYTYPES
string "PHY types to include"
depends on B43_FW_SQUASH
default "G,LP,N" if PACKAGE_B43_PHY_N
default "G,LP" if !PACKAGE_B43_PHY_N
default "G,LP,N"
help
This is a comma seperated list of PHY types:
A => A-PHY
@ -973,12 +972,30 @@ define KernelPackage/b43/config
config PACKAGE_B43_PHY_N
bool "Enable support for N-PHYs"
select B43_FW_5_10
default n
default y
help
Enable support for BCM4321 and BCM4322.
Currently only 11g speed is available.
If unsure, say Y.
config PACKAGE_B43_PHY_HT
bool "Enable support for HT-PHYs"
select B43_FW_5_10
default n
help
Currently borken.
If unsure, say N.
config PACKAGE_B43_PHY_LCN
bool "Enable support for LCN-PHYs"
select B43_FW_5_10
default n
help
Currently borken.
If unsure, say N.
endmenu
@ -1045,7 +1062,12 @@ BUILDFLAGS:= \
$(if $(CONFIG_ATH_USER_REGD),-DATH_USER_REGD=1) \
$(if $(CONFIG_PACKAGE_B43_DEBUG),-DCONFIG_B43_DEBUG) \
$(if $(CONFIG_PACKAGE_B43_PIO),-DCONFIG_B43_PIO) \
$(if $(CONFIG_PACKAGE_B43_PIO),-DCONFIG_B43_BCMA_PIO) \
$(if $(CONFIG_PACKAGE_B43_PHY_N),-DCONFIG_B43_PHY_N) \
$(if $(CONFIG_PACKAGE_B43_PHY_HT),-DCONFIG_B43_PHY_HT) \
$(if $(CONFIG_PACKAGE_B43_PHY_LCN),-DCONFIG_B43_PHY_LCN) \
-DCONFIG_B43_BCMA \
-DCONFIG_B43_SSB \
$(if $(CONFIG_PACKAGE_RT2X00_LIB_DEBUGFS),-DCONFIG_RT2X00_LIB_DEBUGFS) \
$(if $(CONFIG_PACKAGE_RT2X00_DEBUG),-DCONFIG_RT2X00_DEBUG) \
$(if $(NEED_RT2X00_LIB_HT),-DCONFIG_RT2X00_LIB_HT) \
@ -1081,7 +1103,12 @@ MAKE_OPTS:= \
CONFIG_B43LEGACY=$(if $(CONFIG_PACKAGE_kmod-b43legacy),m) \
CONFIG_B43_DEBUG=$(if $(CONFIG_PACKAGE_B43_DEBUG),y) \
CONFIG_B43_PIO=$(if $(CONFIG_PACKAGE_B43_PIO),y) \
CONFIG_B43_BCMA_PIO=$(if $(CONFIG_PACKAGE_B43_PIO),y) \
CONFIG_B43_PHY_N=$(if $(CONFIG_PACKAGE_B43_PHY_N),y) \
CONFIG_B43_PHY_HT=$(if $(CONFIG_PACKAGE_B43_PHY_HT),y) \
CONFIG_B43_PHY_LCN=$(if $(CONFIG_PACKAGE_B43_PHY_LCN),y) \
CONFIG_B43_BCMA=y \
CONFIG_B43_SSB=y \
CONFIG_ATH_COMMON=$(if $(CONFIG_PACKAGE_kmod-ath),m) \
CONFIG_ATH_DEBUG=$(if $(CONFIG_PACKAGE_ATH_DEBUG),y) \
CONFIG_ATH9K_PKTLOG=$(if $(CONFIG_PACKAGE_ATH_DEBUG),y) \
@ -1199,6 +1226,7 @@ define Build/Prepare
$(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
$(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(PKG_LINUX_FIRMWARE_SOURCE)
rm -rf $(PKG_BUILD_DIR)/include/linux/ssb
rm -rf $(PKG_BUILD_DIR)/include/linux/bcma
rm -f $(PKG_BUILD_DIR)/include/net/ieee80211.h
endef

View File

@ -0,0 +1,11 @@
--- a/drivers/net/wireless/b43/main.c~ 2011-07-23 00:33:46.573306410 +0200
+++ b/drivers/net/wireless/b43/main.c 2011-07-23 00:36:14.657726075 +0200
@@ -4955,7 +4955,7 @@
static void b43_wireless_core_detach(struct b43_wldev *dev)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
- if (dev->sdev->bus->bustype != SSB_BUSTYPE_SDIO)
+ if (dev->dev->sdev->bus->bustype != SSB_BUSTYPE_SDIO)
compat_destroy_threaded_irq(&dev->irq_compat);
#endif
/* We release firmware that late to not be required to re-request

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,40 @@
From f706821596d8a3dcda314c38b13d91f108fdc435 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Fri, 22 Jul 2011 17:10:29 +0200
Subject: [PATCH 21/22] b43: read correct register on bcma bus.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/net/wireless/b43/dma.c | 20 +++++++++++++++++---
1 files changed, 17 insertions(+), 3 deletions(-)
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -795,9 +795,23 @@ static u64 supported_dma_mask(struct b43
u32 tmp;
u16 mmio_base;
- tmp = b43_read32(dev, SSB_TMSHIGH);
- if (tmp & SSB_TMSHIGH_DMA64)
- return DMA_BIT_MASK(64);
+ switch (dev->dev->bus_type) {
+#ifdef CONFIG_B43_BCMA
+ case B43_BUS_BCMA:
+ tmp = bcma_aread32(dev->dev->bdev, BCMA_IOST);
+ if (tmp & BCMA_IOST_DMA64)
+ return DMA_BIT_MASK(64);
+ break;
+#endif
+#ifdef CONFIG_B43_SSB
+ case B43_BUS_SSB:
+ tmp = ssb_read32(dev->dev->sdev, SSB_TMSHIGH);
+ if (tmp & SSB_TMSHIGH_DMA64)
+ return DMA_BIT_MASK(64);
+ break;
+#endif
+ }
+
mmio_base = b43_dmacontroller_base(0, 0);
b43_write32(dev, mmio_base + B43_DMA32_TXCTL, B43_DMA32_TXADDREXT_MASK);
tmp = b43_read32(dev, mmio_base + B43_DMA32_TXCTL);

View File

@ -0,0 +1,26 @@
Fixes bug described in:
https://bugzilla.kernel.org/show_bug.cgi?id=39172
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
John: this is trivial and fixes quite ugly memory (linked list exactly)
corruption. I believe this fix should be taken for 3.1.
---
drivers/net/wireless/b43/bus.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
--- a/drivers/net/wireless/b43/bus.c
+++ b/drivers/net/wireless/b43/bus.c
@@ -244,10 +244,12 @@ void b43_bus_set_wldev(struct b43_bus_de
#ifdef CONFIG_B43_BCMA
case B43_BUS_BCMA:
bcma_set_drvdata(dev->bdev, wldev);
+ break;
#endif
#ifdef CONFIG_B43_SSB
case B43_BUS_SSB:
ssb_set_drvdata(dev->sdev, wldev);
+ break;
#endif
}
}

View File

@ -0,0 +1,21 @@
From 46c79b0cdc60a974da409d641a69086694046ea0 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Fri, 22 Jul 2011 17:47:46 +0200
Subject: [PATCH 23/23] b43: add core rev 17 used on bcma SoC
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/net/wireless/b43/main.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -120,6 +120,7 @@ MODULE_PARM_DESC(pio, "Use PIO accesses
#ifdef CONFIG_B43_BCMA
static const struct bcma_device_id b43_bcma_tbl[] = {
+ BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x11, BCMA_ANY_CLASS),
BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x17, BCMA_ANY_CLASS),
BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x18, BCMA_ANY_CLASS),
BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_80211, 0x1D, BCMA_ANY_CLASS),