[BPI-R64] mt7622 mac80211 WiFi driver

I had the same problem so hardcoded it into mt76 driver from OpenWRTMT7615e_7622_eeprom_hardcoded.patch (7.9 KB) TX power is working correct now. I did not trace if driver is using it as a real EEPROM but for read only calibration works ok.

I’ve connected 4 antennas to the board, how does the board decides which device uses which antenna?

Doing a speed test gives about 100mbps for each device if ran separately. If I run a speed test on 2 devices at the same time one device gets 40, another one gets 20, which looks like both devices use the same antenna.

Shouldn’t they bot get 100mbps and both use different antennas?

I’m running master openwrt.

[   21.396876] mt7622-wmac 18000000.wmac: HW/SW Version: 0x8a108a10, Build Time: 20190801210006a
[   21.427145] mt7622-wmac 18000000.wmac: N9 Firmware Version: 2.0, Build Time: 20200131180931

i guess currently only one antenna is used…i see a Patch on patchwork which seems to be related to this (but only pinctl), there should be also a driver+dts-change to use these pinctl to use multiple antennas

https://patchwork.kernel.org/patch/11792841/

Interesting find, I guess this only affects mt7622 wmac but not mt7615?

@moore any info on this?

Right,this patch is only for mt7622,but i guess for mt7615 there should be a similar way as mt7622 uses mt7615 core

Hi,

The four antennas on the board are all for MT7622 WiFi, could you explain more that what did you mean about “how does the board decides which device uses which antenna”?

I’ve tested the latest driver, and it can use rate MCS31 (4 antennas).

root@OpenWrt:/# iw phy | grep Antennas
        Available Antennas: TX 0xf RX 0xf
        Configured Antennas: TX 0xf RX 0xf

root@OpenWrt:/# iw dev wlan0 station dump
Station 2c:fd:a1:ce:5e:a9 (on wlan0)
        inactive time:  8 ms
        rx bytes:       12685717
        rx packets:     169384
        tx bytes:       812461366
        tx packets:     271666
        tx retries:     75596
        tx failed:      150
        rx drop misc:   1
        signal:         -43 [-43, -60, -44, -44] dBm
        signal avg:     -43 [-43, -59, -44, -44] dBm
        tx bitrate:     288.9 MBit/s MCS 31 short GI
        tx duration:    41637653 us
        rx bitrate:     288.9 MBit/s MCS 31 short GI
        rx duration:    1901454 us
1 Like

Needs the MCS31 mode enabled? How?

is your latest branch fixed to use 4 antennas?

i don’t know if i need additional patches to enable all 4 antennas…thats why i asked how to enable the mode to check

what he meant is to test the speed directly. If the speed of a single antenna is about 100Mbps, the speed of four antennas is more than 200Mbps.

there are two problems with MT7622 wifi, right? first is 6db, and second is antenna. isn’t it repair on your branch?

6db seems to depend on eeprom which cannot be loaded currently without mtd (my file-aproach was denied to be implemented). Antenna i don’t know how to check/set the mcs31 mode.

i can only fix if i know how to do it :slight_smile:

how can I judge that my board has successfully loaded eeprom? i have no errors in the startup log? but " txpower 6.00 dBm"

by default eeprom from card is loaded…an this is stuck by 6dbm…to use higher txpower vyou need to load other eeprom with the tx-bytes set to 21db

Txpower and the number of tx antenna are both load from eeprom. You can try to manually set “tx_mask” variable in mt7615_eeprom_parse_hw_cap() to 4, to see if you can get 4 antennas working.

can you help me to add code for loading eeprom-file from rootfs? instead of mtd partition? imho this should be similar

i know it is loaded from mtd, i want to know how to check the load is successful, because my boot log has no eeprom errors.

does no error mean that the load was successful? but I deleted all mtd used to save eeprom. still no startup error. dd if=/dev/zero of=/dev/mmcblk1p4 dd if=/dev/zero of=/dev/mmcblk1p5

As i said,by default eeprom is read from card itself (imho called efuse). Additionaly mtd can be used. I guess read from mtd is done here (common code for all mt76 wireless devices):

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/net/wireless/mediatek/mt76/eeprom.c?h=linux-5.9.y#n57

So you can add debug code here to check

your commands here on my r2 with mt7615

root@bpi-r2:~# iw phy | grep Antennas                                           
        Available Antennas: TX 0xf RX 0xf                                       
        Configured Antennas: TX 0xf RX 0xf                                      
root@bpi-r2:~# iw dev wlan0 station dump                                        

first is same output as yours, last one is empty, i guess i need to be connected to a AP to see output, right? can i open an IP with mcs31 enabled?

have not tried yet the code-change in this file (tx_mask = 4):

https://elixir.bootlin.com/linux/latest/source/drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c#L135

can you help me getting eeprom-data loaded from file?

ok!:orange_heart::heart_decoration: