802.11ac module gives max 6dbi transmitter power

is this sufficient? https://www.aliexpress.com/item/4000260974924.html?spm=a2g0o.order_detail.0.0.1e94f19cpEANeX

So this module also doesn’t have a physical EEPROM. Maybe @sinovoip @sinovoip1 can help here and let us know how they intended this module to be used and if they can share calibration data. You will have to either fork the board code and add this EEPROM to the device tree or use device tree overlay to attache the EEPROM content to a module in a specific PCIe slot.

fine by me … if it’s simply a matter of adjusting the FDT, it’s ok for me. But, off course, I need the calibration data, and a quick example of what I need to modify in the device tree would be fun

I have UniElec’s 7615 which is a very similar card. I think it may have been designed based on the Sinovoip card. It also has no eeprom.

UniElec ships routers with a (very old) custom version of OpenWrt that stores the 7615 card eeprom on a disk partition. I have the scatter and flash files for this (for use with MediaTek’s flash tool). It comes with a couple EEPROM files for their 7615 board. One of the EEPROM files is 64K, one is 256K.

If you get this to work, please share. I have one of the UniElec boards that is useless right now.

great! does anyone have a manual about how to include them in dts files?

This is how it should look like:

Here direct patching of bpi-r3 dts,but it is also possible via overlay…You have to use your data of course :slight_smile:

Thanks for pointing us in the right direction!!

Looking at the driver source code, it looks like the MT7615 driver is looking for up to 19880 bytes of data in the eeprom_data property. Of that, only the first 1024 bytes are the actual eeprom, and the rest is labelled DCOC and TXDP but I don’t think they are required. I don’t think anything except the actual 1024 bytes eeprom is required. Which is good, because the binary files given by UniElec only have real data for the first 1024 bytes. After that it looks like filler, probably just to make up disk space. The good news is I can see some commonalities between UniElec’s eeprom data and the data Frank linked above.

I think I’ll try this myself and see if I can get it working.

let me know … I didn’t get there :frowning:

maybe I should skip the AC card and go all the way for the AX version instead. In order to get here: I found this article on openwrt sites to “feed” the additional 3.3V for an AX adapter: https://forum.openwrt.org/t/mt7915-pcie-cards-on-bpi-unielec-boards/118194/20 is this something I could do on a R64 as well? take 12V from the GPIO and feed it back to 3.3V via another GPIO pin?

The U7623 board I used when I wrote that thread is different. The BPI-R64 board provides enough power at 3.3v in general for the AsiaRF 7915 cards. The problem is that each mPCIe slot also has current limiters that prevent one board from drawing more than a “certain amount” of power. How much that “certain amount” is depends on the revision. So whether or not you can use an AsiaRF 7915 board depends on you BPI-R64 revision, and whether or not you are willing to do some soldering.

The AsiaRF 7615 board should work with no issues, though. I have used it in the BPI-R64, and it is in my BPI-R2 right now. Works great.

And I’m actually compiling a kernel to test out my eeprom as I write this. If it works I can produce a firmware for you that might work with your current 7615 board.

I naively tried putting the mediatek,eeprom-data property in the root devicetree node, which didn’t work. My card didn’t see it. I then realized I have no idea how to target an addon-pci cards’s device tree node in the system device tree. Your example is targeting the built-in wifi, which has an existing node.

Right,it needs to be mapped to the card. Maybe there is a way for adding subnode to the right pcie port.

As alternative you can try this:

Then eeprom-data can be loaded from rootfs like firmware.

this patch is great! maybe you should submit it to openwrt mainline?

I’ve send a previous version to mt76 team (openwrt includes the mt76 repo) and it was rejected. But you can try a resend :slight_smile:

what was the argument? I really see no reason why you’d not want such a great function!

It was based on this

but i do not find it on a quick search. We added this for soc wifi which has additional ways (mtd partition,dts setting). Maybe with pcie card there is a good reason for file :slight_smile: so just try to send it

The driver actually will try to load from a mtd partition if it can’t find the eeprom in the device tree…

        data = of_get_property(np, "mediatek,eeprom-data", &size);
        if (data) {
                if (size > len)
                        return -EINVAL;

                memcpy(eep, data, size);

                return 0;
        }

        list = of_get_property(np, "mediatek,mtd-eeprom", &size);

…but for some reason it wants to read which mtd partition from the device tree, so I have the same problem - I don’t know how to specify a device tree node for a PCI card.

This is a fantastic solution. I was going to make an ugly hack to put the eeprom right into the driver, but this is a much better solution!

It works! Sort of… I’ll explain below.

@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.

See here for example:

which builds upon

Similarly, on MT7986 with the current dtsi changes for PCIe which Frank is submitting to mainline Linux, you can do

&pcie {
	pcie@0,0 {
		status = "okay";

		wifi@0,0 {
			compatible = "mediatek,mt76";
			reg = <0x0000 0 0 0 0>;
			mediatek,eeprom-data = /incbin/("/path/to/eeprom.bin");;
		};
	};
};
2 Likes

Thanks @VA1DER! 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.