ramips: mt7621: update dts/defconfig for DSA
authorDENG Qingfang <dengqf6@mail2.sysu.edu.cn>
Wed, 18 Mar 2020 15:38:58 +0000 (23:38 +0800)
committerChuanhong Guo <gch981213@gmail.com>
Sat, 4 Apr 2020 06:40:44 +0000 (14:40 +0800)
update dts and network/LED configuration for DSA driver.
sysupgrade from images prior to this commit with config preserved
will cause broken ethernet setup.

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
Acked-by: Jo-Philipp Wich <jo@mein.io>
[split commit]
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
70 files changed:
target/linux/ramips/dts/mt7621_adslr_g7.dts
target/linux/ramips/dts/mt7621_afoundry_ew1200.dts
target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts
target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts
target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts
target/linux/ramips/dts/mt7621_asiarf_ap7621.dtsi
target/linux/ramips/dts/mt7621_asus_rt-ac57u.dts
target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi
target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts
target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts
target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts
target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts
target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts
target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi
target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts
target/linux/ramips/dts/mt7621_elecom_wrc-gst.dtsi
target/linux/ramips/dts/mt7621_firefly_firewrt.dts
target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts
target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts
target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts
target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts
target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts
target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts
target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi
target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts
target/linux/ramips/dts/mt7621_iptime_a6ns-m.dts
target/linux/ramips/dts/mt7621_iptime_a8004t.dts
target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts
target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts
target/linux/ramips/dts/mt7621_linksys_re6500.dts
target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts
target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts
target/linux/ramips/dts/mt7621_mikrotik_rb750gr3.dts
target/linux/ramips/dts/mt7621_mikrotik_rbm11g.dts
target/linux/ramips/dts/mt7621_mikrotik_rbm33g.dts
target/linux/ramips/dts/mt7621_mqmaker_witi.dts
target/linux/ramips/dts/mt7621_mtc_wr1201.dts
target/linux/ramips/dts/mt7621_netgear_ex6150.dts
target/linux/ramips/dts/mt7621_netgear_r6700-v2.dts
target/linux/ramips/dts/mt7621_netgear_r6800.dts
target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi
target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi
target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi
target/linux/ramips/dts/mt7621_netis_wf2881.dts
target/linux/ramips/dts/mt7621_phicomm_k2p.dts
target/linux/ramips/dts/mt7621_planex_vr500.dts
target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts
target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts
target/linux/ramips/dts/mt7621_telco-electronics_x1.dts
target/linux/ramips/dts/mt7621_thunder_timecloud.dts
target/linux/ramips/dts/mt7621_totolink_a7000r.dts
target/linux/ramips/dts/mt7621_tplink_re350-v1.dts
target/linux/ramips/dts/mt7621_tplink_re650-v1.dts
target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx.dtsi
target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts
target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi
target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi
target/linux/ramips/dts/mt7621_xiaomi_mir3g-v2.dts
target/linux/ramips/dts/mt7621_xiaomi_mir3g.dts
target/linux/ramips/dts/mt7621_xiaomi_mir3p.dts
target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts
target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts
target/linux/ramips/dts/mt7621_youhua_wr1200js.dts
target/linux/ramips/dts/mt7621_youku_yk-l2.dts
target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts
target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts
target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts
target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi
target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
target/linux/ramips/mt7621/base-files/etc/board.d/02_network

index 91a6ab26abd030bbd76ae436806ddcf943448ae7..2448248c3101a8e5ff77ccf1db1f410c4cc98e2a 100644 (file)
@@ -15,7 +15,7 @@
                led-failsafe = &led_sys;
                led-running = &led_sys;
                led-upgrade = &led_sys;
-               label-mac-device = &ethernet;
+               label-mac-device = &gmac0;
        };
 
        chosen {
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe00c>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe00c>;
+                       mtd-mac-address-increment = <1>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "i2c", "wdt";
index 877b8d7d9d453226d04383f1917f25693dcdb5b9..c0166c730aed78b096423a4658c22d60502b371c 100644 (file)
                bootargs = "console=ttyS0,57600";
        };
 
-       palmbus: palmbus@1E000000 {
-               i2c@900 {
-                       status = "okay";
-               };
-       };
-
        keys {
                compatible = "gpio-keys";
 
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe000>;
+                       mtd-mac-address-increment = <1>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "wdt", "rgmii2", "jtag", "mdio";
index 266e765d7bc7be84e006f4c03b5c844b88e9c9b9..6ac9e337fcbe7ab60fb38a305f9d95ff17f7e63d 100644 (file)
@@ -11,7 +11,7 @@
        model = "ALFA Network Quad-E4G";
 
        aliases {
-               label-mac-device = &ethernet;
+               label-mac-device = &gmac0;
                led-boot = &led_system;
                led-failsafe = &led_system;
                led-running = &led_system;
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+               };
+       };
+};
+
 &i2c {
        status = "okay";
 
index 9926a9bd5a132cd9819fdf98edc9476062e1f371..6e2142073327344fbd6f40107b66cf44de606f07 100644 (file)
@@ -7,3 +7,19 @@
        compatible = "asiarf,ap7621-001", "mediatek,mt7621-soc";
        model = "AsiaRF AP7621-001";
 };
+
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe000>;
+                       mtd-mac-address-increment = <1>;
+               };
+       };
+};
index ec322d0e08c8848a5b44e42f9868398ef467c0c0..977f43e114c7235bf09b7f2e85cbf5248a0bf4fc 100644 (file)
@@ -7,3 +7,24 @@
        compatible = "asiarf,ap7621-nv1", "mediatek,mt7621-soc";
        model = "AsiaRF AP7621-NV1";
 };
+
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe000>;
+                       mtd-mac-address-increment = <1>;
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan2";
+               };
+       };
+};
index a965cb4e63220d745c1a6369cd09727479def778..bd6642fe51499bf2619de4ba033622231df53428 100644 (file)
        status = "okay";
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
-       mediatek,portmap = "llllw";
 };
 
 &state_default {
index ac1d88a6cee92ad6b0500a3baafab1a7213f3f30..0b37dc839529922aa0c6ce51705d3b43652c0902 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "lan4";
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "sdhci";
index c1ef3ce98c6d0f5e507372b7fdca81e09d15671f..37056c7934ba86a42cd81032e455169a4dc232fe 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
-       mediatek,portmap = "wllll";
-       port@5 {
-               status = "disabled";
-       };
 };
 
-&i2c {
-       status = "disabled";
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "wan";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "lan4";
+               };
+       };
 };
 
 &state_default {
index 8e0a1d8912110cd3e24709bcc23f5418130658d8..af83d0f1b3db70e4b55ee33147f9608f0a7cad11 100644 (file)
        };
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
index ca060e7c0a493ba8cc01cd7927ba8879ec238ba0..1d0c8b3dcce7321fe036ea4eef000bca7a7d9c40 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0x4>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+               };
+       };
+};
+
 &xhci {
        status = "disabled";
 };
index 85b8c5c2e0a35ad835af2bc568a4ecb0ccd82fbd..c5548a673e7013b2b84873ecf60d4403fd5b85e9 100644 (file)
@@ -14,7 +14,7 @@
                led-failsafe = &led_power_blue;
                led-running = &led_power_blue;
                led-upgrade = &led_power_blue;
-               label-mac-device = &ethernet;
+               label-mac-device = &gmac0;
        };
 
        chosen {
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "i2c", "jtag", "uart2", "uart3";
index 73e6e32f423dd6c4701978209ff5ac90b94a0dc8..528f86f94393edeed55c53daaff0a80b55ccd715 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "wdt", "rgmii2", "jtag", "mdio";
index f83c9a4afb3f4b630a1b1432310c80e69d4f4e4e..28005b3f35c439944dce1309d5401bae05910055 100644 (file)
@@ -14,7 +14,7 @@
                led-failsafe = &led_power_green;
                led-running = &led_power_green;
                led-upgrade = &led_power_green;
-               label-mac-device = &wifi1;
+               label-mac-device = &gmac0;
        };
 
        chosen {
        };
 };
 
+&gmac0 {
+       mtd-mac-address = <&radio 0x4>;
+};
+
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "wan";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "lan1";
+               };
+       };
+};
+
 &pcie {
        status = "okay";
 };
index 3cef0026b4d0ecd3315046a44115581c1f5ce134..b52ead09d3c1371ed2789a14f2d3524b340952b0 100644 (file)
@@ -8,7 +8,7 @@
 
 / {
        aliases {
-               label-mac-device = &ethernet;
+               label-mac-device = &gmac0;
        };
 
        chosen {
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0x4>;
+};
+
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "wan";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan4";
+               };
 
-       mediatek,portmap = "wllll";
-       port@5 {
-               status = "disabled";
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "lan1";
+               };
        };
 };
 
index c61ef885f2a9befda650b6c9a14b6b5d589e08e5..5a8ee2884c021184878e7d62060a8032689848a6 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "lan1";
+               };
+       };
+};
+
 &spi0 {
        status = "okay";
 
index e120ee3ca4656abb13bb0cbe4fae54f1cb86b4b8..85bbcd0b6a768df44899748d0ed8dc8b82d7aefe 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "lan1";
+               };
+       };
+};
+
 &spi0 {
        status = "okay";
 
index 57318f369483a00083af70607d950b59bac0095d..10b33993ac8d10f10af5dd0164e32cf94669e273 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe000>;
+                       mtd-mac-address-increment = <1>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "wdt", "rgmii2";
index 6e3eda52901615c380e55ecb5095c8f956d2c28b..b501034b7fba9aaebe1e32ba17a723dcb9962da6 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe000>;
+                       mtd-mac-address-increment = <1>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "jtag", "wdt";
index 8544e215280eb28f3bde33005a70b016f0f12c03..1cf121a7c3a47ed696693735281f657eb2fff023 100644 (file)
        status = "okay";
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "lan2";
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "jtag", "rgmii2", "uart3", "wdt";
index 0dae7b5ce7d968f4b9f4415b1e377872e3e77c8a..f279ccaae0fbb2d4bb76dadd7271ac9723acf42b 100644 (file)
        status = "okay";
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "lan2";
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "jtag", "rgmii2", "uart3", "wdt";
index d5fa290bcf3016ab0886fb1ea80821bdb74c7e2c..9d60d509abb53ff26efa8b67fa08e0770cf227de 100644 (file)
        };
 };
 
+&switch0 {
+       ports {
+               port@1 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "uart3", "jtag";
index 57c4638f1665c7e421b27941ff2f4863b96a6c0e..1fabad5da60aae3a4e16282d6ebbd2fc3716336e 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&iNIC_rf 0x4>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0x4>;
+                       mtd-mac-address-increment = <1>;
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "lan1";
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "uart2", "uart3", "jtag";
index ca08f1dabb22c1fec0da5a01aadb54eab14fe2fa..c345896bd2a5377f66e1cbf2ff799b091367e1cb 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0x4>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0x4>;
+                       mtd-mac-address-increment = <1>;
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "lan1";
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "uart2", "uart3", "jtag";
index c771eb20afc8c8415affccfb98204185c8f286a1..acef4d22a0938f4ef201b8c7761bfeb865007da9 100644 (file)
@@ -11,6 +11,7 @@
                led-failsafe = &led_power;
                led-running = &led_power;
                led-upgrade = &led_power;
+               label-mac-device = &wan;
        };
 
        chosen {
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               wan: port@0 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "lan1";
+               };
+       };
+};
+
 &pcie {
        status = "okay";
 };
index a208757c288595de1b4936863414c8a46b5c879e..94b0c18d45e1d96d5ce668fbdbd63f47114b99cd 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0x4>;
-       mediatek,portmap = "wllll";
+};
+
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "wan";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "lan1";
+               };
+       };
 };
 
 &state_default {
index 7ff01b133a1f9855e2cad667668a44753b8dd6cf..be8b101b78664003241c290ce6010271d752e4f1 100644 (file)
@@ -15,7 +15,7 @@
                led-failsafe = &led_cpu;
                led-running = &led_cpu;
                led-upgrade = &led_cpu;
-               label-mac-device = &ethernet;
+               label-mac-device = &gmac0;
        };
 
        chosen {
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&uboot 0x1fc20>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&uboot 0x1fc40>;
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "lan4";
+               };
+       };
+};
+
 &pcie {
        status = "okay";
 };
index 179a9cda4c6e16abc8bc55c5184a834350a3dfc1..b948236c15869c15c15bb29301c9a6aeef797007 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&uboot 0x1fc20>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&uboot 0x1fc40>;
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "lan1";
+               };
+       };
+};
+
 &pcie {
        status = "okay";
 };
index bdb9860291317207fd5f6f610d1fea72943a234e..126896c9066c514bd23387663fb945e8df568108 100644 (file)
@@ -15,6 +15,7 @@
                led-failsafe = &led_wps;
                led-running = &led_wps;
                led-upgrade = &led_wps;
+               label-mac-device = &wan;
        };
 
        chosen {
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+               wan: port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0x4>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "i2c", "uart3", "jtag", "wdt";
index 7f7dc9c3ea58e54fc1ee6dca3d8822eded0ff0a2..984c886ff3b7b2438627f3988f9ef5ec32acbaf4 100644 (file)
@@ -14,7 +14,7 @@
                led-failsafe = &led_blue;
                led-running = &led_blue;
                led-upgrade = &led_blue;
-               label-mac-device = &ethernet;
+               label-mac-device = &gmac0;
        };
 
        chosen {
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "wdt", "rgmii2", "jtag", "uart2", "uart3", "i2c";
index a97e64dbec3a5eabf050dfb5547083f4dd3e4747..c325b33f12880da43715bf8cfa7f02ab74506061 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0x2e>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+       };
+};
+
 &xhci {
        status = "disabled";
 };
index 4a225d81c4ba8d21786eb5220a0b97a2f7981f64..731eb4d8e2c0d5c2d53b0723410fe8a3abd0d3c4 100644 (file)
        status = "okay";
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0x5>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0x5>;
+                       mtd-mac-address-increment = <1>;
+               };
+       };
+};
+
 &pcie {
        status = "okay";
 };
index 93588b5d5380a74298e97814d9fe1ed1dbf8956a..8321caae6e132aa9570e95020a25860d510e75cb 100644 (file)
        status = "okay";
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
index ebb35b9204dc0a654a25dd84ca3bd7cb98c6ed40..a065ce804de0dccd19a39c6c6a7a1af62ced7c14 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&hard_config 0x0010>;
        mtd-mac-address-increment = <1>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&hard_config 0x0010>;
+                       mtd-mac-address-increment = <2>;
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "lan4";
+               };
+       };
+};
+
 &state_default {
        gpio {
                /* via gpio7 (uart3 group) the PoE status can be read */
index 85ea796f97f4a7178d01dde0479a23c85279860d..bcfce33a16fe0bb5f5fc3631d7b4a6f4124b87af 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&hard_config 0x0010>;
        mtd-mac-address-increment = <1>;
 };
 
+&switch0 {
+       ports {
+               /* FIXME: Is LAN port at switch port 0? */
+               port@0 {
+                       status = "okay";
+                       label = "lan";
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "uart2", "wdt", "rgmii2";
index d65d1de05c4c772a244ce4997d8d5e536b86a67b..f7889bd68a9f0041bd60811fd0ee5f40d5556be7 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&hard_config 0x0010>;
        mtd-mac-address-increment = <1>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&hard_config 0x0010>;
+                       mtd-mac-address-increment = <2>;
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "uart2", "wdt";
index f59cc57be3c3ae33f0a43e7a964758d60c21c99e..6870ed94a09864380bac7cff5bf0cf71b311870a 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe000>;
+                       mtd-mac-address-increment = <1>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "wdt", "rgmii2", "jtag", "mdio";
index 6e1c6eabaaaeddc155cb92a224dd474378bc9df4..eca7b3b0bbfa3af294e153ac11e1802849abe9ff 100644 (file)
@@ -14,7 +14,7 @@
                led-failsafe = &led_power;
                led-running = &led_power;
                led-upgrade = &led_power;
-               label-mac-device = &ethernet;
+               label-mac-device = &gmac0;
        };
 
        chosen {
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0x4>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0x4>;
+                       mtd-mac-address-increment = <1>;
+               };
+       };
+};
+
 &sdhci {
        status = "okay";
 };
index 701f8274a4f42ca1135243ca5fd92355ad0b1586..1b0b9e29e95884d4bfb2eef078c1dbf6d79e8f34 100644 (file)
        };
 };
 
-&ethernet {
-       mtd-mac-address = <&factory 0x00000004>;
+&gmac0 {
+       mtd-mac-address = <&factory 0x4>;
+};
+
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan";
+               };
+       };
 };
 
 &state_default {
index 07b696c42d567bea9ebd2725d1a894548b3fb355..b206cf7d95605ccc0cbf3738abe64e83a053ccd2 100644 (file)
@@ -12,7 +12,6 @@
                led-failsafe = &led_power_orange;
                led-running = &led_power_white;
                led-upgrade = &led_power_orange;
-               label-mac-device = &ethernet;
        };
 
        leds {
index a64c976a4450036a2188a73817a43bc8dee64994..cce701ea325227757cec65a0b78e898fcb34d25a 100644 (file)
@@ -12,7 +12,6 @@
                led-failsafe = &led_power_orange;
                led-running = &led_power_white;
                led-upgrade = &led_power_orange;
-               label-mac-device = &ethernet;
        };
 
        leds {
index ba0853d3cad5cdb028297a93eda228dfb3169474..0b9e7c6626dbcc622a6e1d7b781ccd4e49b48df3 100644 (file)
@@ -13,7 +13,7 @@
                led-failsafe = &led_power;
                led-running = &led_power;
                led-upgrade = &led_power;
-               label-mac-device = &ethernet;
+               label-mac-device = &gmac0;
        };
 
        chosen {
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0x4>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0x4>;
+                       mtd-mac-address-increment = <1>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "uart3", "uart2", "jtag", "wdt";
index 12621d8b7113b39a8a78b5220adf0f281161acb7..d2e5502e4872330ecf99b09bc62f2be20e27ba7c 100644 (file)
@@ -8,6 +8,10 @@
 / {
        compatible = "mediatek,mt7621-soc";
 
+       aliases {
+               label-mac-device = &gmac0;
+       };
+
        chosen {
                bootargs = "console=ttyS0,57600";
        };
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0x4>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0x4>;
+                       mtd-mac-address-increment = <2>;
+               };
+       };
+};
+
 &i2c {
        status = "okay";
 
index c7dcfae87032f0f57136c0730cffe988e1535e30..b781edf6beaebe89f5cac5042a628156e4d40a35 100644 (file)
@@ -13,7 +13,7 @@
                led-failsafe = &led_power;
                led-running = &led_power;
                led-upgrade = &led_power;
-               label-mac-device = &ethernet;
+               label-mac-device = &gmac0;
        };
 
        chosen {
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0x4>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0x4>;
+                       mtd-mac-address-increment = <2>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "uart3", "uart2", "jtag", "wdt";
index 11aa68d8f1f50531e0196c3665fc733eb8c87022..e937134ae9bbffdfe70801e6caeef69cd15664fa 100644 (file)
@@ -14,7 +14,7 @@
                led-failsafe = &led_wps;
                led-running = &led_wps;
                led-upgrade = &led_wps;
-               label-mac-device = &ethernet;
+               label-mac-device = &gmac0;
        };
 
        chosen {
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "uart3", "uart2";
index 104d10fdb333b7c1cd6d74e78f2a8d41e3b4d9f6..761b690d1e3b725ccc57f27c0d004744d25fba4a 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "i2c", "jtag";
index 30257ffb5a01229c57c7f7e9e1856f66de866cd6..7114ba9834af59d065a23b8bde1234de7805f4cb 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
index cf982d1a86f70f91cfd754c20db489bf7059f99a..4bd7611359437b682f0a4c522e117fa7c2cb6585 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
index 7a5b2a840c2c9633b6e24f162e458c60d305932a..84bd049d8aee0bbec282be56ed0784159fd3edaa 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe006>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+                       mtd-mac-address-increment = <1>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "uart3", "jtag";
index fa85cf10178dac9a0b05a2e34e3aaa9b6f2c9f41..7c94db8dcb39b6879cf45144464acd97dbcd8ddc 100644 (file)
        status = "okay";
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe006>;
-       mediatek,portmap = "llllw";
+};
+
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+                       mtd-mac-address-increment = <1>;
+               };
+       };
 };
 
 &state_default {
index 195750a27d0ab509e1a84a14410f29421d7b8518..60eea877b15e2f190cbbf3a28715c45733119015 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@4 {
+                       status = "okay";
+                       label = "lan";
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "i2c", "uart2", "jtag";
index db6edde74da579f1e27c6e5bc04433525ce3f4b2..fd24d40fe18740eb0333c44efda38c17248e3299 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe000>;
+                       mtd-mac-address-increment = <1>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "i2c", "wdt";
index 13faedd0ea2899dc8bc85fbdea22e8fca5f92ddc..d04d87dd378acdb29a1ce083671e3a2167781dd2 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&config 0x10008>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan";
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "rgmii2", "wdt";
index 265739bbda6f93ec1e949f8652591fb53de60f77..a26ad98cc22b0f380f8d14c4f6e7a1a2263d482b 100644 (file)
@@ -15,7 +15,7 @@
                led-failsafe = &led_power;
                led-running = &led_power;
                led-upgrade = &led_power;
-               label-mac-device = &ethernet;
+               label-mac-device = &gmac0;
        };
 
        chosen {
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&config 0x10008>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan";
+               };
+       };
+};
+
+
 &state_default {
        gpio {
                groups = "rgmii2", "wdt";
index 1efc930d497e3c43da2bc8d4629efe9b49c992d3..6fed4a0b7bfabf675d0d4863081ef0022c53a822 100644 (file)
@@ -5,7 +5,7 @@
 
 / {
        aliases {
-               label-mac-device = &ethernet;
+               label-mac-device = &gmac0;
        };
 
        chosen {
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0x22>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0x22>;
+                       mtd-mac-address-increment = <1>;
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "lan4";
+               };
+       };
+};
+
 &nand {
        status = "okay";
 
index 9b3a5be4449ccf254040e54639639e1b5da87da1..6292762ea7a8c7dd8e49b5a5425b1fff47028c06 100644 (file)
@@ -15,8 +15,7 @@
                led-failsafe = &led_white;
                led-running = &led_blue;
                led-upgrade = &led_blue;
-
-               label-mac-device = &ethernet;
+               label-mac-device = &gmac0;
        };
 
        chosen {
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&eeprom 0x0>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan";
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "i2c", "uart2";
index c4116e85416d693695d0262b287c2f6d5ea0d515..ca0e2d7dcd0872a008047abaa298e5c0291a42c3 100644 (file)
        status = "okay";
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
-       mediatek,portmap = "llllw";
+};
+
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe000>;
+                       mtd-mac-address-increment = <1>;
+               };
+       };
 };
 
 &state_default {
index d519961424a0bb917ee2c3913dda4f8486d0ac4f..95923632602bde0dedc79edffb824a398639c779 100644 (file)
@@ -4,6 +4,10 @@
 #include <dt-bindings/input/input.h>
 
 / {
+       aliases {
+               label-mac-device = &wan;
+       };
+
        chosen {
                bootargs = "console=ttyS0,57600";
        };
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan1";
+               };
+               wan: port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0x2e>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "wdt", "rgmii2";
index a8125d355edc2d12d2ada4058c485c67561c0723..41e11216d2f2e1a9c7640c625d6bddd715627492 100644 (file)
@@ -15,6 +15,7 @@
                led-failsafe = &led_status_yellow;
                led-running = &led_status_blue;
                led-upgrade = &led_status_yellow;
+               label-mac-device = &wan;
        };
 
        chosen {
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
-       mediatek,portmap = "llllw";
+};
+
+&switch0 {
+       ports {
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan1";
+               };
+               wan: port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+               };
+       };
 };
 
 &state_default {
index a4ffb150b32c209ae903b159f7ac2cc5b9dd99b0..60786e421e447ece63a20bd6a76d728384ffd7ca 100644 (file)
@@ -14,6 +14,7 @@
                led-failsafe = &led_status_red;
                led-running = &led_status_blue;
                led-upgrade = &led_status_yellow;
+               label-mac-device = &gmac0;
        };
 
        chosen {
                wan_amber {
                        label = "mir3g:amber:wan";
                        gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "dsa-0.0:01:1Gbps";
                };
 
                lan1_amber {
                        label = "mir3g:amber:lan1";
                        gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "dsa-0.0:03:1Gbps";
                };
 
                lan2_amber {
                        label = "mir3g:amber:lan2";
                        gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "dsa-0.0:02:1Gbps";
                };
        };
 
        };
 };
 
-&ethernet {
-       mtd-mac-address = <&factory 0xe000>;
-       mediatek,portmap = "lwlll";
+&gmac0 {
+       mtd-mac-address = <&factory 0xe006>;
+};
+
+&switch0 {
+       ports {
+               port@1 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe000>;
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan1";
+               };
+       };
 };
 
 &state_default {
index 45d7411bd01fd71cb96460cbe33167e0b7c7fe7e..8a85c8b48d54d8ed442b431cfbd696faeeaf4c2f 100644 (file)
@@ -15,6 +15,7 @@
                led-failsafe = &led_status_red;
                led-running = &led_status_blue;
                led-upgrade = &led_status_yellow;
+               label-mac-device = &gmac0;
        };
 
        chosen {
                wan_amber {
                        label = "mir3p:amber:wan";
                        gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "dsa-0.0:04:1Gbps";
                };
 
                lan3_amber {
                        label = "mir3p:amber:lan3";
                        gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "dsa-0.0:01:1Gbps";
                };
 
                lan2_amber {
                        label = "mir3p:amber:lan2";
                        gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "dsa-0.0:02:1Gbps";
                };
 
                lan1_amber {
                        label = "mir3p:amber:lan1";
                        gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "dsa-0.0:03:1Gbps";
                };
        };
 
        };
 };
 
-&ethernet {
-       mtd-mac-address = <&factory 0xe000>;
-       mediatek,portmap = "llllw";
+&gmac0 {
+       mtd-mac-address = <&factory 0xe006>;
+};
+
+&switch0 {
+       ports {
+               port@1 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe000>;
+               };
+       };
 };
 
 &state_default {
index 618c0ab565940644db97ea8a3efc314447a347e8..d99cc7d2578e4e6c99b99de1763e4ddd9af58522 100644 (file)
@@ -14,7 +14,7 @@
                led-failsafe = &led_sys;
                led-running = &led_sys;
                led-upgrade = &led_sys;
-               label-mac-device = &ethernet;
+               label-mac-device = &gmac0;
        };
 
        chosen {
        status = "okay";
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0x4>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0x4>;
+                       mtd-mac-address-increment = <1>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "uart3", "wdt";
index ad8f7fdc9147f2feeaa3060dfa49885204e186b6..36ef348ec5c2cc8020838d10f2eb9eac344d7ea9 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe000>;
+                       mtd-mac-address-increment = <1>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "wdt", "rgmii2";
index aa749ec6b827b5f8fd61efe3e7b4fe1612052b7f..c70350fd41db4c58869d53dc2ea917f60133d1f6 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "lan4";
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "i2c", "uart2", "uart3", "wdt";
index 49fa312f584b5dc8dab89d96370b6fe5f810ed50..e43ee8451ac1d09b364a273f63ec699f7d6daee1 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "jtag", "wdt";
index 6d765a2a61575f296819551d5025ba619aee1223..f91f0d77d40bba84422264bf34942ce8b202bf4e 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+               };
+       };
+};
+
 &pcie {
        status = "okay";
 };
index 8088d5e8b41a49a736f333d53a99bed1d31ae3d9..1f43f2a2dcc7b661dffd7b93ddeb7470b9ed3699 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe006>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "wdt";
index fba959c8df3741610834f15fe60b6202131d2d4e..6461302154f900736e371216c35ac7b66e51f29e 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe000>;
+                       mtd-mac-address-increment = <1>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "wdt", "rgmii2", "jtag", "mdio";
index 69779976339e13e5a19f3e2ee7deb2da47a16b00..9728119adf1e03eba7f6fb2b785224d7f4ecad2b 100644 (file)
        };
 };
 
-&ethernet {
+&gmac0 {
        mtd-mac-address = <&factory 0xe000>;
 };
 
+&switch0 {
+       ports {
+               port@0 {
+                       status = "okay";
+                       label = "lan1";
+               };
+
+               port@1 {
+                       status = "okay";
+                       label = "lan2";
+               };
+
+               port@2 {
+                       status = "okay";
+                       label = "lan3";
+               };
+
+               port@3 {
+                       status = "okay";
+                       label = "lan4";
+               };
+
+               port@4 {
+                       status = "okay";
+                       label = "wan";
+                       mtd-mac-address = <&factory 0xe000>;
+                       mtd-mac-address-increment = <1>;
+               };
+       };
+};
+
 &state_default {
        gpio {
                groups = "wdt", "rgmii2", "jtag", "mdio";
index 7695cb991893e9481edcc3917f642bab43bec591..66739a75368e84b2326f405ec1f7a0eb3d15c231 100755 (executable)
@@ -18,21 +18,21 @@ led_wlan="$(get_dt_led wlan)"
 
 case $board in
 d-team,newifi-d2)
-       ucidef_set_led_switch "internet" "internet" "$boardname:amber:internet" "switch0" "0x10"
+       ucidef_set_led_netdev "internet" "internet" "$boardname:amber:internet" "wan"
        ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:blue:wlan2g" "wlan0"
        ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:blue:wlan5g" "wlan1"
        ;;
 d-team,pbr-m1|\
 gehua,ghl-r-001)
-       ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
+       ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "wan"
        ;;
 dlink,dir-860l-b1)
-       ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "eth0.2"
+       ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "wan"
        ;;
 gnubee,gb-pc1|\
 gnubee,gb-pc2)
-       ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x01"
-       ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x10"
+       ucidef_set_led_netdev "lan1" "lan1" "$boardname:green:lan1" "lan1"
+       ucidef_set_led_netdev "lan2" "lan2" "$boardname:green:lan2" "lan2"
        ;;
 mikrotik,rbm11g)
        ucidef_set_rssimon "wlan0" "200000" "1"
@@ -43,46 +43,35 @@ mikrotik,rbm11g)
        ucidef_set_led_rssi "rssiveryhigh" "RSSIVERYHIGH" "$boardname:green:rssi4" "wlan0" "80" "100"
        ;;
 mtc,wr1201)
-       ucidef_set_led_switch "eth_link" "LAN link" "$boardname:green:eth_link" "switch0" "0x0f"
+       ucidef_set_led_netdev "eth_link" "LAN link" "$boardname:green:eth_link" "br-lan"
        ;;
 netgear,r6220|\
 netgear,r6260|\
 netgear,r6350|\
 netgear,r6850|\
 netgear,wndr3700-v5)
-       ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
+       ucidef_set_led_netdev "wan" "wan" "$boardname:green:wan" "wan"
        ;;
 netgear,r6700-v2|\
 netgear,r6800)
-       ucidef_set_led_switch "wan" "WAN" "$boardname:white:wan" "switch0" "0x10"
-       ucidef_set_led_switch "lan1" "LAN1" "$boardname:white:lan1" "switch0" "0x08"
-       ucidef_set_led_switch "lan2" "LAN2" "$boardname:white:lan2" "switch0" "0x04"
-       ucidef_set_led_switch "lan3" "LAN3" "$boardname:white:lan3" "switch0" "0x02"
-       ucidef_set_led_switch "lan4" "LAN4" "$boardname:white:lan4" "switch0" "0x01"
+       ucidef_set_led_netdev "wan" "WAN" "$boardname:white:wan" "wan"
+       ucidef_set_led_netdev "lan1" "LAN1" "$boardname:white:lan1" "lan1"
+       ucidef_set_led_netdev "lan2" "LAN2" "$boardname:white:lan2" "lan2"
+       ucidef_set_led_netdev "lan3" "LAN3" "$boardname:white:lan3" "lan3"
+       ucidef_set_led_netdev "lan4" "LAN4" "$boardname:white:lan4" "lan4"
        ;;
 tplink,re350-v1|\
 tplink,re650-v1)
        ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "$boardname:blue:wifi2G" "wlan0"
        ucidef_set_led_netdev "wifi5g" "Wifi 5G" "$boardname:blue:wifi5G" "wlan1"
-       ucidef_set_led_netdev "eth_act" "LAN act" "$boardname:green:eth_act" "eth0" "tx rx"
-       ucidef_set_led_switch "eth_link" "LAN link" "$boardname:green:eth_link" "switch0" "0x01"
-       ;;
-xiaomi,mir3g)
-       ucidef_set_led_switch "wan-amber"  "WAN (amber)"  "$boardname:amber:wan"  "switch0" "0x02" "0x08"
-       ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x08" "0x08"
-       ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08"
-       ;;
-xiaomi,mir3p)
-       ucidef_set_led_switch "wan-amber"  "WAN (amber)"  "$boardname:amber:wan"  "switch0" "0x10" "0x08"
-       ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x02" "0x08"
-       ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08"
-       ucidef_set_led_switch "lan3-amber" "LAN3 (amber)" "$boardname:amber:lan3" "switch0" "0x08" "0x08"
+       ucidef_set_led_netdev "eth_act" "LAN act" "$boardname:green:eth_act" "lan" "tx rx"
+       ucidef_set_led_netdev "eth_link" "LAN link" "$boardname:green:eth_link" "lan" "link"
        ;;
 xzwifi,creativebox-v1)
-       ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x10"
+       ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "wan"
        ;;
 youhua,wr1200js)
-       ucidef_set_led_switch "internet" "INTERNET" "$boardname:green:wan" "switch0" "0x01"
+       ucidef_set_led_netdev "internet" "INTERNET" "$boardname:green:wan" "wan"
        ;;
 esac
 
index a68ffe6126289a377d7bf6aa21a6c2f4a2525490..f27ffcccbf2f523eace2149a793a05dd8d8447c2 100755 (executable)
@@ -11,140 +11,95 @@ ramips_setup_interfaces()
        case $board in
        adslr,g7|\
        afoundry,ew1200|\
+       alfa-network,quad-e4g|\
+       asus,rt-ac57u|\
+       asus,rt-ac65p|\
+       asus,rt-ac85p|\
+       buffalo,wsr-1166dhp|\
+       buffalo,wsr-600dhp|\
+       dlink,dir-860l-b1|\
+       d-team,newifi-d2|\
        d-team,pbr-m1|\
+       edimax,ra21s|\
+       edimax,rg21s|\
+       elecom,wrc-1167ghbk2-s|\
+       elecom,wrc-1900gst|\
+       elecom,wrc-2533gst|\
        firefly,firewrt|\
+       iodata,wn-ax1167gr|\
+       iodata,wn-ax1167gr2|\
+       iodata,wn-dx1167r|\
+       iodata,wn-gx300gr|\
+       iodata,wnpr2600g|\
+       iptime,a6ns-m|\
+       iptime,a8004t|\
        jcg,jhr-ac876m|\
        mediatek,ap-mt7621a-v60|\
        mediatek,mt7621-eval-board|\
+       mikrotik,rb750gr3|\
        mqmaker,witi|\
        mtc,wr1201|\
+       netgear,r6220|\
+       netgear,r6260|\
+       netgear,r6350|\
+       netgear,r6700-v2|\
+       netgear,r6800|\
+       netgear,r6850|\
+       netgear,wndr3700-v5|\
+       netis,wf2881|\
        phicomm,k2p|\
        planex,vr500|\
        samknows,whitebox-v8|\
        storylink,sap-g3200u3|\
        telco-electronics,x1|\
        totolink,a7000r|\
+       ubiquiti,edgerouterx|\
+       ubiquiti,edgerouterx-sfp|\
        unielec,u7621-06-16m|\
        unielec,u7621-06-64m|\
+       wevo,11acnas|\
+       wevo,w2914ns-v2|\
        xiaoyu,xy-c5|\
        xzwifi,creativebox-v1|\
+       youhua,wr1200js|\
        youku,yk-l2|\
        zbtlink,zbt-we1326|\
        zbtlink,zbt-we3526|\
        zbtlink,zbt-wg2626|\
        zbtlink,zbt-wg3526-16m|\
-       zbtlink,zbt-wg3526-32m)
-               ucidef_add_switch "switch0" \
-                       "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
-               ;;
-       alfa-network,quad-e4g|\
-       netgear,r6220|\
-       netgear,r6260|\
-       netgear,r6350|\
-       netgear,r6700-v2|\
-       netgear,r6800|\
-       netgear,r6850|\
-       netgear,wndr3700-v5|\
-       netis,wf2881|\
-       wevo,11acnas|\
-       wevo,w2914ns-v2|\
+       zbtlink,zbt-wg3526-32m|\
        zio,freezio)
-               ucidef_add_switch "switch0" \
-                       "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
+               ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
                ;;
        asiarf,ap7621-001)
-               ucidef_add_switch "switch0" "0:lan" "4:wan" "6@eth0"
-               ;;
-       asiarf,ap7621-nv1)
-               ucidef_add_switch "switch0" "0:wan" "2:lan" "3:lan" "6@eth0"
+               ucidef_set_interfaces_lan_wan "lan" "wan"
                ;;
-       asus,rt-ac65p|\
-       asus,rt-ac57u|\
-       asus,rt-ac85p|\
-       iptime,a6ns-m|\
-       mikrotik,rb750gr3|\
-       ubiquiti,edgerouterx|\
-       ubiquiti,edgerouterx-sfp|\
-       youhua,wr1200js)
-               ucidef_add_switch "switch0" \
-                       "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
-               ;;
-       dlink,dir-860l-b1|\
-       elecom,wrc-1167ghbk2-s|\
-       elecom,wrc-1900gst|\
-       elecom,wrc-2533gst|\
-       iodata,wn-ax1167gr|\
-       iodata,wn-ax1167gr2|\
-       iodata,wn-dx1167r|\
-       iodata,wn-gx300gr|\
-       iodata,wnpr2600g|\
-       iptime,a8004t)
-               ucidef_add_switch "switch0" \
-                       "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0"
-               ;;
-       buffalo,wsr-1166dhp|\
-       buffalo,wsr-600dhp)
-               ucidef_add_switch "switch0" \
-                       "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "4:wan:5" "6@eth0"
-               ;;
-       d-team,newifi-d2)
-               ucidef_add_switch "switch0" \
-                       "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0"
-               ;;
-       edimax,ra21s|\
-       edimax,rg21s)
-               ucidef_add_switch "switch0" \
-                       "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0"
+       asiarf,ap7621-nv1|\
+       lenovo,newifi-d1|\
+       mikrotik,rbm33g|\
+       xiaomi,mir3g|\
+       xiaomi,mir3g-v2)
+               ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
                ;;
-       gehua,ghl-r-001)
-               ucidef_add_switch "switch0" \
-                       "0:lan" "1:lan" "2:lan" "4:wan" "6@eth0"
+       gehua,ghl-r-001|\
+       hiwifi,hc5962|\
+       xiaomi,mir3p)
+               ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
                ;;
        gnubee,gb-pc1|\
        gnubee,gb-pc2)
-               ucidef_add_switch "switch0" \
-                       "0:lan" "4:lan" "6@eth0"
-               ;;
-       hiwifi,hc5962)
-               ucidef_add_switch "switch0" \
-                       "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
-               ;;
-       lenovo,newifi-d1)
-               ucidef_add_switch "switch0" \
-               "1:lan:2" "2:lan:1" "4:wan" "6@eth0"
+               ucidef_set_interface_lan "lan1 lan2"
                ;;
        linksys,re6500)
-               ucidef_add_switch "switch0" \
-                       "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "6@eth0"
+               ucidef_set_interface_lan "lan1 lan2 lan3 lan4"
                ;;
        mikrotik,rbm11g|\
-       thunder,timecloud)
-               ucidef_add_switch "switch0"
-               ucidef_add_switch_attr "switch0" "enable" "false"
-               ucidef_set_interface_lan "eth0"
-               ;;
-       mikrotik,rbm33g)
-               ucidef_add_switch "switch0" \
-                       "1:lan" "2:lan" "0:wan" "6@eth0"
-               ;;
        netgear,ex6150|\
+       thunder,timecloud|\
        tplink,re350-v1|\
        tplink,re650-v1|\
        ubnt,unifi-nanohd)
-               ucidef_add_switch "switch0" \
-                       "0:lan" "6@eth0"
-               ;;
-       xiaomi,mir3g)
-               ucidef_add_switch "switch0" \
-                       "2:lan:2" "3:lan:1" "1:wan" "6t@eth0"
-               ;;
-       xiaomi,mir3g-v2)
-               ucidef_add_switch "switch0" \
-                       "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
-               ;;
-       xiaomi,mir3p)
-               ucidef_add_switch "switch0" \
-                       "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
+               ucidef_set_interface_lan "lan"
                ;;
        *)
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
@@ -160,39 +115,6 @@ ramips_setup_macs()
        local label_mac=""
 
        case $board in
-       adslr,g7)
-               wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0xe00c)" 1)
-               ;;
-       afoundry,ew1200|\
-       asiarf,ap7621-001|\
-       asiarf,ap7621-nv1|\
-       firefly,firewrt|\
-       gehua,ghl-r-001|\
-       mqmaker,witi|\
-       totolink,a7000r|\
-       unielec,u7621-06-16m|\
-       unielec,u7621-06-64m|\
-       xzwifi,creativebox-v1|\
-       zbtlink,zbt-wg2626)
-               wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0xe000)" 1)
-               ;;
-       alfa-network,quad-e4g|\
-       asus,rt-ac57u|\
-       d-team,newifi-d2|\
-       d-team,pbr-m1|\
-       elecom,wrc-1167ghbk2-s|\
-       elecom,wrc-1900gst|\
-       elecom,wrc-2533gst|\
-       lenovo,newifi-d1|\
-       netis,wf2881|\
-       phicomm,k2p|\
-       planex,vr500|\
-       samknows,whitebox-v8|\
-       youhua,wr1200js|\
-       youku,yk-l2|\
-       zbtlink,zbt-we3526)
-               wan_mac=$(mtd_get_mac_binary factory 0xe006)
-               ;;
        asus,rt-ac65p|\
        asus,rt-ac85p)
                wan_mac=$(mtd_get_mac_ascii u-boot-env et1macaddr)
@@ -206,7 +128,6 @@ ramips_setup_macs()
        dlink,dir-860l-b1)
                lan_mac=$(mtd_get_mac_ascii factory lanmac)
                wan_mac=$(mtd_get_mac_ascii factory wanmac)
-               label_mac=$(mtd_get_mac_binary radio 0x4)
                ;;
        edimax,ra21s|\
        edimax,rg21s)
@@ -219,73 +140,17 @@ ramips_setup_macs()
                [ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address)
                wan_mac=$(macaddr_add "$lan_mac" 1)
                ;;
-       iodata,wn-ax1167gr|\
-       iodata,wn-gx300gr|\
-       mtc,wr1201|\
-       netgear,r6220|\
-       netgear,wndr3700-v5|\
-       xiaoyu,xy-c5)
-               wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1)
-               ;;
-       iodata,wn-ax1167gr2|\
-       iodata,wn-dx1167r|\
-       xiaomi,mir3g-v2)
-               wan_mac=$(mtd_get_mac_binary factory 0xe006)
-               label_mac=$wan_mac
-               ;;
        iodata,wnpr2600g)
                wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
                label_mac=$wan_mac
                ;;
-       iptime,a6ns-m|\
-       iptime,a8004t)
-               wan_mac=$(mtd_get_mac_binary u-boot 0x1fc40)
-               ;;
-       jcg,jhr-ac876m)
-               label_mac=$(mtd_get_mac_binary factory 0x4)
-               wan_mac=$label_mac
-               ;;
-       mediatek,ap-mt7621a-v60)
-               wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x5)" 1)
-               ;;
        mikrotik,rb750gr3|\
        mikrotik,rbm33g)
-               wan_mac=$(macaddr_add "$(mtd_get_mac_binary hard_config 0x10)" 2)
                label_mac=$(mtd_get_mac_binary hard_config 0x10)
                ;;
-       netgear,r6260|\
-       netgear,r6350|\
-       netgear,r6700-v2|\
-       netgear,r6800|\
-       netgear,r6850)
-               wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 2)
-               ;;
-       storylink,sap-g3200u3|\
-       telco-electronics,x1)
-               wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0xe006)" 1)
-               ;;
-       ubiquiti,edgerouterx|\
-       ubiquiti,edgerouterx-sfp)
-               wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x22)" 1)
-               ;;
-       wevo,11acnas|\
-       wevo,w2914ns-v2|\
-       zio,freezio)
-               wan_mac=$(mtd_get_mac_binary factory 0x2e)
-               label_mac=$wan_mac
-               ;;
-       xiaomi,mir3g|\
-       xiaomi,mir3p)
-               lan_mac=$(mtd_get_mac_binary factory 0xe006)
-               label_mac=$lan_mac
-               ;;
-       zbtlink,zbt-we1326)
-               wan_mac=$(mtd_get_mac_binary factory 0xe006)
-               label_mac=$(mtd_get_mac_binary factory 0x4)
-               ;;
+       zbtlink,zbt-we1326|\
        zbtlink,zbt-wg3526-16m|\
        zbtlink,zbt-wg3526-32m)
-               wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0xe000)" 1)
                label_mac=$(mtd_get_mac_binary factory 0x4)
                ;;
        esac