ramips: fix MikroTik 750Gr3 ports MAC addresses
authorDENG Qingfang <dengqf6@mail2.sysu.edu.cn>
Tue, 28 Apr 2020 03:38:51 +0000 (11:38 +0800)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Tue, 28 Apr 2020 08:57:17 +0000 (10:57 +0200)
According to a user in OpenWrt forum, on RouterOS the MAC addresses are
ether1(WAN) = MAC
ether2(LAN2) = MAC+1
ether3(LAN3) = MAC+2
etc.

Fix the MAC addresses in OpenWrt.

Ref: https://forum.openwrt.org/t/few-dumb-question-about-mt7530-rb750gr3-dsa/61608
Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
[remove label_mac in 02_network]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/ramips/dts/mt7621_mikrotik_routerboard-750gr3.dts
target/linux/ramips/mt7621/base-files/etc/board.d/02_network

index 3f37155f243bdf3b08c9b04526d15bec78ec1385..af0664a4fa59a71a936fcd036e55fed4a3156f72 100644 (file)
@@ -15,6 +15,7 @@
                led-failsafe = &led_usr;
                led-running = &led_usr;
                led-upgrade = &led_usr;
+               label-mac-device = &gmac0;
        };
 
        chosen {
 
 &gmac0 {
        mtd-mac-address = <&hard_config 0x0010>;
-       mtd-mac-address-increment = <1>;
 };
 
 &switch0 {
                port@0 {
                        status = "okay";
                        label = "wan";
-                       mtd-mac-address = <&hard_config 0x0010>;
-                       mtd-mac-address-increment = <2>;
                };
 
                port@1 {
                        status = "okay";
                        label = "lan2";
+                       mtd-mac-address = <&hard_config 0x0010>;
+                       mtd-mac-address-increment = <1>;
                };
 
                port@2 {
                        status = "okay";
                        label = "lan3";
+                       mtd-mac-address = <&hard_config 0x0010>;
+                       mtd-mac-address-increment = <2>;
                };
 
                port@3 {
                        status = "okay";
                        label = "lan4";
+                       mtd-mac-address = <&hard_config 0x0010>;
+                       mtd-mac-address-increment = <3>;
                };
 
                port@4 {
                        status = "okay";
                        label = "lan5";
+                       mtd-mac-address = <&hard_config 0x0010>;
+                       mtd-mac-address-increment = <4>;
                };
        };
 };
index 952146478cce8b682f55400252e3ffadf632fd3a..43db9c6f64480bf6b238fa4361b388fe3cc1a655 100755 (executable)
@@ -91,7 +91,6 @@ ramips_setup_macs()
                wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
                label_mac=$wan_mac
                ;;
-       mikrotik,routerboard-750gr3|\
        mikrotik,routerboard-m11g|\
        mikrotik,routerboard-m33g)
                label_mac=$(mtd_get_mac_binary hard_config 0x10)