From 0d5151f43582005286ed990cb26bdb97f1984364 Mon Sep 17 00:00:00 2001 From: noire11 Date: Thu, 11 Feb 2021 09:19:39 +0800 Subject: [PATCH] ramips: use mt proprietary driver for Netgear R6800 Signed-off-by: noire11 Signed-off-by: CN_SZTL --- .../dts/mt7621_netgear_sercomm_bzv.dtsi | 38 +++++-------------- .../mt7621/base-files/etc/board.d/02_network | 8 ++++ 2 files changed, 17 insertions(+), 29 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi index 71c95e75bd..f67052fd7d 100644 --- a/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi +++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi @@ -9,7 +9,7 @@ compatible = "mediatek,mt7621-soc"; aliases { - label-mac-device = &gmac0; + label-mac-device = ðernet; led-boot = &led_power_white; led-failsafe = &led_power_orange; led-running = &led_power_white; @@ -161,39 +161,19 @@ }; }; -&gmac0 { +ðernet { + compatible = "mediatek,ralink-mt7621-eth"; + mediatek,switch = <&gsw>; mtd-mac-address = <&factory 0x4>; }; &switch0 { - ports { - port@0 { - status = "okay"; - label = "lan4"; - }; + /delete-property/ compatible; + phy-mode = "rgmii"; +}; - 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>; - }; - }; +&gsw { + compatible = "mediatek,ralink-mt7621-gsw"; }; &i2c { 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 26c5fa1fda..b1c2ee2db1 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 @@ -73,6 +73,10 @@ ramips_setup_interfaces() mikrotik,routerboard-760igs) ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan sfp" ;; + netgear,r6800) + ucidef_add_switch "switch0" \ + "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0" + ;; phicomm,k2p|\ xiaoyu,xy-c5) ucidef_add_switch "switch0" \ @@ -170,6 +174,10 @@ ramips_setup_macs() wan_mac=$label_mac lan_mac=$(macaddr_add $label_mac 1) ;; + netgear,r6800) + lan_mac=$(mtd_get_mac_binary factory 0x4) + wan_mac=$(macaddr_add "$lan_mac" 2) + ;; phicomm,k2p) wan_mac=$(mtd_get_mac_binary factory 0xe006) ;;