Wifi on ROCK Pi 4

Hello!

I was trying out some new hardware to install OpenWRT, so I bought the Rock Pi 4b. Infos on the board:

https://wiki.radxa.com/Rockpi4

I installed successfully via SD card from the following image:

openwrt-21.02.2-rockchip-armv8-radxa_rock-pi-4-ext4-sysupgrade.img

That works so far.

I tried to setup the wifi - first of all, I do not have the menu entry under Network - Wireless. Tried to install kmod-rtl8xxxu but that does not help.

Any idea i will get the wifi working?

I have been reading, that they used the AP6255 chip for wifi and bluetooth.

Thanks

Model ?

https://wiki.radxa.com/Rockpi4/getting_started#get_start_specs

its: Rock Pi 4 Model B OP1 4GB/32GB

At least the PCB pictures suggest an AMPAK AP6256 SDIO based wireless module (please confirm if that is correct), so not Realtek, but Broadcom/ Cypress BCM43456, which would imply brcmfmac instead of rtl8xxxu. (better than Realtek, but still no good for serious use --> see RPi wireless shortcomings).

Yes, you are right, it is the AMPAK AP6256. So I need to install: cypress-firmware-43455-sdio ?

you probably should start with brcmfmac, then matching brcmfmac-firmware-??????-???, if needed

ROCK PI 4 WiFi is not OpenWrt supported yet because the firmware 43456 is not available in the official linux firmware, has been submitted upstream and not accepted for licence issues. https://lore.kernel.org/linux-firmware/CAMEGJJ2XYvGEekfLzjL1KE6VUF-71s+S8RbJ1DuBkYU98F9nsg@mail.gmail.com/
You will need to build your own firmware to get the WiFi working,adding this 2 patches
https://github.com/mj22226/openwrt/commit/78ab00450c2a0f12ceb190cb1dbddc6306abecfe.patch
https://github.com/mj22226/openwrt/commit/6db223c41ceb9ab4b424b81c01779609d5f038e8.patch

Testing build:https://www.dropbox.com/s/i8dl8mkltg0btr9/openwrt-21.02.2-rockchip-armv8-radxa_rock-pi-4-squashfs-sysupgrade.img.gz?dl=0

2 Likes

thank you for the detailed answer... So I have to compile the firmware myself? How do I do so? Is it from the following repo?

I know more or less how to compile things. I assume I crosscompile it.

Is there no repo where someone did compile the brcmfmac43456-sdio.bin for rock pi? Like a openwrt-nonfree repo ...

I extracted your dropbox link from above and found the following files:

./lib/firmware/brcm/brcmfmac43456-sdio.bin
./lib/firmware/brcm/brcmfmac43456-sdio.clm_blob
./lib/firmware/brcm/brcmfmac43456-sdio.radxa,rockpi4.txt
./usr/lib/opkg/info/brcmfmac-firmware-43456-sdio-rockpi-4.control
./usr/lib/opkg/info/brcmfmac-firmware-43456-sdio-rockpi-4.list
./usr/lib/opkg/info/brcmfmac-firmware-43456-sdio-rockpi-4.prerm
./usr/lib/opkg/info/brcmfmac-firmware-43456-sdio.control
./usr/lib/opkg/info/brcmfmac-firmware-43456-sdio.list
./usr/lib/opkg/info/brcmfmac-firmware-43456-sdio.prerm

I copied those files onto my existing openwrt installation, but does not seem to work

if I copy the firmware like in the post above, or from:

How does the kernel know, that the firmware is available?

In the following link is a description how someone copied the firmware into arch linux. At the end it says: "Regenerate initramfs and reboot." Can this be done the same way in openwrt?

https://archlinuxarm.org/forum/viewtopic.php?f=64&t=15142

you should see it in dmesg, it'll try to find, and load the fw file.

mmh, strange... dmesg | grep brcm shows nothing

I copied the whole /lib/firmware/brcm folder from a working Manjaro installation...

On the Manjaro installation I get:

$ dmesg  | grep brcm 
[    5.505391] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43456-sdio for chip BCM4345/9
[    5.511260] usbcore: registered new interface driver brcmfmac
[    5.519039] brcmfmac mmc2:0001:1: Direct firmware load for brcm/brcmfmac43456-sdio.radxa,rockpi4b.bin failed with error -2
[    5.970330] Bluetooth: hci1: BCM4345C5 'brcm/BCM4345C5.hcd' Patch
[    7.656159] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43456-sdio for chip BCM4345/9
[    7.672275] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/9 wl0: Feb 11 2020 11:54:51 version 7.45.96.61 (be7af2d@shgit) (r745790) FWID 01-a41d86bd es7.c5.n4.a3

sad it's not working with openwrt, while on other distros it seems to work and the solution seems so close

That image is to be used as a system upgrade or installed in a SD card, extracting files will not work in rockchip target, kmod-brcmfmac need SDIO support to work, build the firmware is your best option https://openwrt.org/docs/guide-developer/toolchain/beginners-build-guide

1 Like

ah ok - now it worked !!! I did the system upgrade with the file you provided via dropbox and now it seems to work.

But this is kind of black magic. Is it possible to somehow release this Testing build? I will later try to create a wiki page for this device, so future users don't need to tap in the dark so much.

Please use https://openwrt.org/meta/create_new_device_page for this.

Hello again. So, I am still a bit, or even a bit more, confused.

From the above messages, it means, that for the Rock Pi 4 to work with the wireless firmware, it needs its own build, because the firmware cannot be installed via opkg and cannot be loaded afterwards.

The firmware is available on several git repositories, the firmware also works. But why is there no build for it?

@mj82 shared a build, why is this one not downloadable via the normal OpenWRT way?

Thing is: What I don't get, as a user, is why I cant install it the normal way even though everything seems to exist. How can we provide an installation for future users?

Hope to find a way to fix this. Best regards

because it's proprietary, and there's no public/free/open release, compare with Raspberry Pi Zero 2 W - #7 by stintel