Browse Source

ramips: mt7621-dts: mux phy0/4 to gmac1

Mux the MT7530 switch's phy0/4 to the SoC's gmac1 on devices where RGMII2
pins are available. This achieves 2 Gbps total bandwidth to the CPU using
the second RGMII.

The ports called "wan" are muxed where possible. On a minority of devices,
this is not possible. Those cases:

mt7621_ampedwireless_ally-r1900k.dts: lan3
mt7621_ubnt_edgerouter-x.dts: eth0
mt7621_gnubee_gb-pc1.dts: ethblue
mt7621_linksys_re6500.dts: lan1
mt7621_netgear_wac104.dts: lan4
mt7621_tplink_eap235-wall-v1.dts: lan0
mt7621_tplink_eap615-wall-v1.dts: lan0
mt7621_ubnt_usw-flex.dts: lan1

The "wan" port is just what the vendor designated on the board/plastic
chasis of the device. On a technical level, there is no difference between
a lan and wan port on MT7621AT, MT7621DAT and MT7621ST SoCs. Prefer
connecting to WAN via the port described above for these devices to benefit
the feature brought with this patch.

mt7621_d-team_newifi-d2.dts cannot benefit this feature, although it looks
like it should, because the rgmii2 pins are wired to unused components.

Tested on a range of devices documented on the GitHub PR.

Link: https://github.com/openwrt/openwrt/pull/10238
Signed-off-by: Arınç ÜNAL <[email protected]>
Arınç ÜNAL 3 years ago
parent
commit
f1c9afd801
100 changed files with 1231 additions and 541 deletions
  1. 16 8
      target/linux/ramips/dts/mt7621_adslr_g7.dts
  2. 16 8
      target/linux/ramips/dts/mt7621_afoundry_ew1200.dts
  3. 12 5
      target/linux/ramips/dts/mt7621_ampedwireless_ally-r1900k.dts
  4. 15 5
      target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi
  5. 16 8
      target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts
  6. 16 8
      target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts
  7. 15 7
      target/linux/ramips/dts/mt7621_asus_rt-ac57u.dts
  8. 15 5
      target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi
  9. 15 5
      target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts
  10. 16 8
      target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts
  11. 16 9
      target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts
  12. 16 9
      target/linux/ramips/dts/mt7621_beeline_smartbox-turbo.dts
  13. 12 5
      target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts
  14. 16 5
      target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts
  15. 15 5
      target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts
  16. 16 8
      target/linux/ramips/dts/mt7621_cudy_wr1300.dts
  17. 16 9
      target/linux/ramips/dts/mt7621_cudy_wr2100.dts
  18. 16 8
      target/linux/ramips/dts/mt7621_cudy_x6.dts
  19. 15 7
      target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts
  20. 17 9
      target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts
  21. 15 5
      target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts
  22. 1 1
      target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts
  23. 1 1
      target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts
  24. 1 1
      target/linux/ramips/dts/mt7621_dlink_dir-878-r1.dts
  25. 1 1
      target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts
  26. 1 1
      target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts
  27. 12 5
      target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi
  28. 15 7
      target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi
  29. 15 5
      target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi
  30. 15 7
      target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts
  31. 1 1
      target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts
  32. 1 1
      target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts
  33. 1 1
      target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts
  34. 1 1
      target/linux/ramips/dts/mt7621_elecom_wrc-1750gst2.dts
  35. 1 1
      target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts
  36. 1 1
      target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts
  37. 12 5
      target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk-i.dts
  38. 1 1
      target/linux/ramips/dts/mt7621_elecom_wrc-2533gs2.dts
  39. 1 1
      target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts
  40. 1 1
      target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts
  41. 13 6
      target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi
  42. 16 8
      target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts
  43. 16 8
      target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts
  44. 15 5
      target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts
  45. 12 5
      target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts
  46. 12 5
      target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts
  47. 16 8
      target/linux/ramips/dts/mt7621_humax_e10.dts
  48. 16 8
      target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts
  49. 16 8
      target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts
  50. 16 8
      target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts
  51. 16 8
      target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi
  52. 15 5
      target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts
  53. 15 7
      target/linux/ramips/dts/mt7621_iptime_a3002mesh.dts
  54. 15 7
      target/linux/ramips/dts/mt7621_iptime_a3004ns-dual.dts
  55. 16 8
      target/linux/ramips/dts/mt7621_iptime_a3004t.dts
  56. 15 7
      target/linux/ramips/dts/mt7621_iptime_a6004ns-m.dtsi
  57. 15 7
      target/linux/ramips/dts/mt7621_iptime_a8004t.dts
  58. 16 8
      target/linux/ramips/dts/mt7621_iptime_ax2004m.dts
  59. 12 5
      target/linux/ramips/dts/mt7621_iptime_t5004.dts
  60. 16 7
      target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts
  61. 15 7
      target/linux/ramips/dts/mt7621_jcg_q20.dts
  62. 15 7
      target/linux/ramips/dts/mt7621_jcg_y2.dts
  63. 15 7
      target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts
  64. 12 5
      target/linux/ramips/dts/mt7621_linksys_e5600.dts
  65. 15 2
      target/linux/ramips/dts/mt7621_linksys_ea6350-v4.dts
  66. 12 5
      target/linux/ramips/dts/mt7621_linksys_ea7xxx.dtsi
  67. 15 5
      target/linux/ramips/dts/mt7621_linksys_re6500.dts
  68. 16 8
      target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts
  69. 12 5
      target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts
  70. 20 0
      target/linux/ramips/dts/mt7621_mikrotik_routerboard-750gr3.dts
  71. 12 5
      target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts
  72. 16 8
      target/linux/ramips/dts/mt7621_mqmaker_witi.dts
  73. 1 1
      target/linux/ramips/dts/mt7621_netgear_r6220.dts
  74. 12 5
      target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi
  75. 16 8
      target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi
  76. 16 8
      target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi
  77. 15 5
      target/linux/ramips/dts/mt7621_netgear_wac104.dts
  78. 12 5
      target/linux/ramips/dts/mt7621_netgear_wax202.dts
  79. 1 1
      target/linux/ramips/dts/mt7621_netgear_wndr3700-v5.dts
  80. 15 7
      target/linux/ramips/dts/mt7621_netis_wf2881.dts
  81. 16 8
      target/linux/ramips/dts/mt7621_oraybox_x3a.dts
  82. 15 7
      target/linux/ramips/dts/mt7621_phicomm_k2p.dts
  83. 15 7
      target/linux/ramips/dts/mt7621_planex_vr500.dts
  84. 12 5
      target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts
  85. 16 8
      target/linux/ramips/dts/mt7621_renkforce_ws-wn530hp3-a.dts
  86. 15 7
      target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts
  87. 16 8
      target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts
  88. 17 9
      target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts
  89. 16 8
      target/linux/ramips/dts/mt7621_totolink_a7000r.dts
  90. 15 7
      target/linux/ramips/dts/mt7621_totolink_x5000r.dts
  91. 16 8
      target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts
  92. 15 5
      target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts
  93. 15 5
      target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts
  94. 23 0
      target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dts
  95. 15 5
      target/linux/ramips/dts/mt7621_ubnt_usw-flex.dts
  96. 1 1
      target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts
  97. 12 5
      target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi
  98. 1 1
      target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts
  99. 1 1
      target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts
  100. 12 5
      target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi

+ 16 - 8
target/linux/ramips/dts/mt7621_adslr_g7.dts

@@ -105,6 +105,22 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_e00c>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -126,14 +142,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e00c>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <1>;
-		};
 	};
 };
 

+ 16 - 8
target/linux/ramips/dts/mt7621_afoundry_ew1200.dts

@@ -110,6 +110,22 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -131,14 +147,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e000>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <1>;
-		};
 	};
 };
 

+ 12 - 5
target/linux/ramips/dts/mt7621_ampedwireless_ally-r1900k.dts

@@ -7,6 +7,18 @@
 	model = "Amped Wireless ALLY-R1900K";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "lan3";
+	phy-handle = <&ethphy4>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@1 {
@@ -23,10 +35,5 @@
 			status = "okay";
 			label = "lan2";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "lan3";
-		};
 	};
 };

+ 15 - 5
target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi

@@ -171,6 +171,21 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_fff0>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@2 {
@@ -182,11 +197,6 @@
 			status = "okay";
 			label = "lan1";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-		};
 	};
 };
 

+ 16 - 8
target/linux/ramips/dts/mt7621_asiarf_ap7621-001.dts

@@ -7,19 +7,27 @@
 	model = "AsiaRF AP7621-001";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
 			status = "okay";
 			label = "lan";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e000>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <1>;
-		};
 	};
 };

+ 16 - 8
target/linux/ramips/dts/mt7621_asiarf_ap7621-nv1.dts

@@ -7,16 +7,24 @@
 	model = "AsiaRF AP7621-NV1";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e000>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <1>;
-		};
-
 		port@2 {
 			status = "okay";
 			label = "lan1";

+ 15 - 7
target/linux/ramips/dts/mt7621_asus_rt-ac57u.dts

@@ -134,15 +134,23 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_e006>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e006>;
-			nvmem-cell-names = "mac-address";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan1";

+ 15 - 5
target/linux/ramips/dts/mt7621_asus_rt-acx5p.dtsi

@@ -135,13 +135,23 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan1";

+ 15 - 5
target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts

@@ -126,13 +126,23 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan1";

+ 16 - 8
target/linux/ramips/dts/mt7621_asus_rt-n56u-b1.dts

@@ -10,7 +10,7 @@
 	model = "ASUS RT-N56U B1";
 
 	aliases {
-		label-mac-device = &wan;
+		label-mac-device = &gmac1;
 		led-boot = &led_power;
 		led-failsafe = &led_power;
 		led-running = &led_power;
@@ -144,6 +144,21 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -165,13 +180,6 @@
 			status = "okay";
 			label = "lan1";
 		};
-
-		wan: port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_4>;
-			nvmem-cell-names = "mac-address";
-		};
 	};
 };
 

+ 16 - 9
target/linux/ramips/dts/mt7621_beeline_smartbox-giga.dts

@@ -202,17 +202,24 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&switch0 {
-	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
 
-			nvmem-cells = <&macaddr_factory_21000>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <(1)>;
-		};
+	nvmem-cells = <&macaddr_factory_21000>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <(1)>;
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
 
+&switch0 {
+	ports {
 		port@1 {
 			status = "okay";
 			label = "lan1";

+ 16 - 9
target/linux/ramips/dts/mt7621_beeline_smartbox-turbo.dts

@@ -202,17 +202,24 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&switch0 {
-	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
 
-			nvmem-cells = <&macaddr_factory_21000>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <(1)>;
-		};
+	nvmem-cells = <&macaddr_factory_21000>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <(1)>;
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
 
+&switch0 {
+	ports {
 		port@1 {
 			status = "okay";
 			label = "lan1";

+ 12 - 5
target/linux/ramips/dts/mt7621_buffalo_wsr-1166dhp.dts

@@ -152,6 +152,18 @@
 	};
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -173,11 +185,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-		};
 	};
 };
 

+ 16 - 5
target/linux/ramips/dts/mt7621_buffalo_wsr-2533dhpl.dts

@@ -169,13 +169,24 @@
 	mac-address-increment = <(-1)>;
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <(-1)>;
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan4";

+ 15 - 5
target/linux/ramips/dts/mt7621_buffalo_wsr-600dhp.dts

@@ -177,6 +177,21 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -198,11 +213,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-		};
 	};
 };
 

+ 16 - 8
target/linux/ramips/dts/mt7621_cudy_wr1300.dts

@@ -159,6 +159,22 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_bdinfo_de00>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -180,14 +196,6 @@
 			status = "okay";
 			label = "lan1";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_bdinfo_de00>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <1>;
-		};
 	};
 };
 

+ 16 - 9
target/linux/ramips/dts/mt7621_cudy_wr2100.dts

@@ -169,6 +169,22 @@
 	};
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_bdinfo_de00>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -190,15 +206,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-
-			nvmem-cells = <&macaddr_bdinfo_de00>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <1>;
-		};
 	};
 };
 

+ 16 - 8
target/linux/ramips/dts/mt7621_cudy_x6.dts

@@ -128,6 +128,22 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_bdinfo_de00>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -149,14 +165,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_bdinfo_de00>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <1>;
-		};
 	};
 };
 

+ 15 - 7
target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts

@@ -169,6 +169,21 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_e006>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -190,13 +205,6 @@
 			status = "okay";
 			label = "lan1";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e006>;
-			nvmem-cell-names = "mac-address";
-		};
 	};
 };
 

+ 17 - 9
target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts

@@ -12,7 +12,7 @@
 	model = "D-Link DIR-853 R1";
 
 	aliases {
-		label-mac-device = &wan;
+		label-mac-device = &gmac1;
 
 		led-boot = &led_power_orange;
 		led-failsafe = &led_power_blue;
@@ -110,6 +110,22 @@
 	mac-address-increment = <(-1)>;
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <(-2)>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -131,14 +147,6 @@
 			status = "okay";
 			label = "lan1";
 		};
-
-		wan: port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_4>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <(-2)>;
-		};
 	};
 };
 

+ 15 - 5
target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts

@@ -114,13 +114,23 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_radio_4>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan4";

+ 1 - 1
target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts

@@ -17,7 +17,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_e006>;
 	nvmem-cell-names = "mac-address";
 };

+ 1 - 1
target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts

@@ -17,7 +17,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_e006>;
 	nvmem-cell-names = "mac-address";
 };

+ 1 - 1
target/linux/ramips/dts/mt7621_dlink_dir-878-r1.dts

@@ -17,7 +17,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_e006>;
 	nvmem-cell-names = "mac-address";
 };

+ 1 - 1
target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts

@@ -33,7 +33,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_e006>;
 	nvmem-cell-names = "mac-address";
 };

+ 1 - 1
target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts

@@ -33,7 +33,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_e006>;
 	nvmem-cell-names = "mac-address";
 };

+ 12 - 5
target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi

@@ -90,6 +90,18 @@
 	};
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -111,11 +123,6 @@
 			status = "okay";
 			label = "lan1";
 		};
-
-		wan: port@4 {
-			status = "okay";
-			label = "wan";
-		};
 	};
 };
 

+ 15 - 7
target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi

@@ -154,6 +154,21 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_e006>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -175,13 +190,6 @@
 			status = "okay";
 			label = "lan1";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e006>;
-			nvmem-cell-names = "mac-address";
-		};
 	};
 };
 

+ 15 - 5
target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi

@@ -122,13 +122,23 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan4";

+ 15 - 7
target/linux/ramips/dts/mt7621_elecom_wrc-1167ghbk2-s.dts

@@ -71,15 +71,23 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_e006>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e006>;
-			nvmem-cell-names = "mac-address";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan4";

+ 1 - 1
target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts

@@ -12,7 +12,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_fffa>;
 	nvmem-cell-names = "mac-address";
 };

+ 1 - 1
target/linux/ramips/dts/mt7621_elecom_wrc-1167gst2.dts

@@ -12,7 +12,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_e006>;
 	nvmem-cell-names = "mac-address";
 };

+ 1 - 1
target/linux/ramips/dts/mt7621_elecom_wrc-1750gs.dts

@@ -44,7 +44,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_e006>;
 	nvmem-cell-names = "mac-address";
 };

+ 1 - 1
target/linux/ramips/dts/mt7621_elecom_wrc-1750gst2.dts

@@ -44,7 +44,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_e006>;
 	nvmem-cell-names = "mac-address";
 };

+ 1 - 1
target/linux/ramips/dts/mt7621_elecom_wrc-1750gsv.dts

@@ -44,7 +44,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_e006>;
 	nvmem-cell-names = "mac-address";
 };

+ 1 - 1
target/linux/ramips/dts/mt7621_elecom_wrc-1900gst.dts

@@ -44,7 +44,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_e006>;
 	nvmem-cell-names = "mac-address";
 };

+ 12 - 5
target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk-i.dts

@@ -136,13 +136,20 @@
 	};
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan4";

+ 1 - 1
target/linux/ramips/dts/mt7621_elecom_wrc-2533gs2.dts

@@ -44,7 +44,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_fffa>;
 	nvmem-cell-names = "mac-address";
 };

+ 1 - 1
target/linux/ramips/dts/mt7621_elecom_wrc-2533gst.dts

@@ -42,7 +42,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_e006>;
 	nvmem-cell-names = "mac-address";
 };

+ 1 - 1
target/linux/ramips/dts/mt7621_elecom_wrc-2533gst2.dts

@@ -44,7 +44,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_e006>;
 	nvmem-cell-names = "mac-address";
 };

+ 13 - 6
target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi

@@ -11,7 +11,7 @@
 		led-failsafe = &led_power_green;
 		led-running = &led_power_green;
 		led-upgrade = &led_power_green;
-		label-mac-device = &wan;
+		label-mac-device = &gmac1;
 	};
 
 	leds: leds {
@@ -83,13 +83,20 @@
 	};
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		wan: port@0 {
-			status = "okay";
-			label = "wan";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan4";

+ 16 - 8
target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts

@@ -111,6 +111,22 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -127,14 +143,6 @@
 			status = "okay";
 			label = "lan3";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e000>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <1>;
-		};
 	};
 };
 

+ 16 - 8
target/linux/ramips/dts/mt7621_glinet_gl-mt1300.dts

@@ -14,7 +14,7 @@
 		led-failsafe = &led_run;
 		led-running = &led_run;
 		led-upgrade = &led_run;
-		label-mac-device = &wan;
+		label-mac-device = &gmac1;
 	};
 
 	chosen {
@@ -121,6 +121,21 @@
 	mac-address-increment = <1>;
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_4000>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@2 {
@@ -132,13 +147,6 @@
 			status = "okay";
 			label = "lan2";
 		};
-
-		wan: port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_4000>;
-			nvmem-cell-names = "mac-address";
-		};
 	};
 };
 

+ 15 - 5
target/linux/ramips/dts/mt7621_gnubee_gb-pc1.dts

@@ -105,17 +105,27 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "ethblue";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
 			status = "okay";
 			label = "ethblack";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "ethblue";
-		};
 	};
 };
 

+ 12 - 5
target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts

@@ -61,6 +61,18 @@
 	};
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -82,11 +94,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-		};
 	};
 };
 

+ 12 - 5
target/linux/ramips/dts/mt7621_hiwifi_hc5962.dts

@@ -129,6 +129,18 @@
 	};
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@1 {
@@ -145,11 +157,6 @@
 			status = "okay";
 			label = "lan3";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-		};
 	};
 };
 

+ 16 - 8
target/linux/ramips/dts/mt7621_humax_e10.dts

@@ -15,7 +15,7 @@
 		led-failsafe = &led_power;
 		led-running = &led_power;
 		led-upgrade = &led_power;
-		label-mac-device = &wan;
+		label-mac-device = &gmac1;
 	};
 
 	gpio-export {
@@ -132,15 +132,23 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_1000d>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		wan: port@0 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_1000d>;
-			nvmem-cell-names = "mac-address";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan";

+ 16 - 8
target/linux/ramips/dts/mt7621_iodata_wn-ax1167gr.dts

@@ -132,16 +132,24 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_4>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <1>;
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan4";

+ 16 - 8
target/linux/ramips/dts/mt7621_iodata_wn-dx1200gr.dts

@@ -14,7 +14,7 @@
 		led-failsafe = &led_power;
 		led-running = &led_power;
 		led-upgrade = &led_power;
-		label-mac-device = &wan;
+		label-mac-device = &gmac1;
 	};
 
 	leds {
@@ -131,15 +131,23 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_1e006>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		wan: port@0 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_1e006>;
-			nvmem-cell-names = "mac-address";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan4";

+ 16 - 8
target/linux/ramips/dts/mt7621_iodata_wn-gx300gr.dts

@@ -132,16 +132,24 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_4>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <1>;
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan4";

+ 16 - 8
target/linux/ramips/dts/mt7621_iodata_wn-xx-xr.dtsi

@@ -11,7 +11,7 @@
 		led-failsafe = &led_power;
 		led-running = &led_power;
 		led-upgrade = &led_power;
-		label-mac-device = &wan;
+		label-mac-device = &gmac1;
 	};
 
 	leds {
@@ -122,15 +122,23 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_e006>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		wan: port@0 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e006>;
-			nvmem-cell-names = "mac-address";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan4";

+ 15 - 5
target/linux/ramips/dts/mt7621_iodata_wnpr2600g.dts

@@ -124,13 +124,23 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan4";

+ 15 - 7
target/linux/ramips/dts/mt7621_iptime_a3002mesh.dts

@@ -109,15 +109,23 @@
 	mac-address-increment = <(2)>;
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_uboot_1fc40>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_uboot_1fc40>;
-			nvmem-cell-names = "mac-address";
-		};
-
 		port@3 {
 			status = "okay";
 			label = "lan1";

+ 15 - 7
target/linux/ramips/dts/mt7621_iptime_a3004ns-dual.dts

@@ -94,15 +94,23 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_uboot_1fc40>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_uboot_1fc40>;
-			nvmem-cell-names = "mac-address";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan1";

+ 16 - 8
target/linux/ramips/dts/mt7621_iptime_a3004t.dts

@@ -120,16 +120,24 @@
 	mac-address-increment = <(3)>;
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <(1)>;
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_4>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <(1)>;
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan4";

+ 15 - 7
target/linux/ramips/dts/mt7621_iptime_a6004ns-m.dtsi

@@ -112,15 +112,23 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_uboot_1fc40>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_uboot_1fc40>;
-			nvmem-cell-names = "mac-address";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan1";

+ 15 - 7
target/linux/ramips/dts/mt7621_iptime_a8004t.dts

@@ -99,15 +99,23 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_uboot_1fc40>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_uboot_1fc40>;
-			nvmem-cell-names = "mac-address";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan4";

+ 16 - 8
target/linux/ramips/dts/mt7621_iptime_ax2004m.dts

@@ -120,16 +120,24 @@
 	mac-address-increment = <3>;
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_4>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <1>;
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan4";

+ 12 - 5
target/linux/ramips/dts/mt7621_iptime_t5004.dts

@@ -87,13 +87,20 @@
 	};
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan4";

+ 16 - 7
target/linux/ramips/dts/mt7621_jcg_jhr-ac876m.dts

@@ -14,7 +14,7 @@
 		led-failsafe = &led_wps;
 		led-running = &led_wps;
 		led-upgrade = &led_wps;
-		label-mac-device = &wan;
+		label-mac-device = &gmac1;
 	};
 
 	leds {
@@ -133,6 +133,21 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -154,12 +169,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-		wan: port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_4>;
-			nvmem-cell-names = "mac-address";
-		};
 	};
 };
 

+ 15 - 7
target/linux/ramips/dts/mt7621_jcg_q20.dts

@@ -148,15 +148,23 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_3fffa>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_3fffa>;
-			nvmem-cell-names = "mac-address";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan1";

+ 15 - 7
target/linux/ramips/dts/mt7621_jcg_y2.dts

@@ -93,6 +93,21 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_e006>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -114,13 +129,6 @@
 			status = "okay";
 			label = "lan1";
 		};
-
-		wan: port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e006>;
-			nvmem-cell-names = "mac-address";
-		};
 	};
 };
 

+ 15 - 7
target/linux/ramips/dts/mt7621_lenovo_newifi-d1.dts

@@ -142,6 +142,21 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_e006>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@1 {
@@ -153,13 +168,6 @@
 			status = "okay";
 			label = "lan1";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e006>;
-			nvmem-cell-names = "mac-address";
-		};
 	};
 };
 

+ 12 - 5
target/linux/ramips/dts/mt7621_linksys_e5600.dts

@@ -148,6 +148,18 @@
 	};
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -169,11 +181,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-		};
 	};
 };
 

+ 15 - 2
target/linux/ramips/dts/mt7621_linksys_ea6350-v4.dts

@@ -7,6 +7,20 @@
 	model = "Linksys EA6350 v4";
 };
 
+&gmac1 {
+        phy-handle = <&ethphy4>;
+};
+
+&mdio {
+	ethernet-phy@0 {
+		status = "disabled";
+	};
+
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -30,8 +44,7 @@
 		};
 
 		port@4 {
-			status = "okay";
-			label = "wan";
+			status = "disabled";
 		};
 	};
 };

+ 12 - 5
target/linux/ramips/dts/mt7621_linksys_ea7xxx.dtsi

@@ -177,13 +177,20 @@
 	};
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan1";

+ 15 - 5
target/linux/ramips/dts/mt7621_linksys_re6500.dts

@@ -117,13 +117,23 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "lan1";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_2e>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "lan1";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan2";

+ 16 - 8
target/linux/ramips/dts/mt7621_mediatek_ap-mt7621a-v60.dts

@@ -117,6 +117,22 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_5>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -138,14 +154,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_5>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <1>;
-		};
 	};
 };
 

+ 12 - 5
target/linux/ramips/dts/mt7621_mediatek_mt7621-eval-board.dts

@@ -39,6 +39,18 @@
 	status = "okay";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -60,11 +72,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-		};
 	};
 };
 

+ 20 - 0
target/linux/ramips/dts/mt7621_mikrotik_routerboard-750gr3.dts

@@ -35,3 +35,23 @@
 		function = "gpio";
 	};
 };
+
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
+&switch0 {
+	ports {
+		port@0 {
+			status = "disabled";
+		};
+	};
+};

+ 12 - 5
target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts

@@ -90,13 +90,20 @@
 	};
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan1";

+ 16 - 8
target/linux/ramips/dts/mt7621_mqmaker_witi.dts

@@ -100,6 +100,22 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -121,14 +137,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e000>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <1>;
-		};
 	};
 };
 

+ 1 - 1
target/linux/ramips/dts/mt7621_netgear_r6220.dts

@@ -60,7 +60,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_4>;
 	nvmem-cell-names = "mac-address";
 	mac-address-increment = <1>;

+ 12 - 5
target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi

@@ -105,6 +105,18 @@
 	};
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -126,11 +138,6 @@
 			status = "okay";
 			label = "lan1";
 		};
-
-		wan: port@4 {
-			status = "okay";
-			label = "wan";
-		};
 	};
 };
 

+ 16 - 8
target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi

@@ -166,6 +166,22 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <2>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -187,14 +203,6 @@
 			status = "okay";
 			label = "lan1";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_4>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <2>;
-		};
 	};
 };
 

+ 16 - 8
target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi

@@ -100,6 +100,22 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <2>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -121,14 +137,6 @@
 			status = "okay";
 			label = "lan1";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_4>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <2>;
-		};
 	};
 };
 

+ 15 - 5
target/linux/ramips/dts/mt7621_netgear_wac104.dts

@@ -138,13 +138,23 @@
 	};
 };
 
+&gmac1 {
+	status = "okay";
+	label = "lan4";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "lan4";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan3";

+ 12 - 5
target/linux/ramips/dts/mt7621_netgear_wax202.dts

@@ -243,16 +243,23 @@
 	};
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	gpio-controller;
 	#gpio-cells = <2>;
 
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan1";

+ 1 - 1
target/linux/ramips/dts/mt7621_netgear_wndr3700-v5.dts

@@ -56,7 +56,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_4>;
 	nvmem-cell-names = "mac-address";
 	mac-address-increment = <1>;

+ 15 - 7
target/linux/ramips/dts/mt7621_netis_wf2881.dts

@@ -126,6 +126,21 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_e006>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -147,13 +162,6 @@
 			status = "okay";
 			label = "lan1";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e006>;
-			nvmem-cell-names = "mac-address";
-		};
 	};
 };
 

+ 16 - 8
target/linux/ramips/dts/mt7621_oraybox_x3a.dts

@@ -128,6 +128,22 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_bdinfo_9>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {		
 		port@2 {
@@ -139,14 +155,6 @@
 			status = "okay";
 			label = "lan1";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_bdinfo_9>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <1>;
-		};
 	};
 };
 

+ 15 - 7
target/linux/ramips/dts/mt7621_phicomm_k2p.dts

@@ -112,6 +112,21 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_e006>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -133,13 +148,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e006>;
-			nvmem-cell-names = "mac-address";
-		};
 	};
 };
 

+ 15 - 7
target/linux/ramips/dts/mt7621_planex_vr500.dts

@@ -79,6 +79,21 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_e006>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -100,13 +115,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e006>;
-			nvmem-cell-names = "mac-address";
-		};
 	};
 };
 

+ 12 - 5
target/linux/ramips/dts/mt7621_raisecom_msg1500-x-00.dts

@@ -115,6 +115,18 @@
 	};
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -136,11 +148,6 @@
 			status = "okay";
 			label = "lan1";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-		};
 	};
 };
 

+ 16 - 8
target/linux/ramips/dts/mt7621_renkforce_ws-wn530hp3-a.dts

@@ -115,6 +115,22 @@
 	mac-address-increment = <(-2)>;
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <(-1)>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -126,14 +142,6 @@
 			status = "okay";
 			label = "lan1";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_4>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <(-1)>;
-		};
 	};
 };
 

+ 15 - 7
target/linux/ramips/dts/mt7621_samknows_whitebox-v8.dts

@@ -110,6 +110,21 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_e006>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -131,13 +146,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e006>;
-			nvmem-cell-names = "mac-address";
-		};
 	};
 };
 

+ 16 - 8
target/linux/ramips/dts/mt7621_storylink_sap-g3200u3.dts

@@ -106,6 +106,22 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_e006>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -127,14 +143,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e006>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <1>;
-		};
 	};
 };
 

+ 17 - 9
target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts

@@ -14,7 +14,7 @@
 		led-failsafe = &led_red;
 		led-running = &led_blue;
 		led-upgrade = &led_red;
-		label-mac-device = &wan_port;
+		label-mac-device = &gmac1;
 	};
 
 	chosen {
@@ -115,16 +115,24 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <(-2)>;
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		wan_port: port@0 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_4>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <(-2)>;
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan1";

+ 16 - 8
target/linux/ramips/dts/mt7621_totolink_a7000r.dts

@@ -104,6 +104,22 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -125,14 +141,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e000>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <1>;
-		};
 	};
 };
 

+ 15 - 7
target/linux/ramips/dts/mt7621_totolink_x5000r.dts

@@ -101,6 +101,21 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_e006>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -122,13 +137,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_factory_e006>;
-			nvmem-cell-names = "mac-address";
-		};
 	};
 };
 

+ 16 - 8
target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts

@@ -168,16 +168,24 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_config_8>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "wan";
-			nvmem-cells = <&macaddr_config_8>;
-			nvmem-cell-names = "mac-address";
-			mac-address-increment = <1>;
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan1";

+ 15 - 5
target/linux/ramips/dts/mt7621_tplink_eap235-wall-v1.dts

@@ -158,13 +158,23 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "lan0";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_info_8>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		port@0 {
-			status = "okay";
-			label = "lan0";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan3";

+ 15 - 5
target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts

@@ -156,14 +156,24 @@
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "lan0";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_info_8>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	compatible = "mediatek,mt7530";
 	ports {
-		port@0 {
-			status = "okay";
-			label = "lan0";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan3";

+ 23 - 0
target/linux/ramips/dts/mt7621_ubnt_edgerouter-x.dts

@@ -4,3 +4,26 @@
 	model = "Ubiquiti EdgeRouter X";
 	compatible = "ubnt,edgerouter-x", "mediatek,mt7621-soc";
 };
+
+&gmac1 {
+	status = "okay";
+	label = "eth0";
+	phy-handle = <&ethphy0>;
+
+	nvmem-cells = <&macaddr_factory_22>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
+&switch0 {
+	ports {
+		port@0 {
+			status = "disabled";
+		};
+	};
+};

+ 15 - 5
target/linux/ramips/dts/mt7621_ubnt_usw-flex.dts

@@ -61,6 +61,21 @@
 	label = "dsa";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "lan1";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_eeprom>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -82,11 +97,6 @@
 			status = "okay";
 			label = "lan2";
 		};
-
-		port@4 {
-			status = "okay";
-			label = "lan1";
-		};
 	};
 };
 

+ 1 - 1
target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts

@@ -52,7 +52,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_e000>;
 	nvmem-cell-names = "mac-address";
 	mac-address-increment = <1>;

+ 12 - 5
target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi

@@ -72,13 +72,20 @@
 	};
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy0>;
+};
+
+&mdio {
+	ethphy0: ethernet-phy@0 {
+		reg = <0>;
+	};
+};
+
 &switch0 {
 	ports {
-		wan: port@0 {
-			status = "okay";
-			label = "wan";
-		};
-
 		port@1 {
 			status = "okay";
 			label = "lan1";

+ 1 - 1
target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts

@@ -57,7 +57,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_e000>;
 	nvmem-cell-names = "mac-address";
 	mac-address-increment = <1>;

+ 1 - 1
target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts

@@ -58,7 +58,7 @@
 	nvmem-cell-names = "mac-address";
 };
 
-&wan {
+&gmac1 {
 	nvmem-cells = <&macaddr_factory_e000>;
 	nvmem-cell-names = "mac-address";
 	mac-address-increment = <1>;

+ 12 - 5
target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi

@@ -73,6 +73,18 @@
 	status = "okay";
 };
 
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+};
+
+&mdio {
+	ethphy4: ethernet-phy@4 {
+		reg = <4>;
+	};
+};
+
 &switch0 {
 	ports {
 		port@0 {
@@ -94,11 +106,6 @@
 			status = "okay";
 			label = "lan4";
 		};
-
-		wan: port@4 {
-			status = "okay";
-			label = "wan";
-		};
 	};
 };
 

Some files were not shown because too many files changed in this diff