Support for COMFAST CF-EW72 V2 (MT7621)

Yes, it's here, and ethernets take it correctly.

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00030000 00010000 "Bootloader"
mtd1: 00010000 00010000 "Config"
mtd2: 00010000 00010000 "factory"
mtd3: 00fb0000 00010000 "firmware"

# hexdump -s `echo $((0xe000))` -n 6 -e '1/1 "%02X"' /dev/mtd2
E0E1A9BB7A8D

full dump of /dev/mtd2: https://pastebin.com/sPJvQhzF ( highlight e0 e1 a9 bb )

# ifconfig -a | grep HWaddr
br-lan    Link encap:Ethernet  HWaddr E0:E1:A9:BB:7A:8D
eth0      Link encap:Ethernet  HWaddr E0:E1:A9:BB:7A:8D
lan       Link encap:Ethernet  HWaddr E0:E1:A9:BB:7A:8D
wan       Link encap:Ethernet  HWaddr E0:E1:A9:BB:7A:8E
wlan0     Link encap:Ethernet  HWaddr EA:DA:FC:B2:5F:8D # Random
wlan1     Link encap:Ethernet  HWaddr 8E:3E:6C:EC:52:AA # Random

Found that both wifi start getting MAC addresses from it's own eeprom, and anything else related to MAC makes error and makes wifi use random MAC.

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

&pcie1 {
	wifi@0,0 {
		compatible = "mediatek,mt76";
		reg = <0x0000 0 0 0 0>;
		mediatek,mtd-eeprom = <&factory 0x8000>;
	};
};

&pcie2 {
	status = "disabled";
};

Is it the same behavior if you set the wifi MACs in target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac instead of defining the location in the DTS?

Well, the solution not-to-specify anything MAC-related in pcieN\wifi and let driver pull mac from mtd-eeprom works and looks good for me:

// Works : driver pulls MAC from mtd-eeprom + 4
// Without any patches to 10_fix_wifi_mac
wifi@0,0 {
		compatible = "mediatek,mt76";
		reg = <0x0000 0 0 0 0>;
		mediatek,mtd-eeprom = <&factory 0x8000>;
	};

But for tests:

// Fails:
// Adding nvmem-cell-names = "mac-address"; nvmem-cells = <&macaddr_factory_e000 1>;
// without anything in 10_fix_wifi_mac
// Makes devices disappear from ifconfig -a
wifi@0,0 {
	compatible = "mediatek,mt76";
	reg = <0x0000 0 0 0 0>;
	mediatek,mtd-eeprom = <&factory 0x0000>;
	nvmem-cells = <&macaddr_factory_e000 2>;
	nvmem-cell-names = "mac-address";
};
// Fails:
// Adding nvmem-cell-names = "mac-address"; nvmem-cells = <&macaddr_factory_e000 1> ;
// AND add instructions to 10_fix_wifi_mac
// Makes devices disappear from ifconfig -a
wifi@0,0 {
	compatible = "mediatek,mt76";
	reg = <0x0000 0 0 0 0>;
	mediatek,mtd-eeprom = <&factory 0x0000>;
	nvmem-cells = <&macaddr_factory_e000 2>;
	nvmem-cell-names = "mac-address";
};
// Fails:
// Adding nvmem-cell-names = "mac-address"; nvmem-cells = <&macaddr_factory_e000 1> ;
// AND add instructions to 10_fix_wifi_mac
// AND remove 	reg = <0x0000 0 0 0 0>;
// Makes devices use random mac-address and no mac-address appears in /sys
// But appears /sys/devices/platform/1e140000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/ieee80211/phy0/macaddress

wifi@0,0 {
	compatible = "mediatek,mt76";
	mediatek,mtd-eeprom = <&factory 0x0000>;
	nvmem-cells = <&macaddr_factory_e000 2>;
	nvmem-cell-names = "mac-address";
};

Works now. Pull request awaiting

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.