From 0de1301c535bf092bf9e5c858d3a52fd3544c9cd 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 (#6324) * ramips: use mt proprietary driver for Netgear R6800 Signed-off-by: noire11 * Merge branch 'master' of https://github.com/noire11/lede --- .../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 d2e5502e4..a066ed339 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; }; chosen { @@ -61,39 +61,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 d9efb24de..5f1e371c1 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 @@ -56,6 +56,10 @@ ramips_setup_interfaces() mikrotik,routerboard-750gr3) ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan" ;; + netgear,r6800) + ucidef_add_switch "switch0" \ + "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0" + ;; netgear,r6850|\ dlink,dir-867-a1|\ dlink,dir-878-a1|\ @@ -159,6 +163,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) + ;; xiaomi,mir3g|\ xiaomi,mi-router-ac2100|\ xiaomi,redmi-router-ac2100)