Wifi not working with firmware installed in ubuntu 20.04.3

FYI, there seems to be a kernel issue.

Today I built stable kernel 5.16.6 for rockpix, and it seems to be an improvement over 5.12.2, IF it wasn’t just for a crowded channel at that time.

Yesterday:

wlan0     IEEE 802.11  ESSID:"FIBER-5G"  
          Mode:Managed  Frequency:5.5 GHz  Access Point: 94:EA:EA:AA:87:8F   
          Bit Rate=6 Mb/s   Tx-Power=31 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=63/70  Signal level=-47 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Today:

wlan0     IEEE 802.11  ESSID:"FIBER-5G"  
          Mode:Managed  Frequency:5.5 GHz  Access Point: 94:EA:EA:AA:87:8F   
          Bit Rate=351 Mb/s   Tx-Power=31 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=61/70  Signal level=-49 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

ubuntu@rockpix:~$ uname -ra
Linux rockpix 5.16.6-rockpix #1 SMP PREEMPT Sat Feb 5 10:57:32 -03 2022 x86_64 x86_64 x86_64 GNU/Linux

If you have not solved it yourself and wish I can push my customized ubuntu deb package to github, good luck.

I would rather have the build instructions for the kernel because radxa’s wiki makes no mention of requiring a custom built kernel for running an x86 ubuntu.
Where are you getting the kernel sources from? Mainline? Do they already have a defconfig or something for the rock pi x?
I can try your deb’s, but I’d like to know how you built it yourself. thanks!

No problem. This is a kernel issue, nothing to do with the board maker, all the sbc that use this chip are affected. You should blame Broadcom for overlooking their driver.
You can use Ubuntu’s defconfig and the usual instructions to build the kernel.
Preparing and pushing the deb and patch.

Kernel source: https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.16.7.tar.xz

You can try out the deb package in your v1.41 to confirm it works.

Please:

  • make a backup of your data (EFI grub files and relevant data)

  • install with:

    sudo dpkg -i linux-image-5.16.6-rockpix_5.16.6-rockpix-1_amd64.deb

If you plan to build your kernel, just apply the patch and use your defconfig.
If you use ubuntu’s kernel source you have to apply the patch manually, it is fairly easy.

Make sure you firmware is in:
/usr/lib/firmware/brcm

Files:

Just in time, don’t reboot after installing the deb package.
Check /boot if initrd has been created for your Ubuntu distro, something like:

ubuntu@rockpix:~$ ls /boot
System.map-5.11.1-rockpix  config-5.16.6-rockpix      modules.gz
System.map-5.12.1-rockpix  core.gz                    modules64.gz
System.map-5.12.2-rockpix  corepure64.gz              rootfs.gz
System.map-5.16.6-rockpix  efi                        vmlinuz
boot-gui.txt               grub                       vmlinuz-5.11.1-rockpix
boot_ubuntu.tar.gz         initrd.img-5.11.1-rockpix  vmlinuz-5.12.1-rockpix
config-5.11.1-rockpix      initrd.img-5.12.1-rockpix  vmlinuz-5.12.2-rockpix
config-5.12.1-rockpix      initrd.img-5.12.2-rockpix  vmlinuz-5.16.6-rockpix
config-5.12.2-rockpix      initrd.img-5.16.6-rockpix  vmlinuz64

If initrd.img-5.16.6-rockpix has not been created for any reason, before reboot, type in:

sudo update-initramfs -u -k all

This will re-generate all initrd.img-X.XX.X for kernels found in /usr/lib/modules/
And examine the grub file generated in EFI (UEFI). I hope is not too late.

PS: that a good reason to boot from USB where you can edit and restore files at will

Bottable USB img file

I made a bootable USB img file with minimal ubuntu 20.04.3 LTS so you can boot from USB without messing your stock kernel in eMMC.

Hope it works with v1.41
Good luck

2 Likes

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