From c78af7bc2160cfca7feb6fd773a37621503582ce Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Fri, 10 Jun 2022 21:28:20 +0800 Subject: [PATCH] ramips: jcg y2: switch to new hnat driver --- target/linux/ramips/dts/mt7621_jcg_y2.dts | 46 ++++++++----------- .../mt7621/base-files/etc/board.d/02_network | 1 + 2 files changed, 20 insertions(+), 27 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_jcg_y2.dts b/target/linux/ramips/dts/mt7621_jcg_y2.dts index 06d6579aa..bd88923f7 100644 --- a/target/linux/ramips/dts/mt7621_jcg_y2.dts +++ b/target/linux/ramips/dts/mt7621_jcg_y2.dts @@ -92,34 +92,26 @@ mtd-mac-address = <&factory 0xe000>; }; +&gmac1 { + mtd-mac-address = <&factory 0xe006>; + status = "okay"; +}; + +&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 { - 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 0xe006>; - }; - }; + 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 1d4eb2ebd..bb5caefaf 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 @@ -75,6 +75,7 @@ ramips_setup_interfaces() mikrotik,routerboard-760igs) ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan sfp" ;; + jcg,y2|\ phicomm,k2p|\ xiaoyu,xy-c5) ucidef_add_switch "switch0" \