From: "Jiawen Wu" <jiawenwu@trustnetic.com>
To: "'Vladimir Oltean'" <olteanv@gmail.com>
Cc: <netdev@vger.kernel.org>, <linux@armlinux.org.uk>,
<linux-i2c@vger.kernel.org>, <linux-gpio@vger.kernel.org>,
<mengyuanlou@net-swift.com>,
"'Jose Abreu'" <Jose.Abreu@synopsys.com>
Subject: RE: [PATCH net-next v3 6/8] net: pcs: Add 10GBASE-R mode for Synopsys Designware XPCS
Date: Thu, 20 Apr 2023 17:32:05 +0800 [thread overview]
Message-ID: <03d401d9736a$f880d2a0$e98277e0$@trustnetic.com> (raw)
In-Reply-To: <20230420085211.6kt2oj3k5k54mtuf@skbuf>
On Thursday, April 20, 2023 4:52 PM, Vladimir Oltean wrote:
> On Thu, Apr 20, 2023 at 04:38:48PM +0800, Jiawen Wu wrote:
> > It needs to implement compat->pma_config, and add a flag in struct dw_xpcs
> > to indicate board with specific pma configuration. For 10GBASE-R interface, it
> > relatively simple, but a bit more complicate for 1000BASE-X since there are
> > logic conflicts in xpcs_do_config(), I haven't resolved yet.
> >
> > In addition, reconfiguring XPCS will cause some known issues that I need to
> > workaround in the ethernet driver. So I'd like to add configuration when I
> > implement rate switching.
> >
> > There is a piece codes for my test:
>
> The PMA initialization procedure looks pretty clean to me (although I'm
> not clear why it depends upon xpcs->flags & DW_MODEL_WANGXUN_SP when the
> registers seem to be present in the common databook), and having it in
> the XPCS driver seems much preferable to depending on an unknown previous
> initialization stage.
The values configured in PMA depend on the board signal quality, Synopsys once
provided the values based on our board information, but we don't know the details
of the computation. So I don't think it's universal.
>
> Could you detail a bit the known issues and the 1000BASE-X conflicts in
> xpcs_do_config()?
>
Known issue is that traffic must be totally stopped while the PMA is being configured.
And XPCS should add a judgment that PMA only need to be reconfigured when
interface is changed.
In 1000BASE-X interface, for my current testing, PMA configuration should precede
AN configuration, and need to set PCS_DIG_CTRL1 reg? My test code for AN config:
+static int xpcs_config_aneg_c37_1000basex_wx(struct dw_xpcs *xpcs, unsigned int mode,
+ const unsigned long *advertising)
+{
+
+ xpcs_write(xpcs, MDIO_MMD_PCS, DW_VR_MII_DIG_CTRL1, 0x3002);
+ xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_CTRL, 0x0109);
+ xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_DIG_CTRL1, 0x0200);
+ ret = xpcs_read(xpcs, MDIO_MMD_VEND2, MDIO_CTRL1);
+ ret |= BMCR_ANENABLE;
+ xpcs_write(xpcs, MDIO_MMD_VEND2, MDIO_CTRL1, ret);
+}
next prev parent reply other threads:[~2023-04-20 9:32 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-19 8:27 [PATCH net-next v3 0/8] TXGBE PHYLINK support Jiawen Wu
2023-04-19 8:27 ` [PATCH net-next v3 1/8] net: txgbe: Add software nodes to support phylink Jiawen Wu
2023-04-19 20:53 ` Andrew Lunn
2023-04-19 8:27 ` [PATCH net-next v3 2/8] i2c: designware: Add driver support for Wangxun 10Gb NIC Jiawen Wu
2023-04-19 14:36 ` Jarkko Nikula
2023-04-20 10:49 ` Jiawen Wu
2023-04-19 20:58 ` Andrew Lunn
2023-04-20 10:29 ` Jiawen Wu
2023-04-20 13:22 ` Andrew Lunn
2023-04-21 2:20 ` Jiawen Wu
2023-04-21 12:15 ` Andrew Lunn
2023-04-21 6:52 ` Jarkko Nikula
2023-04-21 12:22 ` Andrew Lunn
2023-04-21 13:00 ` Jarkko Nikula
2023-04-19 8:27 ` [PATCH net-next v3 3/8] net: txgbe: Register I2C platform device Jiawen Wu
2023-04-19 8:27 ` [PATCH net-next v3 4/8] net: txgbe: Add SFP module identify Jiawen Wu
2023-04-19 13:55 ` Vladimir Oltean
2023-04-19 8:27 ` [PATCH net-next v3 5/8] net: txgbe: Support GPIO to SFP socket Jiawen Wu
2023-04-19 8:27 ` [PATCH net-next v3 6/8] net: pcs: Add 10GBASE-R mode for Synopsys Designware XPCS Jiawen Wu
2023-04-19 13:19 ` Vladimir Oltean
2023-04-20 1:56 ` Jiawen Wu
2023-04-20 8:03 ` Vladimir Oltean
2023-04-20 8:38 ` Jiawen Wu
2023-04-20 8:52 ` Vladimir Oltean
2023-04-20 9:32 ` Jiawen Wu [this message]
2023-04-19 8:27 ` [PATCH net-next v3 7/8] net: txgbe: Implement phylink pcs Jiawen Wu
2023-04-19 8:27 ` [PATCH net-next v3 8/8] net: txgbe: Support phylink MAC layer Jiawen Wu
2023-04-19 13:39 ` [PATCH net-next v3 0/8] TXGBE PHYLINK support Vladimir Oltean
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='03d401d9736a$f880d2a0$e98277e0$@trustnetic.com' \
--to=jiawenwu@trustnetic.com \
--cc=Jose.Abreu@synopsys.com \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mengyuanlou@net-swift.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).