From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
kernel@pengutronix.de, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next v1 1/1] net: phy: dp83td510: add cable testing support
Date: Fri, 12 Jul 2024 16:36:11 +0200 [thread overview]
Message-ID: <ZpE_WwtSSdxGyWtC@pengutronix.de> (raw)
In-Reply-To: <a14ae101-d492-45a0-90fe-683e2f43fa3e@lunn.ch>
Hi Andrew,
On Mon, Jul 08, 2024 at 06:44:22PM +0200, Andrew Lunn wrote:
> On Mon, Jul 08, 2024 at 04:05:42PM +0200, Oleksij Rempel wrote:
> > Implement the TDR test procedure as described in "Application Note
> > DP83TD510E Cable Diagnostics Toolkit revC", section 3.2.
> >
> > The procedure was tested with "draka 08 signalkabel 2x0.8mm". The reported
> > cable length was 5 meters more for each 20 meters of actual cable length.
> > For instance, a 20-meter cable showed as 25 meters, and a 40-meter cable
> > showed as 50 meters. Since other parts of the diagnostics provided by this
> > PHY (e.g., Active Link Cable Diagnostics) require accurate cable
> > characterization to provide proper results, this tuning can be implemented
> > in a separate patch/interface.
> >
> > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > ---
> > drivers/net/phy/dp83td510.c | 158 ++++++++++++++++++++++++++++++++++++
> > 1 file changed, 158 insertions(+)
> >
> > diff --git a/drivers/net/phy/dp83td510.c b/drivers/net/phy/dp83td510.c
> > index d7616b13c5946..3375fa82927d0 100644
> > --- a/drivers/net/phy/dp83td510.c
> > +++ b/drivers/net/phy/dp83td510.c
> > @@ -4,6 +4,7 @@
> > */
> >
> > #include <linux/bitfield.h>
> > +#include <linux/ethtool_netlink.h>
> > #include <linux/kernel.h>
> > #include <linux/module.h>
> > #include <linux/phy.h>
> > @@ -29,6 +30,42 @@
> > #define DP83TD510E_INT1_LINK BIT(13)
> > #define DP83TD510E_INT1_LINK_EN BIT(5)
> >
> > +#define DP83TD510E_TDR_CFG 0x1e
> > +#define DP83TD510E_TDR_START BIT(15)
> > +#define DP83TD510E_TDR_DONE BIT(1)
> > +#define DP83TD510E_TDR_FAIL BIT(0)
> > +
> > +#define DP83TD510E_CTRL 0x1f
> > +#define DP83TD510E_CTRL_HW_RESET BIT(15)
> > +#define DP83TD510E_CTRL_SW_RESET BIT(14)
> > +
> > +#define DP83TD510E_TDR_CFG1 0x300
>
> > +/* TX_TYPE: Transmit voltage level for TDR. 0 = 1V, 1 = 2.4V */
> > +#define DP83TD510E_TDR_TX_TYPE BIT(12)
>
> This does not appear to be used, so it is not too important. But i
> generally encode this as
>
> #define DP83TD510E_TDR_TX_TYPE_1V (0 << 12)
> #define DP83TD510E_TDR_TX_TYPE_2V4 (1 << 12)
>
> You can then OR in DP83TD510E_TDR_TX_TYPE_1V which does nothing, but
> does document you are using 1V for the test.
Ack.
> > +#define DP83TD510E_TDR_CFG2 0x301
> > +#define DP83TD510E_TDR_END_TAP_INDEX_1 GENMASK(14, 8)
> > +#define DP83TD510E_TDR_END_TAP_INDEX_1_DEF 36
> > +#define DP83TD510E_TDR_START_TAP_INDEX_1 GENMASK(6, 0)
> > +#define DP83TD510E_TDR_START_TAP_INDEX_1_DEF 3
>
> Does this correspond the minimum and maximum distance it will test?
> Is this 3m to 36m?
No. At least, i can't confirm it with tests.
If I see it correctly, this PHY is using SSTDR instead of usual TDR.
Instead of pulses it will send modulated transmission with default
length of 16ms
I tried my best google foo, but was not able to find anything
understandable about "Start/End tap index for echo coeff sweep for segment 1"
im context of SSTDR. If anyone know more about this, please tell me :)
Regards,
Oleksij
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2024-07-12 14:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-08 14:05 [PATCH net-next v1 1/1] net: phy: dp83td510: add cable testing support Oleksij Rempel
2024-07-08 16:44 ` Andrew Lunn
2024-07-12 14:36 ` Oleksij Rempel [this message]
2024-07-12 15:20 ` Andrew Lunn
2024-07-12 15:25 ` Oleksij Rempel
2024-07-09 12:19 ` Simon Horman
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=ZpE_WwtSSdxGyWtC@pengutronix.de \
--to=o.rempel@pengutronix.de \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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).