From patchwork Wed Dec 21 10:20:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 9482823 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B906E60487 for ; Wed, 21 Dec 2016 10:23:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AAAF627FB6 for ; Wed, 21 Dec 2016 10:23:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F558283FD; Wed, 21 Dec 2016 10:23:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 193E227FB6 for ; Wed, 21 Dec 2016 10:23:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cJe1W-0006I3-Vk; Wed, 21 Dec 2016 10:21:26 +0000 Received: from arcturus.kleine-koenig.org ([2a01:4f8:d12:1f44::2]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cJe1S-0005yZ-E7 for linux-arm-kernel@lists.infradead.org; Wed, 21 Dec 2016 10:21:24 +0000 Received: by arcturus.kleine-koenig.org (Postfix, from userid 1000) id 476CCE4163; Wed, 21 Dec 2016 11:20:58 +0100 (CET) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Jason Cooper , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth Subject: [PATCH] ARM: dts: turris-omnia: add support for ethernet switch Date: Wed, 21 Dec 2016 11:20:47 +0100 Message-Id: <20161221102047.28036-1-uwe@kleine-koenig.org> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161221_022122_855948_588D7436 X-CRM114-Status: GOOD ( 11.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Michal Hrusecki , Vivien Didelot , Tomas Hlavacek , linux-arm-kernel@lists.infradead.org, Tomas Hlavacek , =?UTF-8?q?Andreas=20F=C3=A4rber?= , =?UTF-8?q?Bed=C5=99icha=20Ko=C5=A1atu?= Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The Turris Omnia features a Marvell MV88E7176 ethernet switch. Add it to the dts. Signed-off-by: Uwe Kleine-König --- Hello, when the MAC is operated in rgmii mode and the switch in rgmii-id communication between them works fine. The other way round it doesn't work. The fixed-link nodes in the cpu port description is necessary to let the mv88e6xxx driver use the phy-mode description. Is this a bug? Regarding the binding, I think the label in the port nodes is strange. label = "lan2" for an external port is fine. But label = "cpu" for a port facing a CPU MAC looks wrong, still more as the Turris Omnia has two ports connected to the SoC and so there are two ports with the same label. I would suggest to use a separate property for that, e.g. cpu-port; and no label. Best regards Uwe arch/arm/boot/dts/armada-385-turris-omnia.dts | 101 +++++++++++++++++++++++++- 1 file changed, 99 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/armada-385-turris-omnia.dts b/arch/arm/boot/dts/armada-385-turris-omnia.dts index ab49acb2d452..6722d3243f9b 100644 --- a/arch/arm/boot/dts/armada-385-turris-omnia.dts +++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts @@ -122,7 +122,7 @@ pinctrl-names = "default"; pinctrl-0 = <&ge0_rgmii_pins>; status = "okay"; - phy-mode = "rgmii-id"; + phy-mode = "rgmii"; fixed-link { speed = <1000>; @@ -135,7 +135,7 @@ pinctrl-names = "default"; pinctrl-0 = <&ge1_rgmii_pins>; status = "okay"; - phy-mode = "rgmii-id"; + phy-mode = "rgmii"; fixed-link { speed = <1000>; @@ -274,6 +274,103 @@ }; /* Switch MV88E7176 at address 0x10 */ + switch@10 { + compatible = "marvell,mv88e6085"; + #address-cells = <1>; + #size-cells = <0>; + dsa,member = <0 0>; + + reg = <0x10>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + ports@0 { + reg = <0>; + label = "lan0"; + phy-handle = <&lan0phy>; + }; + + ports@1 { + reg = <1>; + label = "lan1"; + phy-handle = <&lan1phy>; + }; + + ports@2 { + reg = <2>; + label = "lan2"; + phy-handle = <&lan2phy>; + }; + + ports@3 { + reg = <3>; + label = "lan3"; + phy-handle = <&lan3phy>; + }; + + ports@4 { + reg = <4>; + label = "lan4"; + phy-handle = <&lan4phy>; + }; + + ports@5 { + reg = <5>; + label = "cpu"; + ethernet = <ð1>; + phy-mode = "rgmii-id"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + + ports@6 { + reg = <6>; + label = "cpu"; + ethernet = <ð0>; + phy-mode = "rgmii-id"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + lan0phy: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; + + lan1phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; + + lan2phy: ethernet-phy@2 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <2>; + }; + + lan3phy: ethernet-phy@3 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <3>; + }; + + lan4phy: ethernet-phy@4 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <4>; + }; + }; + }; }; &pinctrl {