ramips: fix switch and MAC address for WHR-G300N
authorINAGAKI Hiroshi <musashino.open@gmail.com>
Fri, 23 Mar 2018 05:59:39 +0000 (14:59 +0900)
committerMathias Kresin <dev@kresin.me>
Fri, 23 Mar 2018 19:31:49 +0000 (20:31 +0100)
WHR-G300N has 5 ethernet ports (lan: 4, wan: 1), but there was no
correct configuration in 02_network script and 6 ports was configured
on the switch.
Also, since the MAC address was not acquired from factory partition,
incorrect values was set to LAN and WAN interfaces.

This commit fixes these issues.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
target/linux/ramips/base-files/etc/board.d/02_network
target/linux/ramips/dts/WHR-G300N.dts

index 03f718ee30fbd42e80b08643dccd0fcfebd3a543..4441b2293e2b0a96a852dd5f0a7031be494b9dbb 100755 (executable)
@@ -110,6 +110,7 @@ ramips_setup_interfaces()
        u7621-06-256M-16M|\
        vr500|\
        wf-2881|\
+       whr-g300n|\
        witi|\
        wl-wn575a3|\
        wndr3700v5|\
@@ -440,7 +441,8 @@ ramips_setup_macs()
        e1700)
                wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR)
                ;;
-       gl-mt300n-v2)
+       gl-mt300n-v2|\
+       whr-g300n)
                wan_mac=$(mtd_get_mac_binary factory 4)
                ;;
        hc5*61|\
index da861ce66e4202a6df6cc7a5abf1dfdc7ffd2f87..a7c28341b2d8ccd2f589f291200cc849e0d89f5e 100644 (file)
        };
 };
 
+&ethernet {
+       mtd-mac-address = <&factory 0x4>;
+};
+
 &esw {
        mediatek,portmap = <0x2f>;
 };