lkml.org 
[lkml]   [2020]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next 3/4] net: phy: broadcom: add cable test support
On Sun, May 10, 2020 at 12:37:13AM +0200, Michael Walle wrote:
> Most modern broadcom PHYs support ECD (enhanced cable diagnostics). Add
> support for it in the bcm-phy-lib so they can easily be used in the PHY
> driver.
>
> There are two access methods for ECD: legacy by expansion registers and
> via the new RDB registers which are exclusive. Provide functions in two
> variants where the PHY driver can from. To keep things simple for now,

can from ?

> +static int bcm_phy_report_length(struct phy_device *phydev, int result,
> + int pair)
> +{
> + int val;
> +
> + val = __bcm_phy_read_exp(phydev,
> + BCM54XX_EXP_ECD_PAIR_A_LENGTH_RESULTS + pair);
> + if (val < 0)
> + return val;
> +
> + if (val == BCM54XX_ECD_LENGTH_RESULTS_INVALID)
> + return 0;
> +
> + /* intra-pair shorts report twice the length */
> + if (result == BCM54XX_ECD_FAULT_TYPE_CROSS_SHORT)
> + val >>= 1;

You mentioned this before. This seems odd. The pulse travelled the
same distance as for an open or shorted cable. The whole of time
domain reflectrometry is based on some sort of echo and you always
need to device by two. So why this special case?

Florian, do you have access to any erratas? Is this maybe fixed in
other revisions/family members?

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Andrew

\
 
 \ /
  Last update: 2020-05-10 16:44    [W:0.367 / U:1.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site