From 30644bc579e771e4b6dcc165ca966124e0259e1e Mon Sep 17 00:00:00 2001 From: DENG Qingfang Date: Wed, 18 Mar 2020 23:38:58 +0800 Subject: [PATCH] ramips: mt7621: update dts/defconfig for DSA 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 Acked-by: Jo-Philipp Wich [split commit] Signed-off-by: Chuanhong Guo --- target/linux/ramips/dts/mt7621_adslr_g7.dts | 35 ++- .../ramips/dts/mt7621_afoundry_ew1200.dts | 39 ++- .../dts/mt7621_alfa-network_quad-e4g.dts | 34 ++- .../ramips/dts/mt7621_asiarf_ap7621-001.dts | 16 ++ .../ramips/dts/mt7621_asiarf_ap7621-nv1.dts | 21 ++ .../ramips/dts/mt7621_asiarf_ap7621.dtsi | 3 +- .../linux/ramips/dts/mt7621_asus_rt-ac57u.dts | 32 ++- .../ramips/dts/mt7621_asus_rt-acx5p.dtsi | 35 ++- .../ramips/dts/mt7621_buffalo_wsr-1166dhp.dts | 29 +++ .../ramips/dts/mt7621_buffalo_wsr-600dhp.dts | 31 ++- .../ramips/dts/mt7621_d-team_newifi-d2.dts | 34 ++- .../linux/ramips/dts/mt7621_d-team_pbr-m1.dts | 32 ++- .../ramips/dts/mt7621_dlink_dir-860l-b1.dts | 35 ++- .../linux/ramips/dts/mt7621_edimax_rx21s.dtsi | 34 ++- .../dts/mt7621_elecom_wrc-1167ghbk2-s.dts | 32 ++- .../ramips/dts/mt7621_elecom_wrc-gst.dtsi | 32 ++- .../ramips/dts/mt7621_firefly_firewrt.dts | 33 ++- .../ramips/dts/mt7621_gehua_ghl-r-001.dts | 28 +- .../linux/ramips/dts/mt7621_gnubee_gb-pc1.dts | 16 +- .../linux/ramips/dts/mt7621_gnubee_gb-pc2.dts | 16 +- .../linux/ramips/dts/mt7621_hiwifi_hc5962.dts | 24 ++ .../ramips/dts/mt7621_iodata_wn-ax1167gr.dts | 33 ++- .../ramips/dts/mt7621_iodata_wn-gx300gr.dts | 33 ++- .../ramips/dts/mt7621_iodata_wn-xx-xr.dtsi | 33 ++- .../ramips/dts/mt7621_iodata_wnpr2600g.dts | 32 ++- .../linux/ramips/dts/mt7621_iptime_a6ns-m.dts | 34 ++- .../linux/ramips/dts/mt7621_iptime_a8004t.dts | 32 ++- .../ramips/dts/mt7621_jcg_jhr-ac876m.dts | 32 ++- .../ramips/dts/mt7621_lenovo_newifi-d1.dts | 24 +- .../ramips/dts/mt7621_linksys_re6500.dts | 26 +- .../dts/mt7621_mediatek_ap-mt7621a-v60.dts | 33 ++- .../dts/mt7621_mediatek_mt7621-eval-board.dts | 29 +++ .../ramips/dts/mt7621_mikrotik_rb750gr3.dts | 33 ++- .../ramips/dts/mt7621_mikrotik_rbm11g.dts | 12 +- .../ramips/dts/mt7621_mikrotik_rbm33g.dts | 23 +- .../linux/ramips/dts/mt7621_mqmaker_witi.dts | 33 ++- target/linux/ramips/dts/mt7621_mtc_wr1201.dts | 35 ++- .../ramips/dts/mt7621_netgear_ex6150.dts | 13 +- .../ramips/dts/mt7621_netgear_r6700-v2.dts | 1 - .../linux/ramips/dts/mt7621_netgear_r6800.dts | 1 - .../dts/mt7621_netgear_sercomm_ayx.dtsi | 35 ++- .../dts/mt7621_netgear_sercomm_bzv.dtsi | 37 ++- .../dts/mt7621_netgear_sercomm_chj.dtsi | 35 ++- .../linux/ramips/dts/mt7621_netis_wf2881.dts | 34 ++- .../linux/ramips/dts/mt7621_phicomm_k2p.dts | 32 ++- .../linux/ramips/dts/mt7621_planex_vr500.dts | 32 ++- .../dts/mt7621_samknows_whitebox-v8.dts | 32 ++- .../dts/mt7621_storylink_sap-g3200u3.dts | 33 ++- .../dts/mt7621_telco-electronics_x1.dts | 34 ++- .../ramips/dts/mt7621_thunder_timecloud.dts | 11 +- .../ramips/dts/mt7621_totolink_a7000r.dts | 33 ++- .../ramips/dts/mt7621_tplink_re350-v1.dts | 11 +- .../ramips/dts/mt7621_tplink_re650-v1.dts | 14 +- .../dts/mt7621_ubiquiti_edgerouterx.dtsi | 35 ++- .../ramips/dts/mt7621_ubnt_unifi-nanohd.dts | 14 +- .../ramips/dts/mt7621_unielec_u7621-06.dtsi | 34 ++- .../ramips/dts/mt7621_wevo_w2914ns-v2.dtsi | 35 ++- .../ramips/dts/mt7621_xiaomi_mir3g-v2.dts | 23 +- .../linux/ramips/dts/mt7621_xiaomi_mir3g.dts | 29 ++- .../linux/ramips/dts/mt7621_xiaomi_mir3p.dts | 35 ++- .../linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts | 35 ++- .../dts/mt7621_xzwifi_creativebox-v1.dts | 33 ++- .../ramips/dts/mt7621_youhua_wr1200js.dts | 32 ++- .../linux/ramips/dts/mt7621_youku_yk-l2.dts | 32 ++- .../ramips/dts/mt7621_zbtlink_zbt-we1326.dts | 32 ++- .../ramips/dts/mt7621_zbtlink_zbt-we3526.dts | 32 ++- .../ramips/dts/mt7621_zbtlink_zbt-wg2626.dts | 33 ++- .../ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi | 33 ++- .../mt7621/base-files/etc/board.d/01_leds | 43 ++-- .../mt7621/base-files/etc/board.d/02_network | 239 ++++-------------- 70 files changed, 1888 insertions(+), 317 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_adslr_g7.dts b/target/linux/ramips/dts/mt7621_adslr_g7.dts index 91a6ab26abd0..2448248c3101 100644 --- a/target/linux/ramips/dts/mt7621_adslr_g7.dts +++ b/target/linux/ramips/dts/mt7621_adslr_g7.dts @@ -15,7 +15,7 @@ led-failsafe = &led_sys; led-running = &led_sys; led-upgrade = &led_sys; - label-mac-device = ðernet; + label-mac-device = &gmac0; }; chosen { @@ -105,10 +105,41 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts b/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts index 877b8d7d9d45..c0166c730aed 100644 --- a/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts +++ b/target/linux/ramips/dts/mt7621_afoundry_ew1200.dts @@ -20,12 +20,6 @@ bootargs = "console=ttyS0,57600"; }; - palmbus: palmbus@1E000000 { - i2c@900 { - status = "okay"; - }; - }; - keys { compatible = "gpio-keys"; @@ -117,10 +111,41 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts b/target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts index 266e765d7bc7..6ac9e337fcbe 100644 --- a/target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts +++ b/target/linux/ramips/dts/mt7621_alfa-network_quad-e4g.dts @@ -11,7 +11,7 @@ model = "ALFA Network Quad-E4G"; aliases { - label-mac-device = ðernet; + label-mac-device = &gmac0; led-boot = &led_system; led-failsafe = &led_system; led-running = &led_system; @@ -148,10 +148,40 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts b/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts index 9926a9bd5a13..6e2142073327 100644 --- a/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts +++ b/target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts @@ -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>; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts b/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts index ec322d0e08c8..977f43e114c7 100644 --- a/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts +++ b/target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts @@ -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"; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7621_asiarf_ap7621.dtsi b/target/linux/ramips/dts/mt7621_asiarf_ap7621.dtsi index a965cb4e6322..bd6642fe5149 100644 --- a/target/linux/ramips/dts/mt7621_asiarf_ap7621.dtsi +++ b/target/linux/ramips/dts/mt7621_asiarf_ap7621.dtsi @@ -103,9 +103,8 @@ status = "okay"; }; -ðernet { +&gmac0 { mtd-mac-address = <&factory 0xe000>; - mediatek,portmap = "llllw"; }; &state_default { diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ac57u.dts b/target/linux/ramips/dts/mt7621_asus_rt-ac57u.dts index ac1d88a6cee9..0b37dc839529 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-ac57u.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-ac57u.dts @@ -134,10 +134,40 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi b/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi index c1ef3ce98c6d..37056c7934ba 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi +++ b/target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi @@ -135,16 +135,37 @@ }; }; -ðernet { +&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 { diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts index 8e0a1d891211..af83d0f1b3db 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts @@ -158,6 +158,35 @@ }; }; +&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"; diff --git a/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts b/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts index ca060e7c0a49..1d0c8b3dcce7 100644 --- a/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts +++ b/target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts @@ -178,10 +178,39 @@ }; }; -ðernet { +&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"; }; diff --git a/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts b/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts index 85b8c5c2e0a3..c5548a673e70 100644 --- a/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts +++ b/target/linux/ramips/dts/mt7621_d-team_newifi-d2.dts @@ -14,7 +14,7 @@ led-failsafe = &led_power_blue; led-running = &led_power_blue; led-upgrade = &led_power_blue; - label-mac-device = ðernet; + label-mac-device = &gmac0; }; chosen { @@ -149,10 +149,40 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts b/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts index 73e6e32f423d..528f86f94393 100644 --- a/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts +++ b/target/linux/ramips/dts/mt7621_d-team_pbr-m1.dts @@ -164,10 +164,40 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts index f83c9a4afb3f..28005b3f35c4 100644 --- a/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts +++ b/target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts @@ -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 { @@ -114,6 +114,39 @@ }; }; +&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"; }; diff --git a/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi b/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi index 3cef0026b4d0..b52ead09d3c1 100644 --- a/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi +++ b/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi @@ -8,7 +8,7 @@ / { aliases { - label-mac-device = ðernet; + label-mac-device = &gmac0; }; chosen { @@ -94,12 +94,36 @@ }; }; -ðernet { +&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"; + }; }; }; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts index c61ef885f2a9..5a8ee2884c02 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts @@ -72,10 +72,40 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gst.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gst.dtsi index e120ee3ca465..85bbcd0b6a76 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-gst.dtsi +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-gst.dtsi @@ -86,10 +86,40 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_firefly_firewrt.dts b/target/linux/ramips/dts/mt7621_firefly_firewrt.dts index 57318f369483..10b33993ac8d 100644 --- a/target/linux/ramips/dts/mt7621_firefly_firewrt.dts +++ b/target/linux/ramips/dts/mt7621_firefly_firewrt.dts @@ -110,10 +110,41 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts b/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts index 6e3eda529016..b501034b7fba 100644 --- a/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts +++ b/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts @@ -110,10 +110,36 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts b/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts index 8544e215280e..1cf121a7c3a4 100644 --- a/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts +++ b/target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts @@ -104,10 +104,24 @@ status = "okay"; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts b/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts index 0dae7b5ce7d9..f279ccaae0fb 100644 --- a/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts +++ b/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts @@ -114,10 +114,24 @@ status = "okay"; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts b/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts index d5fa290bcf30..9d60d509abb5 100644 --- a/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts +++ b/target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts @@ -142,6 +142,30 @@ }; }; +&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"; diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts b/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts index 57c4638f1665..1fabad5da60a 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts @@ -129,10 +129,41 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts b/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts index ca08f1dabb22..c345896bd2a5 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts @@ -129,10 +129,41 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi b/target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi index c771eb20afc8..acef4d22a093 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi +++ b/target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi @@ -11,6 +11,7 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; + label-mac-device = &wan; }; chosen { @@ -120,10 +121,40 @@ }; }; -ðernet { +&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"; }; diff --git a/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts b/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts index a208757c2885..94b0c18d45e1 100644 --- a/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts +++ b/target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts @@ -124,9 +124,37 @@ }; }; -ðernet { +&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 { diff --git a/target/linux/ramips/dts/mt7621_iptime_a6ns-m.dts b/target/linux/ramips/dts/mt7621_iptime_a6ns-m.dts index 7ff01b133a1f..be8b101b7866 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a6ns-m.dts +++ b/target/linux/ramips/dts/mt7621_iptime_a6ns-m.dts @@ -15,7 +15,7 @@ led-failsafe = &led_cpu; led-running = &led_cpu; led-upgrade = &led_cpu; - label-mac-device = ðernet; + label-mac-device = &gmac0; }; chosen { @@ -115,10 +115,40 @@ }; }; -ðernet { +&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"; }; diff --git a/target/linux/ramips/dts/mt7621_iptime_a8004t.dts b/target/linux/ramips/dts/mt7621_iptime_a8004t.dts index 179a9cda4c6e..b948236c1586 100644 --- a/target/linux/ramips/dts/mt7621_iptime_a8004t.dts +++ b/target/linux/ramips/dts/mt7621_iptime_a8004t.dts @@ -100,10 +100,40 @@ }; }; -ðernet { +&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"; }; diff --git a/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts b/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts index bdb986029131..126896c9066c 100644 --- a/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts +++ b/target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts @@ -15,6 +15,7 @@ led-failsafe = &led_wps; led-running = &led_wps; led-upgrade = &led_wps; + label-mac-device = &wan; }; chosen { @@ -132,10 +133,39 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts b/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts index 7f7dc9c3ea58..984c886ff3b7 100644 --- a/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts +++ b/target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts @@ -14,7 +14,7 @@ led-failsafe = &led_blue; led-running = &led_blue; led-upgrade = &led_blue; - label-mac-device = ðernet; + label-mac-device = &gmac0; }; chosen { @@ -133,10 +133,30 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_linksys_re6500.dts b/target/linux/ramips/dts/mt7621_linksys_re6500.dts index a97e64dbec3a..c325b33f1288 100644 --- a/target/linux/ramips/dts/mt7621_linksys_re6500.dts +++ b/target/linux/ramips/dts/mt7621_linksys_re6500.dts @@ -118,10 +118,34 @@ }; }; -ðernet { +&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"; }; diff --git a/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts b/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts index 4a225d81c4ba..731eb4d8e2c0 100644 --- a/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts +++ b/target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts @@ -118,10 +118,41 @@ status = "okay"; }; -ðernet { +&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"; }; diff --git a/target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts b/target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts index 93588b5d5380..8321caae6e13 100644 --- a/target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts +++ b/target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts @@ -45,6 +45,35 @@ 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"; diff --git a/target/linux/ramips/dts/mt7621_mikrotik_rb750gr3.dts b/target/linux/ramips/dts/mt7621_mikrotik_rb750gr3.dts index ebb35b9204dc..a065ce804de0 100644 --- a/target/linux/ramips/dts/mt7621_mikrotik_rb750gr3.dts +++ b/target/linux/ramips/dts/mt7621_mikrotik_rb750gr3.dts @@ -129,11 +129,42 @@ }; }; -ðernet { +&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 */ diff --git a/target/linux/ramips/dts/mt7621_mikrotik_rbm11g.dts b/target/linux/ramips/dts/mt7621_mikrotik_rbm11g.dts index 85ea796f97f4..bcfce33a16fe 100644 --- a/target/linux/ramips/dts/mt7621_mikrotik_rbm11g.dts +++ b/target/linux/ramips/dts/mt7621_mikrotik_rbm11g.dts @@ -138,11 +138,21 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_mikrotik_rbm33g.dts b/target/linux/ramips/dts/mt7621_mikrotik_rbm33g.dts index d65d1de05c4c..f7889bd68a9f 100644 --- a/target/linux/ramips/dts/mt7621_mikrotik_rbm33g.dts +++ b/target/linux/ramips/dts/mt7621_mikrotik_rbm33g.dts @@ -162,11 +162,32 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_mqmaker_witi.dts b/target/linux/ramips/dts/mt7621_mqmaker_witi.dts index f59cc57be3c3..6870ed94a098 100644 --- a/target/linux/ramips/dts/mt7621_mqmaker_witi.dts +++ b/target/linux/ramips/dts/mt7621_mqmaker_witi.dts @@ -101,10 +101,41 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_mtc_wr1201.dts b/target/linux/ramips/dts/mt7621_mtc_wr1201.dts index 6e1c6eabaaae..eca7b3b0bbfa 100644 --- a/target/linux/ramips/dts/mt7621_mtc_wr1201.dts +++ b/target/linux/ramips/dts/mt7621_mtc_wr1201.dts @@ -14,7 +14,7 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - label-mac-device = ðernet; + label-mac-device = &gmac0; }; chosen { @@ -104,10 +104,41 @@ }; }; -ðernet { +&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"; }; diff --git a/target/linux/ramips/dts/mt7621_netgear_ex6150.dts b/target/linux/ramips/dts/mt7621_netgear_ex6150.dts index 701f8274a4f4..1b0b9e29e958 100644 --- a/target/linux/ramips/dts/mt7621_netgear_ex6150.dts +++ b/target/linux/ramips/dts/mt7621_netgear_ex6150.dts @@ -228,8 +228,17 @@ }; }; -ðernet { - mtd-mac-address = <&factory 0x00000004>; +&gmac0 { + mtd-mac-address = <&factory 0x4>; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan"; + }; + }; }; &state_default { diff --git a/target/linux/ramips/dts/mt7621_netgear_r6700-v2.dts b/target/linux/ramips/dts/mt7621_netgear_r6700-v2.dts index 07b696c42d56..b206cf7d9560 100644 --- a/target/linux/ramips/dts/mt7621_netgear_r6700-v2.dts +++ b/target/linux/ramips/dts/mt7621_netgear_r6700-v2.dts @@ -12,7 +12,6 @@ led-failsafe = &led_power_orange; led-running = &led_power_white; led-upgrade = &led_power_orange; - label-mac-device = ðernet; }; leds { diff --git a/target/linux/ramips/dts/mt7621_netgear_r6800.dts b/target/linux/ramips/dts/mt7621_netgear_r6800.dts index a64c976a4450..cce701ea3252 100644 --- a/target/linux/ramips/dts/mt7621_netgear_r6800.dts +++ b/target/linux/ramips/dts/mt7621_netgear_r6800.dts @@ -12,7 +12,6 @@ led-failsafe = &led_power_orange; led-running = &led_power_white; led-upgrade = &led_power_orange; - label-mac-device = ðernet; }; leds { diff --git a/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi index ba0853d3cad5..0b9e7c6626db 100644 --- a/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi +++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi @@ -13,7 +13,7 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - label-mac-device = ðernet; + label-mac-device = &gmac0; }; chosen { @@ -105,10 +105,41 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi index 12621d8b7113..d2e5502e4872 100644 --- a/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi +++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi @@ -8,6 +8,10 @@ / { compatible = "mediatek,mt7621-soc"; + aliases { + label-mac-device = &gmac0; + }; + chosen { bootargs = "console=ttyS0,57600"; }; @@ -57,10 +61,41 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi index c7dcfae87032..b781edf6beae 100644 --- a/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi +++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi @@ -13,7 +13,7 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - label-mac-device = ðernet; + label-mac-device = &gmac0; }; chosen { @@ -95,10 +95,41 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_netis_wf2881.dts b/target/linux/ramips/dts/mt7621_netis_wf2881.dts index 11aa68d8f1f5..e937134ae9bb 100644 --- a/target/linux/ramips/dts/mt7621_netis_wf2881.dts +++ b/target/linux/ramips/dts/mt7621_netis_wf2881.dts @@ -14,7 +14,7 @@ led-failsafe = &led_wps; led-running = &led_wps; led-upgrade = &led_wps; - label-mac-device = ðernet; + label-mac-device = &gmac0; }; chosen { @@ -127,10 +127,40 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts index 104d10fdb333..761b690d1e3b 100644 --- a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts +++ b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts @@ -107,10 +107,40 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_planex_vr500.dts b/target/linux/ramips/dts/mt7621_planex_vr500.dts index 30257ffb5a01..7114ba9834af 100644 --- a/target/linux/ramips/dts/mt7621_planex_vr500.dts +++ b/target/linux/ramips/dts/mt7621_planex_vr500.dts @@ -80,10 +80,40 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts b/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts index cf982d1a86f7..4bd761135943 100644 --- a/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts +++ b/target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts @@ -110,10 +110,40 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts b/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts index 7a5b2a840c2c..84bd049d8aee 100644 --- a/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts +++ b/target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts @@ -107,10 +107,41 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts b/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts index fa85cf10178d..7c94db8dcb39 100644 --- a/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts +++ b/target/linux/ramips/dts/mt7621_telco-electronics_x1.dts @@ -126,9 +126,39 @@ status = "okay"; }; -ðernet { +&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 { diff --git a/target/linux/ramips/dts/mt7621_thunder_timecloud.dts b/target/linux/ramips/dts/mt7621_thunder_timecloud.dts index 195750a27d0a..60eea877b15e 100644 --- a/target/linux/ramips/dts/mt7621_thunder_timecloud.dts +++ b/target/linux/ramips/dts/mt7621_thunder_timecloud.dts @@ -95,10 +95,19 @@ }; }; -ðernet { +&gmac0 { mtd-mac-address = <&factory 0xe000>; }; +&switch0 { + ports { + port@4 { + status = "okay"; + label = "lan"; + }; + }; +}; + &state_default { gpio { groups = "i2c", "uart2", "jtag"; diff --git a/target/linux/ramips/dts/mt7621_totolink_a7000r.dts b/target/linux/ramips/dts/mt7621_totolink_a7000r.dts index db6edde74da5..fd24d40fe187 100644 --- a/target/linux/ramips/dts/mt7621_totolink_a7000r.dts +++ b/target/linux/ramips/dts/mt7621_totolink_a7000r.dts @@ -104,10 +104,41 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts b/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts index 13faedd0ea28..d04d87dd378a 100644 --- a/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_re350-v1.dts @@ -151,10 +151,19 @@ }; }; -ðernet { +&gmac0 { mtd-mac-address = <&config 0x10008>; }; +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan"; + }; + }; +}; + &state_default { gpio { groups = "rgmii2", "wdt"; diff --git a/target/linux/ramips/dts/mt7621_tplink_re650-v1.dts b/target/linux/ramips/dts/mt7621_tplink_re650-v1.dts index 265739bbda6f..a26ad98cc22b 100644 --- a/target/linux/ramips/dts/mt7621_tplink_re650-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_re650-v1.dts @@ -15,7 +15,7 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; - label-mac-device = ðernet; + label-mac-device = &gmac0; }; chosen { @@ -164,10 +164,20 @@ }; }; -ðernet { +&gmac0 { mtd-mac-address = <&config 0x10008>; }; +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan"; + }; + }; +}; + + &state_default { gpio { groups = "rgmii2", "wdt"; diff --git a/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx.dtsi b/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx.dtsi index 1efc930d497e..6fed4a0b7bfa 100644 --- a/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx.dtsi +++ b/target/linux/ramips/dts/mt7621_ubiquiti_edgerouterx.dtsi @@ -5,7 +5,7 @@ / { aliases { - label-mac-device = ðernet; + label-mac-device = &gmac0; }; chosen { @@ -23,10 +23,41 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts b/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts index 9b3a5be4449c..6292762ea7a8 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_unifi-nanohd.dts @@ -15,8 +15,7 @@ led-failsafe = &led_white; led-running = &led_blue; led-upgrade = &led_blue; - - label-mac-device = ðernet; + label-mac-device = &gmac0; }; chosen { @@ -129,10 +128,19 @@ }; }; -ðernet { +&gmac0 { mtd-mac-address = <&eeprom 0x0>; }; +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan"; + }; + }; +}; + &state_default { gpio { groups = "i2c", "uart2"; diff --git a/target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi b/target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi index c4116e85416d..ca0e2d7dcd08 100644 --- a/target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi +++ b/target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi @@ -104,9 +104,39 @@ status = "okay"; }; -ðernet { +&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 { diff --git a/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi b/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi index d519961424a0..95923632602b 100644 --- a/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi +++ b/target/linux/ramips/dts/mt7621_wevo_w2914ns-v2.dtsi @@ -4,6 +4,10 @@ #include / { + aliases { + label-mac-device = &wan; + }; + chosen { bootargs = "console=ttyS0,57600"; }; @@ -97,10 +101,39 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mir3g-v2.dts b/target/linux/ramips/dts/mt7621_xiaomi_mir3g-v2.dts index a8125d355edc..41e11216d2f2 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mir3g-v2.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mir3g-v2.dts @@ -15,6 +15,7 @@ led-failsafe = &led_status_yellow; led-running = &led_status_blue; led-upgrade = &led_status_yellow; + label-mac-device = &wan; }; chosen { @@ -132,9 +133,27 @@ }; }; -ðernet { +&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 { diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mir3g.dts b/target/linux/ramips/dts/mt7621_xiaomi_mir3g.dts index a4ffb150b32c..60786e421e44 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mir3g.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mir3g.dts @@ -14,6 +14,7 @@ led-failsafe = &led_status_red; led-running = &led_status_blue; led-upgrade = &led_status_yellow; + label-mac-device = &gmac0; }; chosen { @@ -41,16 +42,19 @@ 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"; }; }; @@ -186,9 +190,28 @@ }; }; -ðernet { - 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 { diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mir3p.dts b/target/linux/ramips/dts/mt7621_xiaomi_mir3p.dts index 45d7411bd01f..8a85c8b48d54 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mir3p.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mir3p.dts @@ -15,6 +15,7 @@ led-failsafe = &led_status_red; led-running = &led_status_blue; led-upgrade = &led_status_yellow; + label-mac-device = &gmac0; }; chosen { @@ -42,21 +43,25 @@ 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"; }; }; @@ -171,9 +176,33 @@ }; }; -ðernet { - 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 { diff --git a/target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts b/target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts index 618c0ab56594..d99cc7d2578e 100644 --- a/target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts +++ b/target/linux/ramips/dts/mt7621_xiaoyu_xy-c5.dts @@ -14,7 +14,7 @@ led-failsafe = &led_sys; led-running = &led_sys; led-upgrade = &led_sys; - label-mac-device = ðernet; + label-mac-device = &gmac0; }; chosen { @@ -90,10 +90,41 @@ status = "okay"; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts b/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts index ad8f7fdc9147..36ef348ec5c2 100644 --- a/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts +++ b/target/linux/ramips/dts/mt7621_xzwifi_creativebox-v1.dts @@ -152,10 +152,41 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts b/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts index aa749ec6b827..c70350fd41db 100644 --- a/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts +++ b/target/linux/ramips/dts/mt7621_youhua_wr1200js.dts @@ -126,10 +126,40 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_youku_yk-l2.dts b/target/linux/ramips/dts/mt7621_youku_yk-l2.dts index 49fa312f584b..e43ee8451ac1 100644 --- a/target/linux/ramips/dts/mt7621_youku_yk-l2.dts +++ b/target/linux/ramips/dts/mt7621_youku_yk-l2.dts @@ -137,10 +137,40 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts index 6d765a2a6157..f91f0d77d40b 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts @@ -75,10 +75,40 @@ }; }; -ðernet { +&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"; }; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts index 8088d5e8b41a..1f43f2a2dcc7 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we3526.dts @@ -99,10 +99,40 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts index fba959c8df37..6461302154f9 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg2626.dts @@ -110,10 +110,41 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi index 69779976339e..9728119adf1e 100644 --- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi +++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-wg3526.dtsi @@ -112,10 +112,41 @@ }; }; -ðernet { +&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"; diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 7695cb991893..66739a75368e 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -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 diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index a68ffe612628..f27ffcccbf2f 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -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 -- 2.30.2