|
From 7ee21e611e94186196fc8ac4df1b41ded3e15cf3 Mon Sep 17 00:00:00 2001 |
|
From: sawyer <cx@radxa.com> |
|
Date: Fri, 11 Feb 2022 10:39:56 +0800 |
|
Subject: [PATCH] brcmfmac: Add BCM43454/6 support |
|
|
|
BCM43454/6 is an old variant of BCM4345 and it is exactly identical to |
|
BCM4345/6, except the initial chip id is 0xa9be. After newer firmware |
|
is loaded, the chip id becomes 0x4345. This patch handles the 0xa9be |
|
chips in the same way as BCM4345. |
|
|
|
https://gist.github.com/kagurazakakotori/ea952c539109f5b5a78112f47084708b |
|
This patch is provided by kagurazakakotori@gmail.com |
|
--- |
|
brcmfmac/Makefile | 4 ++-- |
|
brcmfmac/chip.c | 2 ++ |
|
brcmfmac/feature.c | 3 ++- |
|
brcmfmac/sdio.c | 1 + |
|
include/brcm_hw_ids.h | 1 + |
|
5 files changed, 8 insertions(+), 3 deletions(-) |
|
|
|
diff --git a/brcmfmac/Makefile b/brcmfmac/Makefile |
|
index 9b15bc3..3f13c75 100644 |
|
--- a/brcmfmac/Makefile |
|
+++ b/brcmfmac/Makefile |
|
@@ -6,8 +6,8 @@ |
|
# |
|
|
|
ccflags-y += \ |
|
- -I $(srctree)/$(src) \ |
|
- -I $(srctree)/$(src)/../include |
|
+ -I $(brcmfmac_src) \ |
|
+ -I $(brcmfmac_src)/../include |
|
|
|
obj-$(CONFIG_BRCMFMAC) += brcmfmac.o |
|
brcmfmac-objs += \ |
|
diff --git a/brcmfmac/chip.c b/brcmfmac/chip.c |
|
index a3a2570..04d70ee 100644 |
|
--- a/brcmfmac/chip.c |
|
+++ b/brcmfmac/chip.c |
|
@@ -702,6 +702,7 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci) |
|
{ |
|
switch (ci->pub.chip) { |
|
case BRCM_CC_4345_CHIP_ID: |
|
+ case BRCM_CC_43454_CHIP_ID: |
|
return 0x198000; |
|
case BRCM_CC_4335_CHIP_ID: |
|
case BRCM_CC_4339_CHIP_ID: |
|
@@ -1388,6 +1389,7 @@ bool brcmf_chip_sr_capable(struct brcmf_chip *pub) |
|
case BRCM_CC_4354_CHIP_ID: |
|
case BRCM_CC_4356_CHIP_ID: |
|
case BRCM_CC_4345_CHIP_ID: |
|
+ case BRCM_CC_43454_CHIP_ID: |
|
/* explicitly check SR engine enable bit */ |
|
pmu_cc3_mask = BIT(2); |
|
/* fall-through */ |
|
diff --git a/brcmfmac/feature.c b/brcmfmac/feature.c |
|
index 0dcefbd..d8a6808 100644 |
|
--- a/brcmfmac/feature.c |
|
+++ b/brcmfmac/feature.c |
|
@@ -247,7 +247,8 @@ void brcmf_feat_attach(struct brcmf_pub *drvr) |
|
brcmf_feat_firmware_capabilities(ifp); |
|
memset(&gscan_cfg, 0, sizeof(gscan_cfg)); |
|
if (drvr->bus_if->chip != BRCM_CC_43430_CHIP_ID && |
|
- drvr->bus_if->chip != BRCM_CC_4345_CHIP_ID) |
|
+ drvr->bus_if->chip != BRCM_CC_4345_CHIP_ID && |
|
+ drvr->bus_if->chip != BRCM_CC_43454_CHIP_ID) |
|
brcmf_feat_iovar_data_set(ifp, BRCMF_FEAT_GSCAN, |
|
"pfn_gscan_cfg", |
|
&gscan_cfg, sizeof(gscan_cfg)); |
|
diff --git a/brcmfmac/sdio.c b/brcmfmac/sdio.c |
|
index 3d43e03..354843f 100644 |
|
--- a/brcmfmac/sdio.c |
|
+++ b/brcmfmac/sdio.c |
|
@@ -641,6 +641,7 @@ static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = { |
|
BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFFE, 43430A1), |
|
BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0x00000200, 43456), |
|
BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFDC0, 43455), |
|
+ BRCMF_FW_ENTRY(BRCM_CC_43454_CHIP_ID, 0x00000040, 43455), |
|
BRCMF_FW_ENTRY(BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, 4354), |
|
BRCMF_FW_ENTRY(BRCM_CC_4356_CHIP_ID, 0xFFFFFFFF, 4356), |
|
BRCMF_FW_ENTRY(BRCM_CC_4359_CHIP_ID, 0xFFFFFFFF, 4359), |
|
diff --git a/include/brcm_hw_ids.h b/include/brcm_hw_ids.h |
|
index c6c4be0..182808c 100644 |
|
--- a/include/brcm_hw_ids.h |
|
+++ b/include/brcm_hw_ids.h |
|
@@ -32,6 +32,7 @@ |
|
#define BRCM_CC_4339_CHIP_ID 0x4339 |
|
#define BRCM_CC_43430_CHIP_ID 43430 |
|
#define BRCM_CC_4345_CHIP_ID 0x4345 |
|
+#define BRCM_CC_43454_CHIP_ID 43454 |
|
#define BRCM_CC_43465_CHIP_ID 43465 |
|
#define BRCM_CC_4350_CHIP_ID 0x4350 |
|
#define BRCM_CC_43525_CHIP_ID 43525 |
|
-- |
|
2.25.1 |
I'd like to suggest using the "inbox" firmware (In
linux-firmware
package) or a newer version of cypress firmware (brcmfmac43455-sdio.bin and brcmfmac43455-sdio.clm_blob). In both cases, only radxa-provided nvram .txt file is needed.The radxa-provided firmware got some bugs. It will "crossflash" the chip to BCM43455, changing the chip id from
0xa9be
to0x4345
(The chip id can be restored by power cycle/cold reset). And it seems doesn't support the "power management" feature, when the device is idle for some time, it will stop working unless you power cycle the board. The "inbox" or cypress firmware have no such issue, at least in my testing.The WLAN MAC address is defined in the nvram .txt file. Edit it if you have multiple boards connecting to the same network.