@frank-w: Your code, of course, works great. I patched the mt76 driver in OpenWrt stable (22.03.2) and it now reads eeprom data from /lib/firmware/mediatek/mt7615e_rf.bin. The eeprom files I made all seem to work, more or less.
@jpsollie: So, it seems to work and my card comes up as more then just a generic WiFi card. However, I tgried four different eeprom files and can’t get it to come up to more than 10dBm output. I don’t think this is an eeprom issue, though. I seem to remember that this card needs extra 5v power supplied on some normally unused mPCIe pins (47 & 49) in order to go to full output. Right now I have this card in a BPI-R2, and I don’t think its mPCIe slot supplies this. But you have a BPI-R64 and its mPCIe slot does. I also have an R64, but it is sort of in “production”: in use as my main home router right now, and I don’t want to experiment with it. But if you tell me what version of OpenWrt you are using, I will build you a patched mt76.ko and you can test out your card.
I’m using the latest self-compiled snapshot, so frank’s patch will be ok. In meantime, because I lost my patience, I bought the propierary ubiquiti card, I’ll see if I can extract the eeprom from there.
Here are the four eeproms I was able to find. I stuck in the mt76.ko module with Frank’s patch too. Three of the eeprom were in files provided by UniElec. The fourth one (labelled “extracted”) was the one that was installed on my UniElec board and I extracted it from a dump of its ROM. They all appear to be a little different. I’m going to try extracting the eeprom from an AsiaRF 7615 card and see what effect it has too.
EDIT: @dangowrt thank-you so much for the examples! Once I find an eeprom that works well in this board, I will use that to put the eeprom in the device tree.
EDIT2: I did grab the EEPROM off my AsiaRF 7615 card, and it’s here. When I use it, my card reports being able to sent at 24dbm. The eeproms carry the MAC address. I took the liberty of setting the MAC address in the AsiaRF eeprom to a random one in the upper end of AsiaRF’s allocation, so you should be able to use it.
The UniElec cards are just like the BPI ones, with no EEPROM on them. That being said, it should at least detect when you put it in. In fact, it should act, basically, just like your BPI 7615 card. If it’s not even being detected (and if your BPI card is being detected) then I suspect a deffective card.
There should be no power issue with any 7615 card.
If you want a card that “Just Works”, then AsiaRF has a great 7615 card. It is a consumer card with a built-in EEPROM. I have even been able to get DBDC working with it.
The patch wasn’t done with quilt in mind. It’s intended to be manually applied. You have to hold a gun to the OpenWrt build system to make it do what you want, though. I’m not sitting at my computer, atm. When I get home I’ll get you the exact steps you need to build the patched kernel module. In broad strokes:
Set up your build system, do the prelims, make toolchain/install, etc
apply the patch to eeprom.c
make eeprom.c imutable (sudo chattr +i eeprom.c)
make -i package/kernel/mt76/compile
The precompiled module I made for you should work for you right now, though. Save a copy of your existing /lib/modules//mt76.ko, rename it to /lib/modules/mt76.ko.orig or something like that. Then copy the one I sent you in its place. It should make every mt76-based driver look for an eeprom file.
yes, this worked!
@ericwoud: I know, working with a DTB file may be easier, but it’s much better to provide a generic solution for all possible configs (which is what frank is doing here) compared to a hardlinked setup
Good news. I personally find that wrestling the OpenWrt build system into submission and getting it to let you do something as simple as make a patch or a change can be an exercise in extreme frustration.