From 0eed36f2eac74b97c4cfb222cbbd11ecdbdce161 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Mon, 30 May 2022 20:02:38 +0800 Subject: [PATCH] ramips: gehua ghl: switch to new hnat driver --- .../ramips/dts/mt7621_gehua_ghl-r-001.dts | 30 ++++++++++++------- .../mt7621/base-files/etc/board.d/02_network | 6 +--- 2 files changed, 20 insertions(+), 16 deletions(-) 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 ebefa5cc2..50e47a543 100644 --- a/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts +++ b/target/linux/ramips/dts/mt7621_gehua_ghl-r-001.dts @@ -9,10 +9,6 @@ compatible = "gehua,ghl-r-001", "mediatek,mt7621-soc"; model = "GeHua GHL-R-001"; - aliases { - label-mac-device = ðernet; - }; - leds { compatible = "gpio-leds"; @@ -110,19 +106,31 @@ }; }; -ðernet { - compatible = "mediatek,ralink-mt7621-eth"; - mediatek,switch = <&gsw>; +&gmac0 { mtd-mac-address = <&factory 0xe000>; }; -&switch0 { - /delete-property/ compatible; - phy-mode = "rgmii"; +&gmac1 { + mtd-mac-address = <&factory 0xe000>; + mtd-mac-address-increment = <1>; + status = "okay"; }; &gsw { - compatible = "mediatek,ralink-mt7621-gsw"; + mediatek,portmap = "llllw"; + status = "okay"; +}; + +&hnat { + mtketh-wan = "eth1"; + mtketh-ppd = "eth0"; + mtketh-lan = "eth0"; + mtketh-max-gmac = <2>; + /delete-property/ mtkdsa-wan-port; +}; + +&switch0 { + status = "disabled"; }; &state_default { 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 2050c080c..086117f93 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -54,7 +54,7 @@ ramips_setup_interfaces() ;; gehua,ghl-r-001) ucidef_add_switch "switch0" \ - "0:lan" "1:lan" "2:lan" "4:wan" "6@eth0" + "0:lan" "1:lan" "2:lan" "4:wan" "6u@eth0" "5u@eth1" ucidef_set_interface_lan "eth0.1 ra0 rai0" ;; gnubee,gb-pc1|\ @@ -162,10 +162,6 @@ ramips_setup_macs() wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) label_mac=$wan_mac ;; - gehua,ghl-r-001) - lan_mac=$(cat /sys/class/net/eth0/address) - wan_mac=$(macaddr_add "$lan_mac" 1) - ;; hiwifi,hc5962) lan_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ") label_mac=$lan_mac