Adding OpenWrt support for Linksys EA7500 v2

Hi, what you mean by bootloader?

I flash it using tftp, now almost everything work but wifi is extremely weak, maybe the calibration data is not loaded correctly

I mean that a boot like Breed or Pbboot replaces the official Uboot.
Sorry, my English is based on translation software. Maybe the meaning is not clear.
In this way, the official system can be restored if the brush is broken.
In addition, you can try to compile the package with 7615 driver by openwrd.

It is ok I can understand you fine,
I just flash it in the original bootloader using tftp.
The NAND partition scheme contains two root partitions and it can use the other backup one, if the other one is bricked

are you from china? I can also use Chinese in private message if that is easier for you.

@jackcolentern I also have a Linksys EA7500-AH v2 which I'm running with master and the mt76 driver. WiFi signal, as you found out, is extremely weak. I can only connect to the router if I'm in the same room. If I'm out of even separated by a wall, connection becomes unreliable. I even forced power to 30dbm with hardcoded value to try if that can help, but it's just a little better.

I even tried the closed source driver that some folks have been trying out for the Xiaomi 3 Pro, but it couldn't even load as it kept crashing the EA7500.

It could be as you suspected, the calibration data is not correct.

I found that stock firmware has SKU files, which the mt76 open source driver does not use. The contents of the file suggest that power data can be configure for various configurations, e.g. 4T 3T 2T etc, which seems to imply transmission streams. I guess the open source drivers is not configuring the power of the amplifiers correctly?

Unfortunately I'm not knowledgable enough in WiFi or the mt76 drivers to start solving the problem.

It's great to know that I'm not the only only working on this router.

Hi, I suspect the calibration data problem because the wifi MAC address I got from the Factory partition is not the same as the original firmware. Maybe because Linksys use a non standard calibration file format?

The router's mac address is actually stored in the devinfo partition. It's stored in ASCII, in key-value pairs, which unfortunately the mt76-mt7615 driver cannot use, as it expected binary mac address.

From what I understood of the EEPROM structure for the Factory partition, it has 6 bytes allocated for mac address, but when I looked at the partition, it contains Mediatek's mac addresses. In any case, I think the Linksys firmware changes the WiFi interfaces' mac-address (obtained from the devinfo partition and incremented accordingly) after the driver has loaded and during interface bring up.

I do not know much about WiFi interface calibration data to comment on whether Linksys is using non-standard ones, but I doubt it. Most likely they just take whatever Mediatek sends their way.

I can only seems to find one set of MAC address in the devinfo partition, maybe we should calculate and set the MAC address during boot using a script (like commonly do on QCA devices).

one strange thing to me is that In the original firmware, LAN and WAN uses the same MAC address. Can you confirm that, because usually router uses two different mac address for LAN and WAN, thanks!

我解开过其他mt7621路由器的eeprom,例如小米的R3G,用的是7612和7603无线(非双7615N)的eeprom,里面有三个mac地址,mtk的eeprom应该是一样的,里面解开的数据有三组mac,其他地方都是FFFFF,不是很好找而已!最后两位数不同,下面这张图是MAC地址丢失了!这个数据一定得保存好

我以为你是拆机用TTL写入的,我的tftp工具不是很会用!这个路由器没开放ssh,有点麻烦!

I think we better use English here, we can use Chinese in the private message though
I use ttl to initiate a tftp upgrade and write into flash
For now I cant seems to figure out how to flash it without ttl.

EDIT: unfortunately I cant find the mac original firmware used in the factory partition

2 Likes

Upon further testing, although the range is quite OK, the speed is only 50~120Mbps on ac wifi, but I am not skilled enough to debug the wireless driver....

How is other MT7615 devices perform with mt7615e driver, do they have similar issues?

https://www.right.com.cn/forum/forum.php?mod=viewthread&tid=250429&orderby=dateline

I modified the eeprom by this link.

1 Like

My WiFi range is bad. Would you mind sharing the .dts file you created for your EA7500 v2? My is as shown below. I think my .dts file is probably wrong.

/dts-v1/;

#include "mt7621.dtsi"

/ {
	compatible = "linksys,ea7500ahv2", "mediatek,mt7621-soc";
	model = "Linksys EA7500-AH v2";

	chosen {
		bootargs = "console=ttyS0,115200";
	};
};

&nand {
	status = "okay";

	partitions {
	compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		partition@0 {
			label = "boot";
			reg = <0x00000000 0x00080000>;
			read-only;
		};

		partition@00080000 {
			label = "u_env";
			reg = <0x00080000 0x00040000>;
			read-only;
		};

		factory: partition@000c0000 {
			label = "factory";
			reg = <0x000c0000 0x00040000>;
			read-only;
		};

		partition@00100000 {
			label = "s_env";
			reg = <0x00100000 0x00040000>;
			read-only;
		};

		devinfo: partition@00140000 {
			label = "devinfo";
			reg = <0x00140000 0x00040000>;
			read-only;
		};

		partition@00180000 {
			label = "kernel";
			reg = <0x00180000 0x02800000>;
		};

		partition@00580000 {
			label = "rootfs";
			reg = <0x00580000 0x02400000>;
		};

		partition@02980000 {
			label = "alt_kernel";
			reg = <0x02980000 0x02800000>;
			read-only;
		};

		partition@02d80000 {
			label = "alt_rootfs";
			reg = <0x02d80000 0x02400000>;
			read-only;
		};

		partition@05180000 {
			label = "sysdiag";
			reg = <0x05180000 0x00100000>;
			read-only;
		};

		partition@05280000 {
			label = "syscfg";
			reg = <0x05280000 0x02d00000>;
		};
	};
};

&pcie {
	status = "okay";
};

&pcie0 {
	wifi@0,0 {
		compatible = "pci14c3,7615";
		reg = <0x0000 0 0 0 0>;
		mediatek,mtd-eeprom = <&factory 0x0000>;
		mtd-mac-address = <&factory 0x4>;
		ieee80211-freq-limit = <2400000 2500000>;
	};
};

&pcie1 {
	wifi@0,0 {
		compatible = "pci14c3,7615";
		reg = <0x0000 0 0 0 0>;
		mediatek,mtd-eeprom = <&factory 0x8000>;
		mtd-mac-address = <&factory 0x8004>;
		ieee80211-freq-limit = <5000000 6000000>;
	};
};

&ethernet {
	mediatek,portmap = "wllll";
};

&sdhci {
	status = "okay";
};

&pinctrl {
	state_default: pinctrl0 {
		gpio {
			ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
			ralink,function = "gpio";
		};
	};
};

My dts is very similar to yours

// SPDX-License-Identifier: GPL-2.0
/dts-v1/;

#include "mt7621.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
	compatible = "linksys,ea7500-v2", "mediatek,mt7621-soc";
	model = "Linksys EA7500 V2";

	chosen {
		bootargs = "console=ttyS0,115200";
	};
	
	aliases {
		led-boot = &status;
		led-failsafe = &status;
		led-running = &status;
		led-upgrade = &status;
	};
	
	leds {
		compatible = "gpio-leds";
		
		status: status {
			label = "ea7500-v2:white:status";
			gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
		};

		wan {
			label = "ea7500-v2:green:wan";
			gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
		};

		lan4 {
			label = "ea7500-v2:green:lan4";
			gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
		};

		lan3 {
			label = "ea7500-v2:green:lan3";
			gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
		};

		lan2 {
			label = "ea7500-v2:green:lan2";
			gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
		};

		lan1 {
			label = "ea7500-v2:green:lan1";
			gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
		};

	};
	
	keys {
		compatible = "gpio-keys";

		reset {
			label = "reset";
			gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RESTART>;
		};
	};


};

&nand {
	status = "okay";

	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		partition@0 {
			label = "boot";
			reg = <0x0 0x080000>;
			read-only;
		};

		partition@80000 {
			label = "u_env";
			reg = <0x080000 0x040000>;
			read-only;
		};

		factory: partition@c0000 {
			label = "Factory";
			reg = <0x0c0000 0x040000>;
			read-only;
		};

		partition@100000 {
			label = "s_env";
			reg = <0x100000 0x040000>;
			read-only;
		};

		partition@140000 {
			label = "devinfo";
			reg = <0x140000 0x040000>;
			read-only;
		};

		partition@180000 {
			label = "kernel";
			reg = <0x180000 0x400000>; //4MB kernel
		};

		partition@580000 {
			label = "ubi";
			reg = <0x580000 0x2400000>;
		};
		
		partition@2980000 {
			label = "alt_kernel";
			reg = <0x2980000 0x400000>;
			read-only;
		};
		
		partition@2d80000 {
			label = "alt_rootfs";
			reg = <0x2d80000 0x2400000>;
			read-only;
		};
		
		partition@5180000 {
			label = "sysdiag";
			reg = <0x5180000 0x100000>;
			read-only;
		};
	
		partition@5280000 {
			label = "syscfg";
			reg = <0x5280000 0x2d00000>;
			read-only;
		};
	};
};

&pcie {
	status = "okay";
};

&pcie0 {
	mt76@0,0 {
		reg = <0x0000 0 0 0 0>;
		mediatek,mtd-eeprom = <&factory 0x0000>;
	};
};

&pcie1 {
	mt76@0,0 {
		reg = <0x0000 0 0 0 0>;
		mediatek,mtd-eeprom = <&factory 0x8000>;
		ieee80211-freq-limit = <5000000 6000000>;
	};
};

&pinctrl {
	state_default: pinctrl0 {
		gpio {
			ralink,group = "jtag", "uart2", "uart3", "wdt";
			ralink,function = "gpio";
		};
	};
};

BTW, how the driver perform on other 7615 devices? Maybe the driver is not mature enough?

Thanks for the dts info. I'm not able to get the closed source driver to work in my EA7500-AH v2. The driver kept crashing the router. Need to figure out what's missing tho. Will share with all when I get it to work.

Not sure why you are able to get good WiFi range while mine is bad. Will try out your dts and see if it helps.

There is a lot of wifi interference here, so maybe the range I got is not accurate.
Although I get a OK range, the speed (about 50~150 mbps) is too slow to use daily anyway.

I am now trying to get closed source driver on it, you need kernel version 4.14.123 to make it work, otherwise it will cause kernel panic.

I have problem getting the eeprom data to load on the closed source driver (the mac address is all 00).
Now 2.4G work with wrong MAC
I can bring up the 5G interface but I cant see the network on my phone.

Progress update!

I am able to get the 5G wifi working using the closed source driver by changing E2pAccessMode=2 in all of the .dat files locatedin /etc/wireless/mt7615/

and dd the factory partition into /lib/firmware/mt7615.eeprom.bin

Now it seems to be able to read the MAC address from the eeprom and I can connect to 5G wifi

2G wifi works fine however 5G wifi is not stable at all, after some wifi traffic it just drops out completely

[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  36.1 MBytes   303 Mbits/sec                  
[  5]   1.00-2.00   sec  47.0 MBytes   395 Mbits/sec                  
[  5]   2.00-3.00   sec  30.5 MBytes   256 Mbits/sec                  
[  5]   3.00-4.00   sec  0.00 Bytes  0.00 bits/sec                  
[  5]   4.00-5.00   sec  0.00 Bytes  0.00 bits/sec                  
[  5]   5.00-6.00   sec  0.00 Bytes  0.00 bits/sec                  
[  5]   6.00-7.00   sec  0.00 Bytes  0.00 bits/sec                  
[  5]   7.00-8.00   sec  0.00 Bytes  0.00 bits/sec                  
[  5]   8.00-9.00   sec  0.00 Bytes  0.00 bits/sec                  
[  5]   9.00-10.00  sec  0.00 Bytes  0.00 bits/sec                  
[  5]  10.00-11.00  sec  0.00 Bytes  0.00 bits/sec                  
[  5]  11.00-12.00  sec  0.00 Bytes  0.00 bits/sec                  
[  5]  12.00-13.00  sec  0.00 Bytes  0.00 bits/sec                  
[  5]  13.00-14.00  sec  0.00 Bytes  0.00 bits/sec                  
[  5]  13.00-14.00  sec  0.00 Bytes  0.00 bits/sec  
1 Like

Which closed source driver are you using?

This one, now the 5G wifi seems quite Ok, need to test for a little longer for sure

@quarky @farawayso

if you guys are willing to test, I have a pre-compiled firmware using driver from mtk-openwrt-feed.

I tested initramfs and factory.bin using tftp they boot without problem, wifi signal and speed is fine for me, use at your own risk though.

UPDATE: the new version use a script to dd the factory partition to the respective eeprom.bin files, and patched the mac address during the first boot.

Now the Mac address for 5G wifi is correct, but mac address for 2G wifi is still not correct, I will try to fix that

I tested the 5G wifi for ~1 hours, so far so good

UPDATE2: Fixed lan and wan mac