From: Russell King - ARM Linux admin <linux@armlinux.org.uk> To: "René van Dorst" <opensource@vdorst.com> Cc: John Crispin <john@phrozen.org>, Sean Wang <sean.wang@mediatek.com>, Nelson Chang <nelson.chang@mediatek.com>, "David S . Miller" <davem@davemloft.net>, Matthias Brugger <matthias.bgg@gmail.com>, Frank Wunderlich <frank-w@public-files.de>, netdev@vger.kernel.org, linux-mips@vger.kernel.org, linux-mediatek@lists.infradead.org, Stefan Roese <sr@denx.de>, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH net-next v2 2/3] net: ethernet: mediatek: Re-add support SGMII Date: Thu, 22 Aug 2019 15:44:33 +0100 [thread overview] Message-ID: <20190822144433.GT13294@shell.armlinux.org.uk> (raw) In-Reply-To: <20190821144336.9259-3-opensource@vdorst.com> On Wed, Aug 21, 2019 at 04:43:35PM +0200, René van Dorst wrote: > + if (MTK_HAS_CAPS(mac->hw->soc->caps, MTK_SGMII)) { > + if (state->interface != 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 != PHY_INTERFACE_MODE_2500BASEX) { phylink_set(mask, 1000baseT_Full); phylink_set(mask, 1000baseX_Full); } if (pp->comphy || state->interface == PHY_INTERFACE_MODE_2500BASEX) { 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 == 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 != 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
WARNING: multiple messages have this Message-ID (diff)
From: Russell King - ARM Linux admin <linux@armlinux.org.uk> To: "René van Dorst" <opensource@vdorst.com> Cc: Nelson Chang <nelson.chang@mediatek.com>, Frank Wunderlich <frank-w@public-files.de>, netdev@vger.kernel.org, Sean Wang <sean.wang@mediatek.com>, linux-mips@vger.kernel.org, linux-mediatek@lists.infradead.org, John Crispin <john@phrozen.org>, Matthias Brugger <matthias.bgg@gmail.com>, Stefan Roese <sr@denx.de>, "David S . Miller" <davem@davemloft.net>, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH net-next v2 2/3] net: ethernet: mediatek: Re-add support SGMII Date: Thu, 22 Aug 2019 15:44:33 +0100 [thread overview] Message-ID: <20190822144433.GT13294@shell.armlinux.org.uk> (raw) In-Reply-To: <20190821144336.9259-3-opensource@vdorst.com> On Wed, Aug 21, 2019 at 04:43:35PM +0200, René van Dorst wrote: > + if (MTK_HAS_CAPS(mac->hw->soc->caps, MTK_SGMII)) { > + if (state->interface != 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 != PHY_INTERFACE_MODE_2500BASEX) { phylink_set(mask, 1000baseT_Full); phylink_set(mask, 1000baseX_Full); } if (pp->comphy || state->interface == PHY_INTERFACE_MODE_2500BASEX) { 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 == 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 != 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
next prev parent reply other threads:[~2019-08-22 14:44 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-08-21 14:43 [PATCH net-next v2 0/3] net: ethernet: mediatek: convert to PHYLINK René van Dorst 2019-08-21 14:43 ` René van Dorst 2019-08-21 14:43 ` [PATCH net-next v2 1/3] net: ethernet: mediatek: Add basic PHYLINK support René van Dorst 2019-08-21 14:43 ` René van Dorst 2019-08-22 14:27 ` Russell King - ARM Linux admin 2019-08-22 14:27 ` Russell King - ARM Linux admin 2019-08-22 15:11 ` René van Dorst 2019-08-22 15:11 ` René van Dorst 2019-08-21 14:43 ` [PATCH net-next v2 2/3] net: ethernet: mediatek: Re-add support SGMII René van Dorst 2019-08-21 14:43 ` René van Dorst 2019-08-22 14:44 ` Russell King - ARM Linux admin [this message] 2019-08-22 14:44 ` Russell King - ARM Linux admin 2019-08-22 19:50 ` René van Dorst 2019-08-22 19:50 ` René van Dorst 2019-08-22 21:11 ` Russell King - ARM Linux admin 2019-08-22 21:11 ` Russell King - ARM Linux admin 2019-08-21 14:43 ` [PATCH net-next v2 3/3] dt-bindings: net: ethernet: Update mt7622 docs and dts to reflect the new phylink API René van Dorst 2019-08-21 14:43 ` René van Dorst 2019-08-27 21:51 ` Rob Herring 2019-08-27 21:51 ` Rob Herring
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190822144433.GT13294@shell.armlinux.org.uk \ --to=linux@armlinux.org.uk \ --cc=davem@davemloft.net \ --cc=frank-w@public-files.de \ --cc=john@phrozen.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-mediatek@lists.infradead.org \ --cc=linux-mips@vger.kernel.org \ --cc=matthias.bgg@gmail.com \ --cc=nelson.chang@mediatek.com \ --cc=netdev@vger.kernel.org \ --cc=opensource@vdorst.com \ --cc=sean.wang@mediatek.com \ --cc=sr@denx.de \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.