From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 785C3C3A5A1 for ; Thu, 22 Aug 2019 14:45:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 480BD233A1 for ; Thu, 22 Aug 2019 14:45:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="j5o9ZTiS"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="sQhrwnvp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 480BD233A1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hAXg5TesGZ311+qAyFJyc32OuNZUFcZCpR+JIDVUvsA=; b=j5o9ZTiSQ7hkxy eXK2OwHxBKfz7bAOBqmvb36mqPdH7bRJ4l2uyG++Fez6X1c5742DEtuH4x4uXSU4GqC3AEmqoIMJ9 XtW96BwlJJ3bXPObJn7WWgHINkYLe4McKVflGuBIkDAxVOtp+ynyAzUOA+iGKmvtyNYJKeVvryA82 E8+Oh4mI3L8zF4KjFruCpidGCpr0PKbrWiP9WQrjEmQcPpYu/lrYAKIdWds3nTFkSKSAqXgHslrc4 dCYcAoDkZqG9au1dLQHuDU4vpkLMod67lPmROEJVsbVTnbwnh8QZu0xs6UY6BTetNYTpHMafAzdCx kp2Og9CSy252hZajE4XA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i0oKq-0006vE-NT; Thu, 22 Aug 2019 14:45:08 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i0oKb-0006I2-1F; Thu, 22 Aug 2019 14:44:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ups/VrVzSUhhwl/GEM5YSxWOiDm7bA4AN942AhbRqwo=; b=sQhrwnvpafZLPmo5FsdfINJTy gqrWQhb1Z+5QCrEIDeMoEi3SdBeRlQ0v769zMUgIPnlfHp+R1toUOanWZs4j4fAgaJJx1+1pNN3Pk sNHT4ZUjpanIjfQnjDQrwSSarOzK6SevySl9bvgFrqzO6breQcO9593EEUjk1JNQrOqUxmxuFJU0c TpuUduJ3+r+cF0iBFl5sEupcoYvbP5YoYJ3FOfWGLzUpxFTU5tFekqHvRaVXIpVmTTl0GqkOdI5eb pqV3DqYa6AYnAb68AilWTr+NCyLz1cmjlmYN/zsAZnyRurU3lp3eQ/w5Z3yHwvYigqb2Bblzib3XI tYyrEZhDg==; Received: from shell.armlinux.org.uk ([2001:4d48:ad52:3201:5054:ff:fe00:4ec]:48060) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1i0oKL-0007ES-Kj; Thu, 22 Aug 2019 15:44:37 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1i0oKH-0007m8-RC; Thu, 22 Aug 2019 15:44:33 +0100 Date: Thu, 22 Aug 2019 15:44:33 +0100 From: Russell King - ARM Linux admin To: =?iso-8859-1?Q?Ren=E9?= van Dorst Subject: Re: [PATCH net-next v2 2/3] net: ethernet: mediatek: Re-add support SGMII Message-ID: <20190822144433.GT13294@shell.armlinux.org.uk> References: <20190821144336.9259-1-opensource@vdorst.com> <20190821144336.9259-3-opensource@vdorst.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190821144336.9259-3-opensource@vdorst.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190822_074453_096007_4222C68E X-CRM114-Status: GOOD ( 11.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nelson Chang , Frank Wunderlich , netdev@vger.kernel.org, Sean Wang , linux-mips@vger.kernel.org, linux-mediatek@lists.infradead.org, John Crispin , Matthias Brugger , Stefan Roese , "David S . Miller" , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Aug 21, 2019 at 04:43:35PM +0200, Ren=E9 van Dorst wrote: > + if (MTK_HAS_CAPS(mac->hw->soc->caps, MTK_SGMII)) { > + if (state->interface !=3D PHY_INTERFACE_MODE_2500BASEX) { > phylink_set(mask, 1000baseT_Full); > phylink_set(mask, 1000baseX_Full); > + } else { > + phylink_set(mask, 2500baseT_Full); > + phylink_set(mask, 2500baseX_Full); > + } If you can dynamically switch between 1000BASE-X and 2500BASE-X, then you need to have both set. See mvneta.c: if (pp->comphy || state->interface !=3D PHY_INTERFACE_MODE_2500BASE= X) { phylink_set(mask, 1000baseT_Full); phylink_set(mask, 1000baseX_Full); } if (pp->comphy || state->interface =3D=3D PHY_INTERFACE_MODE_2500BA= SEX) { phylink_set(mask, 2500baseT_Full); phylink_set(mask, 2500baseX_Full); } What this is saying is, if we have a comphy (which is the serdes lane facing component, where the data rate is setup) then we can support both speeds (and so mask ends up with all four bits set.) Otherwise, we only support a single-speed (1000Gbps for non-2500BASE-X etc.) > + } else { > + if (state->interface =3D=3D PHY_INTERFACE_MODE_TRGMII) { > + phylink_set(mask, 1000baseT_Full); > + } else { > + phylink_set(mask, 10baseT_Half); > + phylink_set(mask, 10baseT_Full); > + phylink_set(mask, 100baseT_Half); > + phylink_set(mask, 100baseT_Full); > + > + if (state->interface !=3D PHY_INTERFACE_MODE_MII) { > + phylink_set(mask, 1000baseT_Half); > + phylink_set(mask, 1000baseT_Full); > + phylink_set(mask, 1000baseX_Full); > + } I'm also wondering about the "MTK_HAS_CAPS(mac->hw->soc->caps, MTK_SGMII)" above. (Here comes a reason why using SGMII to cover all single-lane serdes modes causes confusion - unfortunately, some folk use SGMII to describe all these modes. So, I'm going to use the terminology "Cisco SGMII" to mean exactly the SGMII format published by Cisco, "802.3 1000BASE-X" to mean the original IEEE 802.3 format running at 1.25Gbps, and "up-clocked 2500BASE-X" to mean the 3.125Gbps version of the 802.3 1000BASE-X protocol.) Isn't this set for Cisco SGMII as well as for 802.3 1000BASE-X and the up-clocked 2500BASE-X modes? If so, is there a reason why 10Mbps and 100Mbps speeds aren't supported on Cisco SGMII links? -- = RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps = up According to speedtest.net: 11.9Mbps down 500kbps up _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel