openwrt / mt76

mac80211 driver for MediaTek MT76x0e, MT76x2e, MT7603, MT7615, MT7628 and MT7688
731 stars 334 forks source link

mt7628an_tplink_tl-wr841n-v14.dts mac address #626

Open sanitariu opened 2 years ago

sanitariu commented 2 years ago

mt7628an_tplink_tl-wr841n-v14.dts file does not read correctly mac address for the router. I suspect all mediatek 7628 routers does not do this correctly after the movement to new nvmem-cell


&wmac { status = "okay";

mediatek,mtd-eeprom = <&factory 0x0>;

nvmem-cells = <&macaddr_factory_f100>;
nvmem-cell-names = "mac-address";

};

&ethernet { nvmem-cells = <&macaddr_factory_f100>; nvmem-cell-names = "mac-address"; };

&factory { compatible = "nvmem-cells";

address-cells = <1>;

#size-cells = <1>;

macaddr_factory_f100: macaddr@f100 {
    reg = <0xf100 0x6>;
};

};


This is not working. As a result we have this in the log file: [ 0.587159] rt3050-esw 10110000.esw: mediatek esw at 0xb0110000, irq 25 initialized [ 0.595239] mtk_soc_eth 10100000.ethernet: generated random MAC address 96:52:65:56:8d:42 [ 0.605928] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5

If i remove the patches for nvmem-cell mac address is read correct.

sanitariu commented 2 years ago

For anyone interested in solving this problem ... just return 681-NET-add-mtd-mac-address-support-to-of_get_mac_addres.patch to kernel 5.4 folder and recompile so you can have the correct mac address of your router.