[WIP] OpenWrt Support for Edimax BR-6208AC V2

Edimax BR-6208AC V2 is a Wifi router based on MediaTek MT7620A (like several other devices which are already supported by OpenWrt). It provides 64 MiB RAM and 16 MiB flash, 2.4 GHz and 5 GHz WLAN, 3 ethernet ports and 1 WAN port.

I starteded a modified OpenWrt to support that device, but are still struggling to get it working. Current status:

Open issues

  • Power LED cannot be controlled
  • Reset button not recognized
  • Ethernet not working, can send and receive packets, but does not answer ARP requests

Working

  • Firmware can be flashed, boots, serial console working
  • LEDs with the exception of the power LED: echo timer > /sys/class/leds/green:new_fw/trigger
  • WLAN scanning works: iw wlan0 scan, iw wlan1 scan
  • WLAN can connect to access point
  • WLAN works as access point

Currently I am struggling with the device tree to fix the open issues. Especially a fully working ethernet would make further work much easier. Any help is appreciated!

The GPLed vendor firmware with a Linux 2.6 kernel can be built and works fine, see boot protocols on my GitHub wiki.

Update: WLAN works, I could connect to an access point.

opkg update fails because HTTPS is not supported by the default wget, but that's a different story and easy to fix.

To get assistance you will need to post boot logs, from both the vendor firmware and openwrt.

How did you create a dts if the vendor firmware uses 2.6?

As noted above, the boot logs are available on my GitHub wiki. See vendor firmware 1.02 and 1.03 and OpenWrt with Gluon boot logs.

I created a new one based on other DTS files for routers which also use MT7602A in OpenWrt.

That is fixed now (see also my related pull request). In addition I had to get and install the missing public usign key 4d017e6f1ed5d616. So it is now possible to install additional packages via the WLAN interface.

Ethernet still does not work. It looks like the device receives ethernet packets (tcpdump shows them), but the software does not get them. Could it be that the default packages which got installed when building firmware from OpenWrt master are incomplete? Maybe some required kernel modules are missing?

The differences between 2.6 and 5.10 are so great the bootlogs aren't that useful. However I can see that the spi partition definitions don't match stock.

Should be;

0x000000000000-0x000000030000 : "Bootloader"
0x000000030000-0x000000040000 : "Config"
0x000000040000-0x000000050000 : "Factory"
0x000000050000-0x000000070000 : "Cimage"
0x000000070000-0x000000190000 : "Kernel"
0x000000190000-0x000000fe0000 : "RootFS"
0x000000070000-0x000000fe0000 : "Uimage"
0x000000fe0000-0x000001000000 : "FreeSpace"

To get people to comment on your dts post it here. That's the likely cause of the eth phy not operating.

For the kmods - what have you specified in the makefiles?

Is it strictly necessary that the vendor partitions and OpenWrt partitions are identical? Or is it sufficient when some of them (uboot bootloader, its configuration and the factory settings) are preserved? In my latest DTS the stock partition "Bootloader" matches "u-boot", "Config" matches "u-boot-env", "Factory" matches "factory", "Cimage" matches "cimage" and "FreeSpace" matches "freespace".

The DTS is here. And here is the Makefile part which specifies the device packages kmod-mt76x2, kmod-usb2, kmod-usb-ohci, kmod-usb-ledtrig-usbport.

Is it not working? tcpdump on the device shows packets coming from outside, and outside answers on ARP requests from the device.

I changed the partitions to better match the vendor partitions, see new boot log with OpenWrt-Linux-5.10.167.

My latest firmware also includes LuCI and all require kernel modules. I configured the device as a WLAN client, so I can access the web interface via WLAN.

Ethernet sends and receives packets, the device sees received packets with tcpdump but still does not answer them. Could it be that this is not a hardware problem but some other software configuration which does not pass received packets to br-lan? I already stopped the firewall, but that did not fix the problem. Initially br-lan, eth0 and one of the wifi interfaces had the same MAC address, but I already changed the MAC address for eth0 to avoid that conflict. br-lan now also uses the new MAC address:

root@OpenWrt:~# ifconfig -a|grep HW
br-lan    Link encap:Ethernet  HWaddr 74:DA:38:C6:92:20  
eth0      Link encap:Ethernet  HWaddr 74:DA:38:C6:92:20  
phy0-ap0  Link encap:Ethernet  HWaddr 74:DA:38:C6:92:2D  
phy1-ap0  Link encap:Ethernet  HWaddr 74:DA:38:C6:92:2D  
phy1-sta0 Link encap:Ethernet  HWaddr 74:DA:38:C6:92:2C  

Add switch topology in 02_network file for your device and show output of swconfig dev switch0 show command.

1 Like

Many thanks, that solves it! It is still not perfect because the port numbers in OpenWrt don't match those printed on the device, and LuCI says there are 8 ports while the real device has 3 x LAN and 1 x WAN. But LuCI can now be reached without WLAN on http://192.168.1.1/.

I noticed that there is also 01_leds which needs an addition. I am not sure whether it was correct, but at least some LEDs changed and LuCI shows 3 of them in "LED Configuration".

Suggestions for more improvements (or pull requests) are welcome!

Since yesterday the router is now running with OpenWrt and Gluon, and all essential features seem to work fine. Still missing: the combined WPA/Reset button does not work. It should be on GPIO2, but obviously I configured the wrong pin. GPIO has 32 pins. Is it possible to read them without building a new kernel, or what would be the best way to find the correct settings for the button?

Read this article

I had already read that article, but obviously missed the answer for my question. The scripts in the article iterate over all gpios and read the value entry for each pin. But value only exists if the kernel configured it, and my current kernel did not configure the right pin. My hope was that I could always read the 32 pins in a single read operation instead of building a new kernel with configurations for 32 single pins.

The script configure and test any free (not acquired by any controller) gpio at run time.
If you are sure that it should be on GPIO2 than remove i2c node to avoid conflict with

&state_default {
	gpio {
		// TODO: "spi refclk"?
		groups = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd";
		function = "gpio";
	};
};

and allow gpio-controller to drive GPIO2 pin.

1 Like

Thank you again. Meanwhile the reset button works, too. I created a pull request which adds the required code to OpenWrt.