net: phy: dp83td510: add cable testing support
authorOleksij Rempel <o.rempel@pengutronix.de>
Fri, 12 Jul 2024 15:28:48 +0000 (17:28 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 13 Jul 2024 23:00:44 +0000 (16:00 -0700)
commit0cda1acfa235f2ee75597e7b378de54a91d69e99
tree1098b12a6200ca7fa066e6f8ad606c7e2e00c253
parente7cdef626f1d7ca69eb3351a8c4ae6a8ec46feed
net: phy: dp83td510: add cable testing support

This patch implements 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>
changes v2:
- add comments
- change post silence time to 1000ms
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20240712152848.2479912-1-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/dp83td510.c