Banana Pi BPI-R4 Wifi 7 Module design

We have not even the wifi module running with mainline code… Waiting for first messages about wifi not working when it is available :smiley:

1 Like

This will also require a known working WiFi 7 setup to test, yes?

Of course,but at least wifi interfaces need to come up with the right firmware

Eagerly anticipated Wi-Fi 7 module. Best wishes to everyone, regardless of the number of antennas. Is it going to be released soon?

:smiling_face_with_tear: (quotes do not count towards the minimum 20 characters to post a reply)

Remember that this was posted in July last year.

wifi 7 function test ok ,all hardware function test ok .

That was nine months ago.

1 Like

That was the 14 antenna version and bpi does not use mainline code.you should just know that having the hardware is not enough. It must be supported by the system you want (mostly upstream openwrt i guess).

Hi,

It is a shame mediatek do not publish datasheets on these chips. It would be easier for the open source community to write drivers and fix driver bugs. There is also the binary blob firmware for the chips. That needs to be functioning also.

Mediatek and bpi sharing their downstream driver which need to be upported and made accepted in mainline…thats what i tried,but can’t get the firmware loading part working

@frank-w Might the firmware loading problem be related to power or clk ?

Maybe try the following boot parameters?

pd_ignore_unused=1 clk_ignore_unused=1 regulator_ignore_unused=1

no, i have to add another firmware and load it…this is the firmware-loading code which must be upported to mainline (i tried, but it seems something is missing)

There is a standard firmware loading method in the kernel. One puts the firmware in /lib/firmware and there is a kernel api to load it temporarily into ram. You then use your driver specific method to get it into the device. Are you using a different method to try to load the firmware?

Example code:

static bool _rtl92e_fw_prepare(struct net_device *dev, struct rt_fw_blob *blob,
                               const char *name, u8 padding)
{
        const struct firmware *fw;
        int rc, i;
        bool ret = true;

        rc = request_firmware(&fw, name, &dev->dev);
        if (rc < 0)
                return false;

        if (round_up(fw->size, 4) > MAX_FW_SIZE - padding) {
                netdev_err(dev, "Firmware image %s too big for the device.\n",
                           name);
                ret = false;
                goto out;
        }

        if (padding)
                memset(blob->data, 0, padding);
        if (fw->size % 4)
                memset(blob->data + padding + fw->size, 0, 4);
        memcpy(blob->data + padding, fw->data, fw->size);

        blob->size = round_up(fw->size, 4) + padding;

        /* Swap endian - firmware is packaged in invalid endiannes*/
        for (i = padding; i < blob->size; i += 4) {
                u32 *data = (u32 *)(blob->data + i);
                *data = swab32p(data);
        }
out:
        release_firmware(fw);
        return ret;
}

see mtk:wifi commits in 6.8-dango tree

before loading firmware it must be detected which chip is used and some additional fields are needed to be read from firmware or set inside driver

These are patches i tried upporting from bpi repo

When up-porting patches, it is sometimes easier to look at the old kernel, with all the patches applied, and then just follow through in the code how it identifies the chip and loads the firmware, and then modify your code to do something similar. If patches are small patches, you can sometimes just cherry pick them, but for more complex ones, I find just looking at the old kernel, with all the patches applied, is easier to follow and get right.

mt76 codebase above cannot be compiled due to missing Makefile or code error (/scripts/basic/Makefile is an absolute path which is imho wrong)

already reported here from @graphine: Banana Pi BPI-R4 Wifi 7 router board with MediaTek MT7988A (Filogic 880),4G RAM and 8G eMMC - #198 by graphine

make[5]: Entering directory 'BPI-R4-MT76-OPENWRT-V21.02/build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_mt7988/linux-5.4.260
scripts/Makefile.build:42: /scripts/basic/Makefile: No such file or directory

the Makefile.build looks like this:

 39 # The filename Kbuild has precedence over Makefile
 40 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
 41 kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile)
 42 include $(kbuild-file)

not sure where the “basic” path comes from…ubuntu 18 is outdated :stuck_out_tongue:

using ubuntu 22.04 and gcc 11…but openwrt builds its own gcc (musl), so this should be not the cause

i see it is already reported BPI-R4 | Compilation error. Please help me! seems there is more than this error and i have not found a hint how to fix this one

I posted a solution for that here Banana Pi BPI-R4 Wifi 7 router board with MediaTek MT7988A (Filogic 880),4G RAM and 8G eMMC - #226 by graphine

It builds fine, just cannot make any changes or build crashes. Making the correct build environment was harder than building the image. I can let you use my build environment, or I can just give you the built image.

which environment do you use?

using image does not help much as i need to add debugs afterwards to compare with upported code

Ubuntu 20.04. Kernel 5.4. Do not update kernel. Switch to gcc 10 and c++ 10. Built fine after that.

No matter what I changed it would cause build to fail. Couldn’t add any drivers or anything. Atleast any changes I tried to make.