OSDN Git Service

net: phy: broadcom: add cable test support
authorMichael Walle <michael@walle.cc>
Wed, 13 May 2020 16:35:23 +0000 (18:35 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 May 2020 19:52:38 +0000 (12:52 -0700)
commit11ecf8c55b91806e4dc6a1b9fe7cbf68cdc9b006
tree8dad14749b9bfdbf39a45ef1560beada87d66515
parente184a9072f8995e78ad6cef48bfeab2b987945ec
net: phy: broadcom: add cable test support

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 choose from. To keep things simple for
now, we just switch the register access to expansion registers in the
RDB variant for now. On the flipside, we have to keep a bus lock to
prevent any other non-legacy access on the PHY.

The results of the intra-pair tests are inconclusive (at least for the
BCM54140). Most of the times half the length is reported but sometimes
the length is correct.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/bcm-phy-lib.c
drivers/net/phy/bcm-phy-lib.h
include/linux/brcmphy.h