All of lore.kernel.org
 help / color / mirror / Atom feed
From: Madalin-cristian Bucur <madalin.bucur@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] armv8/ls1046a: RGMII PHY requires internal delay on Tx
Date: Thu, 3 Aug 2017 06:01:47 +0000	[thread overview]
Message-ID: <AM5PR0402MB2691B2F8CF5181B4BE72F44DECB10@AM5PR0402MB2691.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <VI1PR04MB20782F4BB49782C4CEA1C5389AB00@VI1PR04MB2078.eurprd04.prod.outlook.com>

> -----Original Message-----
> From: York Sun
> Sent: Wednesday, August 02, 2017 11:36 PM
> To: Madalin-cristian Bucur <madalin.bucur@nxp.com>; u-boot at lists.denx.de;
> joe.hershberger at ni.com
> Cc: Mingkai Hu <mingkai.hu@nxp.com>
> Subject: Re: [PATCH 2/2] armv8/ls1046a: RGMII PHY requires internal delay
> on Tx
> 
> On 04/04/2017 04:44 AM, Madalin Bucur wrote:
> > Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
> > ---
> >   drivers/net/fm/ls1046.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/fm/ls1046.c b/drivers/net/fm/ls1046.c
> > index bf55554..6c91fb9 100644
> > --- a/drivers/net/fm/ls1046.c
> > +++ b/drivers/net/fm/ls1046.c
> > @@ -72,12 +72,12 @@ phy_interface_t fman_port_enet_if(enum fm_port port)
> >   	if (port == FM1_DTSEC3)
> >   		if ((rcwsr13 & FSL_CHASSIS2_RCWSR13_EC1) ==
> >   				FSL_CHASSIS2_RCWSR13_EC1_DTSEC3_RGMII)
> > -			return PHY_INTERFACE_MODE_RGMII;
> > +			return PHY_INTERFACE_MODE_RGMII_TXID;
> >
> >   	if (port == FM1_DTSEC4)
> >   		if ((rcwsr13 & FSL_CHASSIS2_RCWSR13_EC2) ==
> >   				FSL_CHASSIS2_RCWSR13_EC2_DTSEC4_RGMII)
> > -			return PHY_INTERFACE_MODE_RGMII;
> > +			return PHY_INTERFACE_MODE_RGMII_TXID;
> >
> >   	/* handle SGMII, only MAC 2/5/6/9/10 available */
> >   	switch (port) {
> >
> 
> I don't know what test you have run. This change breaks network on
> LS1043ARDB FM1 at DTSEC3.
> 
> York

Hi York,

You're likely using an old kernel, if you move to one that has removed the
hardcoded internal delay for RGMII [1] you'll notice that RGMII no longer
works with the old u-boot and you need this patch. We're in this situation
because someone decided to hardcode internal delay for RGMII mode [2] in the
Linux RTL8211F PHY driver. Someone else hardcoded the PHY fixup in u-boot to
RGMII instead of RGMII_TXID [3] to align to that initial mistake. The issue
with this u-boot fixup is that it overwrites device tree information, so one
cannot correct this from the dts.

Regards,
Madalin

[1] Linux kernel commit that removes hardcoded Tx internal delay for RTL8211F

commit e3230494b57ece68750e3e32d3e53d6b00917058
Author: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Date:   Fri Nov 25 14:12:01 2016 +0100

    net: phy: realtek: fix enabling of the TX-delay for RTL8211F

    The old logic always enabled the TX-delay when the phy-mode was set to
    PHY_INTERFACE_MODE_RGMII. There are dedicated phy-modes which tell the
    PHY driver to enable the RX and/or TX delays:
    - PHY_INTERFACE_MODE_RGMII should disable the RX and TX delay in the
      PHY (if required, the MAC should add the delays in this case)
    - PHY_INTERFACE_MODE_RGMII_ID should enable RX and TX delay in the PHY
    - PHY_INTERFACE_MODE_RGMII_TXID should enable the TX delay in the PHY
    - PHY_INTERFACE_MODE_RGMII_RXID should enable the RX delay in the PHY
      (currently not supported by RTL8211F)

    With this patch we enable the TX delay for PHY_INTERFACE_MODE_RGMII_ID
    and PHY_INTERFACE_MODE_RGMII_TXID.
    Additionally we now explicity disable the TX-delay, which seems to be
    enabled automatically after a hard-reset of the PHY (by triggering it's
    reset pin) to get a consistent state (as defined by the phy-mode).

    This fixes a compatibility problem with some SoCs where the TX-delay was
    also added by the MAC. With the TX-delay being applied twice the TX
    clock was off and TX traffic was broken or very slow (<10Mbit/s) on
    1000Mbit/s links.

    Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

[2] Linux patch that hardcoded Tx ID for RGMII on RTL8211F

commit 3447cf2e9a11fd672de8b3cc613eabd97fe82053
Author: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Date:   Thu Jun 18 16:42:47 2015 +0800

    net/phy: Add support for Realtek RTL8211F

    RTL8211F has different register definitions from RTL8211E.
    Specially it needs to enable TXDLY in case of RGMII.

    Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

[3] u-boot commit that hardcoded RGMII instead of the required RGMII_TXID

commit 9d3b8bd166e6c23ab83d0dcd49d81c6f0bf39e17
Author: Mingkai Hu <mingkai.hu@nxp.com>
Date:   Tue Jul 5 16:01:56 2016 +0800

    drivers: net/fm: Add Fman support for LS1046A

    The Fman module on LS1046A is similiar with that on LS1043A but
    LS1046A has one more XFI (10GbE) interface.

    Signed-off-by: Shaohui Xie <Shaohui.Xie@nxp.com>
    Signed-off-by: Mingkai Hu <mingkai.hu@nxp.com>
    Signed-off-by: Gong Qianyu <Qianyu.Gong@nxp.com>
    Reviewed-by: York Sun <york.sun@nxp.com>

  reply	other threads:[~2017-08-03  6:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1491306223-27293-1-git-send-email-madalin.bucur@nxp.com>
     [not found] ` <1491306223-27293-3-git-send-email-madalin.bucur@nxp.com>
2017-08-02 20:35   ` [U-Boot] [PATCH 2/2] armv8/ls1046a: RGMII PHY requires internal delay on Tx York Sun
2017-08-03  6:01     ` Madalin-cristian Bucur [this message]
2017-08-03 16:14       ` York Sun
2017-08-04  6:34         ` Madalin-cristian Bucur
2017-08-04 15:13           ` York Sun
2017-04-03 14:43 [U-Boot] [PATCH 0/2] armv8/ls104xa: add Tx internal delays for the RGMII PHYs Madalin Bucur
2017-04-03 14:43 ` [U-Boot] [PATCH 2/2] armv8/ls1046a: RGMII PHY requires internal delay on Tx Madalin Bucur
2017-05-30 20:42   ` Joe Hershberger

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=AM5PR0402MB2691B2F8CF5181B4BE72F44DECB10@AM5PR0402MB2691.eurprd04.prod.outlook.com \
    --to=madalin.bucur@nxp.com \
    --cc=u-boot@lists.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: link
Be 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.