ramips: fix switch setup for Xiaomi MiWiFi Nano
authorSungbo Eo <mans0n@gorani.run>
Sun, 22 Dec 2019 16:25:39 +0000 (01:25 +0900)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Tue, 31 Dec 2019 11:59:23 +0000 (12:59 +0100)
MiWiFi Nano has two LAN ports, which are in reverse order. Add port numbers
to them, and disable unused ports.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts
target/linux/ramips/mt76x8/base-files/etc/board.d/02_network

index 92bb8b72880a53f50d99ca9edb35e20a1d096435..e502f273afbb5a1ddafa9ae06fc61732fa3d256d 100644 (file)
        status = "disabled";
 };
 
+&esw {
+       mediatek,portmap = <0x2f>;
+       mediatek,portdisable = <0x2a>;
+};
+
 &wmac {
        status = "okay";
 };
index 90eec9c8a0bcb094dfbb907f1c41cae899f89c9d..a733353f71f3b68b4b9b73bacb20c76369df1cb9 100755 (executable)
@@ -61,8 +61,7 @@ ramips_setup_interfaces()
        mercury,mac1200r-v2|\
        totolink,lr1200|\
        wavlink,wl-wn570ha1|\
-       wavlink,wl-wn575a3|\
-       xiaomi,miwifi-nano)
+       wavlink,wl-wn575a3)
                ucidef_add_switch "switch0" \
                        "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
                ;;
@@ -109,6 +108,10 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "4:lan:1" "2:lan:2" "0:wan" "6@eth0"
                ;;
+       xiaomi,miwifi-nano)
+               ucidef_add_switch "switch0" \
+                       "0:lan:2" "2:lan:1" "4:wan" "6@eth0"
+               ;;
        zbtlink,zbt-we1226)
                ucidef_add_switch "switch0" \
                        "0:lan:2" "1:lan:1" "4:wan" "6@eth0"