Wifi not working with firmware installed in ubuntu 20.04.3

With some modification in kernel brcmfmac driver, the chip id of BCM43454/6 is 0xa9be(43454), which is not supported in upstream driver.

However, after adding the 0xa9be id to the driver and load the radxa-provided firmware, its chip id becomes 0x4345 and it is recorgnized as BCM4345/6. I guess the BCM43454/6 and BCM4345/6 are the same chip, but the former one seems to be an older variant.

The radxa-provided firmware (7.45.96.76) got some bugs. WPA3 is not supported. When power management is on, the driver will crash after hardware enters standby mode.

I tried crossflash the cypress firmware for raspberry pi 3b/4b (7.45.241, https://github.com/RPi-Distro/firmware-nonfree/tree/bullseye/debian/config/brcm80211/cypress), both WPA3 and power management works. WPA3 is still not supported,but power management seems to be working. This firmware wonā€™t change chip id as well.

Also tried inbox firmware in Ubuntu 20.04, linux-firmware 1.187.25 (7.45.18) and Ubuntu 21.10, linux-firmware 1.201.3 (7.45.234). Both seems to be working, except WPA3, and the chip id remains 0xa9be.

Patches for enabling BCM43454/6 (0xa9be) chip is uploaded to https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git/commit/?id=ed26edf7bfd9aa3ea23299c949312c5313c115b8

Steps to install radxa nvram and cypress 7.45.241 firmware. Only downloading radxa nvram file and using the inbox firmware will also work.

# Download radxa nvram
sudo wget https://raw.githubusercontent.com/radxa/rkwifibt/master/firmware/broadcom/AP6254/wifi/nvram_ap6254.txt -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 https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/bullseye/debian/config/brcm80211/cypress/cyfmac43455-sdio.bin -O /lib/firmware/brcm/brcmfmac43455-sdio.bin
sudo wget https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/bullseye/debian/config/brcm80211/cypress/cyfmac43455-sdio.clm_blob -O /lib/firmware/brcm/brcmfmac43455-sdio.clm_blob

And the wlan mac is defined in the nvram txt file. If you got multiple boards, you need to modify them to different values to use them under same network.

3 Likes

So I would have to recompile the entire kernel for this one driver? Was this patch pushed to mainline yet?

brcmfmac: brcmf_chip_tcm_rambase: unknown chip: BCM43454/6

I think you got the newer ROCK Pi X which is manufactured in 2022. We had to replace the WiFi/BT module to AP6254, which is the only dual band module that is Windows compatible. AP6255 is end of life now. It seems Linux doesnā€™t have AP6254 support, apply the ID patch, recompile the kernel, put the fw in /lib/firmware should just work.

1 Like


Only to compile ko file. you can follow my readme.

@kagurazakakotori Thanks for your help on the patch.

I believe only recompiling this module is okay since there is no other modules depend on it. @anon39001862 's link has a detailed step-by-step tutorial.

A good news is that just a few hours before I post this reply, the patch has been merged into wireless-next (https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git/commit/?id=ed26edf7bfd9aa3ea23299c949312c5313c115b8). Maybe in next kernel release, appling the patch and recompiling the module is no longer needed.

Credits to @nihui for lending me her board.

1 Like

Thanks Zhao, Jiaqing, this is good news.

When I try to execute
$sudo git apply 0001-brcmfmac-Add-BCM43454-6-support.patch
I get this error message:

luca@luca-ROCK-Pi-X:~/linux-hwe-5.13-5.13.0/drivers/net/wireless/broadcom/brcm80211$ sudo git apply 0001-brcmfmac-Add-BCM43454-6-support.patch
error: patch failed: brcmfmac/Makefile:6
error: brcmfmac/Makefile: patch does not apply
error: patch failed: brcmfmac/chip.c:702
error: brcmfmac/chip.c: patch does not apply
error: patch failed: brcmfmac/feature.c:247
error: brcmfmac/feature.c: patch does not apply
error: patch failed: brcmfmac/sdio.c:641
error: brcmfmac/sdio.c: patch does not apply
error: patch failed: include/brcm_hw_ids.h:32
error: include/brcm_hw_ids.h: patch does not apply

when I try it with the reject option I get this:

luca@luca-ROCK-Pi-X:~/linux-hwe-5.13-5.13.0/drivers/net/wireless/broadcom/brcm80211$ sudo git apply 0001-brcmfmac-Add-BCM43454-6-support.patch --reject
Checking patch brcmfmac/Makefileā€¦
error: while searching for:

ccflags-y +=
-I $(srctree)/$(src)
-I $(srctree)/$(src)/ā€¦/include

obj-$(CONFIG_BRCMFMAC) += brcmfmac.o
brcmfmac-objs += \

error: patch failed: brcmfmac/Makefile:6
Checking patch brcmfmac/chip.cā€¦
error: while searching for:
{
switch (ci->pub.chip) {
case BRCM_CC_4345_CHIP_ID:
return 0x198000;
case BRCM_CC_4335_CHIP_ID:
case BRCM_CC_4339_CHIP_ID:

error: patch failed: brcmfmac/chip.c:702
error: while searching for:
case BRCM_CC_4354_CHIP_ID:
case BRCM_CC_4356_CHIP_ID:
case BRCM_CC_4345_CHIP_ID:
/* explicitly check SR engine enable bit /
pmu_cc3_mask = BIT(2);
/
fall-through */

error: patch failed: brcmfmac/chip.c:1388
Checking patch brcmfmac/feature.cā€¦
error: while searching for:
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)
brcmf_feat_iovar_data_set(ifp, BRCMF_FEAT_GSCAN,
ā€œpfn_gscan_cfgā€,
&gscan_cfg, sizeof(gscan_cfg));

error: patch failed: brcmfmac/feature.c:247
Checking patch brcmfmac/sdio.cā€¦
error: while searching for:
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_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),

error: patch failed: brcmfmac/sdio.c:641
Checking patch include/brcm_hw_ids.hā€¦
error: while searching for:
#define BRCM_CC_4339_CHIP_ID 0x4339
#define BRCM_CC_43430_CHIP_ID 43430
#define BRCM_CC_4345_CHIP_ID 0x4345
#define BRCM_CC_43465_CHIP_ID 43465
#define BRCM_CC_4350_CHIP_ID 0x4350
#define BRCM_CC_43525_CHIP_ID 43525

error: patch failed: include/brcm_hw_ids.h:32
Applying patch brcmfmac/Makefile with 1 rejectā€¦
Rejected hunk #1.
Applying patch brcmfmac/chip.c with 2 rejectsā€¦
Rejected hunk #1.
Rejected hunk #2.
Applying patch brcmfmac/feature.c with 1 rejectā€¦
Rejected hunk #1.
Applying patch brcmfmac/sdio.c with 1 rejectā€¦
Rejected hunk #1.
Applying patch include/brcm_hw_ids.h with 1 rejectā€¦
Rejected hunk #1.

What am I doing wrong?

Your kernel version is a bit newer than the patch version.
You can either edit all file manually or you can share me this folder. And I will edit them and send back to you.

I have no idea what I should do, so if you have time it would be geat. What folder should I send to you over which platform?

I understand that you might not have time to edit the files for me, but it would be nice if you could just tell me what kernel version the patch works with.

i also needed help too on this

I sadly couldnā€™t test it, because my rock pi x broke unexpectedly and the replacement hasnā€™t arrived yet. But in the official kernel release notes it says, that the BCM43454/6 has been added to the devices supported by default in the 5.18 release (https://kernelnewbies.org/Linux_5.18#Networking-1 under brcmfmac). So if you update your kernel via ethernet to 5.18 or 5.19 (the latest stable version as of writing), it should work out without any additional tweaking. I would also be glad if you could post your outcome :slight_smile:

Side note:
Long hardware adoption times like this are why I donā€™t like linux

any updates on your side, did manage to get windows 10 driver working but not linux which i heavily need atm

No, sadly not. My new rock pi should arrive this week though, Iā€™ll update you as soon as i can.

Hey any updates on your side? Cos ive reach to support to see if anything can be done from their side

As of now, I couldnā€™t get it to work, even with a kernel that had the needed drivers (I double checked manually). it could just be a faulty wifi module though; the last board I had, shipped with a faulty ethernet port. Iā€™ll try to double check in windows.

Oic cos my wifi work in Windows not linux

dmesg | grep brcmfmac will provide some ideas about whatā€™s going wrong with the kernel driver.

You may also need to check if you have the firmware and the config file installed. The firmware file is at /lib/firmware/brcm/brcmfmac43455-sdio.bin. If this file does not exist, check if linux-firmware pacakge is installed. If still not, use the command below to install it manually.

sudo wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/cypress/cyfmac43455-sdio.bin -O /lib/firmware/brcm/brcmfmac43455-sdio.bin
sudo wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/cypress/cyfmac43455-sdio.clm_blob -O /lib/firmware/brcm/brcmfmac43455-sdio.clm_blob

The firmware config file is not included in distros, you need to download it from radxa and install it. The command is:

sudo wget https://raw.githubusercontent.com/radxa/rkwifibt/master/firmware/broadcom/AP6254/wifi/nvram_ap6254.txt -O "/lib/firmware/brcm/brcmfmac43455-sdio.Radxa-ROCK Pi X.txt"

Hopefully Radxa will be interested in adding this to linux-firmware so that there will be no need to install the txt file manually. I would be more than happy to help Radxa upstreaming this txt file.

https://www.armbian.com/uefi-x86/ just works OOB.

iwconfig 
lo        no wireless extensions.

enp1s0    no wireless extensions.

wlan0     IEEE 802.11  ESSID:"XXXX"  
      Mode:Managed  Frequency:5.24 GHz  Access Point: XX:XX:XX:XX:XX:XX   
      Bit Rate=175.5 Mb/s   Tx-Power=31 dBm   
      Retry short limit:7   RTS thr:off   Fragment thr:off
      Encryption key:off
      Power Management:off
      Link Quality=35/70  Signal level=-75 dBm  
      Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
      Tx excessive retries:0  Invalid misc:0   Missed beacon:0

The nvram needs to be named

brcmfmac43455-sdio.ROCK Pi-ROCK Pi X.txt

not

brcmfmac43455-sdio.Radxa-ROCK Pi X.txt

at least on debian testing. dmesg still shows this multiple times

sdio mmc2:0001:1: firmware: failed to load brcm/brcmfmac43455-sdio.ROCK Pi-ROCK Pi X.bin (-2)

but wifi and bluetooth works. debian needs to install firmware-brcm80211 as well

1 Like