Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
BCM43454/6 kernel driver patch
From 7ee21e611e94186196fc8ac4df1b41ded3e15cf3 Mon Sep 17 00:00:00 2001
From: sawyer <>
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.
This patch is provided by
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)
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,
&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_4345_CHIP_ID, 0x00000200, 43456),
+ BRCMF_FW_ENTRY(BRCM_CC_43454_CHIP_ID, 0x00000040, 43455),
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
  1. install needed tools
sudo apt-get install -y make gcc dpkg-dev git vim
  1. enable deb-src of kernel module
sudo vi /etc/apt/sources.list
# uncommont deb-src, delete '#'
# change
# deb-src focal-updates main restricted
# to 
deb-src focal-updates main restricted
  1. download kernel source
sudo apt update && sudo apt-get source linux-image-unsigned-$(uname -r)
# If you see error: "couldn't be accessed by user '_apt'", execute: 
#  sudo chown -R _apt /var/lib/update-notifier/package-data-downloads/partial/
# then try again.
  1. get and apply patch
cd linux-hwe-*/drivers/net/wireless/broadcom/brcm80211
sudo wget

# maybe some conflict, please add --reject option and edit manually.
sudo git apply 0001-brcmfmac-Add-BCM43454-6-support.patch
  1. make brcmfmac.ko
cd brcmfmac
sudo make -C /lib/modules/$(uname -r)/build M=$(pwd) brcmfmac_src=$(pwd) modules
  1. backup existing brcmfmac.ko and override new one
sudo cp /lib/modules/$(uname -r)/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko  /lib/modules/$(uname -r)/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko.bak
sudo cp brcmfmac.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko
  1. replace nv file and fw files
# Download radxa nvram
sudo wget -O "/lib/firmware/brcm/brcmfmac43455-sdio.Radxa-ROCK Pi X.txt"

# Backup existing firmware file
sudo mv /lib/firmware/brcm/brcmfmac43455-sdio.bin /lib/firmware/brcm/brcmfmac43455-sdio.bin.bak
sudo mv /lib/firmware/brcm/brcmfmac43455-sdio.clm_blob /lib/firmware/brcm/brcmfmac43455-sdio.clm_blob.bak

# Download latest 7.45.241 firmware
sudo wget -O /lib/firmware/brcm/brcmfmac43455-sdio.bin
sudo wget -O /lib/firmware/brcm/brcmfmac43455-sdio.clm_blob
  1. rmmod driver and insmod again
sudo rmmod brcmfmac
sudo insmod /lib/modules/$(uname -r)/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko
Copy link

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 to 0x4345 (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.

Copy link

@kagurazakakotori I changed step 7. Copied your commands from radxa forum.

Copy link

Is there any value in providing the community with an tgz with all this done for particular setups? For example, I have a package that was built for a hwe Ubuntu 20.04 installation that also has the .bin and .txt from the Radxa website and a simple script to install everything to the right location and reload the module. I realize that this would likely be outdated the second the kernel version changes, but since it took me a decent amount of time to get to this point, and some RockPiX users will have very little confidence in starting the process of building a kernel module, maybe it is worthwhile?

Copy link

Sorry, big noob here
do I understand correctly, that this is a patch that allows you to enable the BCM-43453-support for linux images on the rock pi X? and if yes, how do I do it? I tried to follow all the steps, and for some reasons I had to move the "include-files" to the system path manually, but after that it successfully executed everything. However, the wifi module was still not working. I am probably jusst missing something obvious. If you have time, I'd be glad for some help.

Copy link

do I understand correctly, that this is a patch that allows you to enable the BCM-43453-support for linux images on the rock pi X?

No, It's BCM-43454.

However, the wifi module was still not working. I am probably jusst missing something obvious. If you have time, I'd be glad for some help.

It will be helpful if you can attach terminal output to this topic

Copy link

I posted my terminal output on the forum

Copy link

Following this tutorial I indeed solved the no Wi-Fi problem with AP6254, but for a normal Linux user who is not a professional developer, I found this procedure quite challenging. It would be better if the manufacturer can pack these trivialities altogether.

Copy link

Is there a way to install the driver on a debian 11 system?

Copy link

On the latest 20.04 Ubuntu HWE just released 5.15 based kernel, it still doesn’t find the WiFi when the stock WiFi files provided on the Radix site are dumped in brcm. I’ll try this solution as I’d like to provide WiFi support for the rock pi x right out of the box when DragonOS Focal (20.04 SDR based distro) is loaded as the OS.

Copy link

any updates on this? seam to be not working for me

Copy link

sudo wget -O /lib/firmware/brcm/brcmfmac43455-sdio.bin

receives 404 Not Found now.

Copy link

looks like it has been renamed as cyfmac43455-sdio-standard.bin

Copy link

@LiukDiihMieu do provide an update on this, im also unable to update it well

Copy link

kagurazakakotori commented Sep 20, 2022

@LiukDiihMieu @jasperchua99 You may try this cypress cyfmac43455 firmware blob from linux-firmware

If you have linux-firmware package installed on your system, these files are also available at /lib/firmware/cypress, both coping it or creating symlink works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment