Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1523959imc; Mon, 11 Mar 2019 16:12:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyvTNSoelzk6Ho2dVJhrN6RbVo4cTkXHUA/KuwxsvwacBP3Rsl1pdeqhusmorbmqoWhDnFp X-Received: by 2002:a63:b242:: with SMTP id t2mr32242208pgo.451.1552345939748; Mon, 11 Mar 2019 16:12:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552345939; cv=none; d=google.com; s=arc-20160816; b=TSjWBNG1yaMBv0UUowUyKNAGBKh1jGwxOSq3nNI9mG5mlU+FcBwcnggBddXHtvCSXR nccOEaU6VBWg+2hYK9RJ1FkPM2iOnP91ccrSn0Gh4kInMslexVXnIhIy9yp2J7iuA9zS LRcFVSBkiyajbCzb3MsRhxJq4uGuW9tSD9JazUEIHu98lReknJ2nU2Vn5KhVwMuF4hQX jwiNSFs58vhmz2MXjIHvaAD2XCmmxRoOMnuhIqF/X9q2g6h7xriaukslHsjrKGCs1xB9 GLW0EDOojiOBNRpJ+m+0VgMae6mC6fi+l8+kdNjjqgexCasrPqY+GvLh6Q3tFEdMKeB8 f23w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:cc:subject:date:to :from; bh=6MvoDY/HotgmraiBnUmAReLOjxLd0uCQN1laaVEZj0U=; b=yducs8qhlCDkWWdAUAnXTqDqBI7bKsyaOrIjRA15m47nK4ZLDELIn24JFDghxkges8 i3uFZG1cJvXKWoRFApmO2d0lF0joA/u6W0D98/963q119iTa2pSsNHlXDv5H6TcrE76F WpMG/Niytl+g4Bq2IZhKcTcq0XjxbEuIBLUhnKyOMXFLj1jTJFM9FD0sjoGoz+hZNoNJ S9vVp9FIId2BH9pt5S+rsDMSU7U6SVCITqv87RUk9qG1O9FLAkZfdBDIoFhKZ9r3Yy2Q eWLu/o6WLrsdKCBYhrQP3CU7vlXRR2NHVHX7bQZFhiuTloN9X1n3n3+Q2+XGPRxQFX7P xnlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3si6132357pfj.137.2019.03.11.16.12.03; Mon, 11 Mar 2019 16:12:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726628AbfCKXKP (ORCPT + 99 others); Mon, 11 Mar 2019 19:10:15 -0400 Received: from mx2.suse.de ([195.135.220.15]:35674 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726415AbfCKXKP (ORCPT ); Mon, 11 Mar 2019 19:10:15 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 3E4A3B15C; Mon, 11 Mar 2019 23:10:12 +0000 (UTC) From: NeilBrown To: Greg Kroah-Hartman Date: Tue, 12 Mar 2019 10:09:37 +1100 Subject: [PATCH 2/2] staging: mt7621-dts: update ethernet settings. Cc: devel@driverdev.osuosl.org, lkml Message-ID: <155234577702.4958.16102949327222755790.stgit@noble.brown> In-Reply-To: <155234569479.4958.3984850739390042194.stgit@noble.brown> References: <155234569479.4958.3984850739390042194.stgit@noble.brown> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ethernet in mt7621 is now supported by drivers/net/ethernet/mediatek/ which provides support for the integrated switch through DSA. This requires some devicetree changes, and particularly allows a board dts to identify which switch ports are present. The second CPU interface - gmac1 - doesn't work yet, so the device tree information may not be correct. The phy (which is present on the gnubee-pc2) can negotiate and report connection speed etc, but no traffic flows. The gnubee-pc1 has two network ports which are 'black' and 'blue'. There are connected to switch ports 0 and 4 respectively. Signed-off-by: NeilBrown --- drivers/staging/mt7621-dts/gbpc1.dts | 29 ++++++------- drivers/staging/mt7621-dts/mt7621.dtsi | 73 +++++++++++++++++++++++++++++++- 2 files changed, 83 insertions(+), 19 deletions(-) diff --git a/drivers/staging/mt7621-dts/gbpc1.dts b/drivers/staging/mt7621-dts/gbpc1.dts index b73385540216..250c15ace2a7 100644 --- a/drivers/staging/mt7621-dts/gbpc1.dts +++ b/drivers/staging/mt7621-dts/gbpc1.dts @@ -117,22 +117,6 @@ status = "okay"; }; -ðernet { - //mtd-mac-address = <&factory 0xe000>; - gmac1: mac@0 { - compatible = "mediatek,eth-mac"; - reg = <0>; - phy-handle = <&phy1>; - }; - - mdio-bus { - phy1: ethernet-phy@1 { - reg = <1>; - phy-mode = "rgmii"; - }; - }; -}; - &pinctrl { state_default: pinctrl0 { gpio { @@ -141,3 +125,16 @@ }; }; }; + +&switch0 { + ports { + port@0 { + label = "ethblack"; + status = "ok"; + }; + port@4 { + label = "ethblue"; + status = "ok"; + }; + }; +}; diff --git a/drivers/staging/mt7621-dts/mt7621.dtsi b/drivers/staging/mt7621-dts/mt7621.dtsi index 6aff3680ce4b..17020e24abd2 100644 --- a/drivers/staging/mt7621-dts/mt7621.dtsi +++ b/drivers/staging/mt7621-dts/mt7621.dtsi @@ -372,16 +372,83 @@ mediatek,ethsys = <ðsys>; - mediatek,switch = <&gsw>; + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "rgmii"; + fixed-link { + speed = <1000>; + full-duplex; + pause; + }; + }; + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + status = "off"; + phy-mode = "rgmii"; + phy-handle = <&phy5>; + }; mdio-bus { #address-cells = <1>; #size-cells = <0>; - phy1f: ethernet-phy@1f { - reg = <0x1f>; + phy5: ethernet-phy@5 { + reg = <5>; phy-mode = "rgmii"; }; + + switch0: switch0@0 { + compatible = "mediatek,mt7621"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + mediatek,mcm; + resets = <&rstctrl 2>; + reset-names = "mcm"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + port@0 { + status = "off"; + reg = <0>; + label = "lan0"; + }; + port@1 { + status = "off"; + reg = <1>; + label = "lan1"; + }; + port@2 { + status = "off"; + reg = <2>; + label = "lan2"; + }; + port@3 { + status = "off"; + reg = <3>; + label = "lan3"; + }; + port@4 { + status = "off"; + reg = <4>; + label = "lan4"; + }; + port@6 { + reg = <6>; + label = "cpu"; + ethernet = <&gmac0>; + phy-mode = "trgmii"; + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; + }; }; };