From: Andrew Lunn <andrew@lunn.ch>
To: Willy Liu <willy.liu@realtek.com>
Cc: hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net,
kuba@kernel.org, fancer.lancer@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, ryankao@realtek.com,
kevans@FreeBSD.org
Subject: Re: [PATCH net] net: phy: realtek: fix rtl8211e rx/tx delay config
Date: Fri, 25 Sep 2020 16:40:42 +0200 [thread overview]
Message-ID: <20200925144042.GI3821492@lunn.ch> (raw)
In-Reply-To: <1601018715-952-1-git-send-email-willy.liu@realtek.com>
On Fri, Sep 25, 2020 at 03:25:15PM +0800, Willy Liu wrote:
> There are two chip pins named TXDLY and RXDLY which actually adds the 2ns
> delays to TXC and RXC for TXD/RXD latching. These two pins can config via
> 4.7k-ohm resistor to 3.3V hw setting, but also config via software setting
> (extension page 0xa4 register 0x1c bit13 12 and 11).
>
> The configuration register definitions from table 13 official PHY datasheet:
> PHYAD[2:0] = PHY Address
> AN[1:0] = Auto-Negotiation
> Mode = Interface Mode Select
> RX Delay = RX Delay
> TX Delay = TX Delay
> SELRGV = RGMII/GMII Selection
>
> This table describes how to config these hw pins via external pull-high or pull-
> low resistor.
>
> It is a misunderstanding that mapping it as register bits below:
> 8:6 = PHY Address
> 5:4 = Auto-Negotiation
> 3 = Interface Mode Select
> 2 = RX Delay
> 1 = TX Delay
> 0 = SELRGV
> So I removed these descriptions above and add related settings as below:
> 14 = reserved
> 13 = force Tx RX Delay controlled by bit12 bit11
> 12 = Tx Delay
> 11 = Rx Delay
> 10:0 = Test && debug settings reserved by realtek
Hi Willy
Thanks for adding a full description of what the bits do.
Please in future add a version number to the subject line.
[PATCH net v3] .....
So we know which is the latest version.
I think the fix is actually wrong.
/* enable TX/RX delay for rgmii-* modes, and disable them for rgmii. */
switch (phydev->interface) {
case PHY_INTERFACE_MODE_RGMII:
val = 0;
break;
case PHY_INTERFACE_MODE_RGMII_ID:
val = RTL8211E_TX_DELAY | RTL8211E_RX_DELAY;
break;
case PHY_INTERFACE_MODE_RGMII_RXID:
val = RTL8211E_RX_DELAY;
break;
case PHY_INTERFACE_MODE_RGMII_TXID:
val = RTL8211E_TX_DELAY;
break;
default: /* the rest of the modes imply leaving delays as is. */
return 0;
}
If the user requests RGMII, we really should set it to RGMII, not
leave the strapping configuration enabled. That means we need to turn
on the force bit, and the two delays off. Please also change the
case PHY_INTERFACE_MODE_RGMII.
Thanks
Andrew
next prev parent reply other threads:[~2020-09-25 14:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-25 7:25 Willy Liu
2020-09-25 14:40 ` Andrew Lunn [this message]
2020-09-25 21:41 ` Jakub Kicinski
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=20200925144042.GI3821492@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=fancer.lancer@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=kevans@FreeBSD.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=ryankao@realtek.com \
--cc=willy.liu@realtek.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
all inboxes | Powered by JetHome®