linux-stable/drivers/net/phy
Marek Vasut 58389c00d4 net: phy: micrel: ksz9031/ksz9131: add cabletest support
Add cable test support for Micrel KSZ9x31 PHYs.

Tested on i.MX8M Mini with KSZ9131RNX in 100/Full mode with pairs shuffled
before magnetics:
(note: Cable test started/completed messages are omitted)

  mx8mm-ksz9131-a-d-connected$ ethtool --cable-test eth0
  Pair A code OK
  Pair B code Short within Pair
  Pair B, fault length: 0.80m
  Pair C code Short within Pair
  Pair C, fault length: 0.80m
  Pair D code OK

  mx8mm-ksz9131-a-b-connected$ ethtool --cable-test eth0
  Pair A code OK
  Pair B code OK
  Pair C code Short within Pair
  Pair C, fault length: 0.00m
  Pair D code Short within Pair
  Pair D, fault length: 0.00m

Tested on R8A77951 Salvator-XS with KSZ9031RNX and all four pairs connected:
(note: Cable test started/completed messages are omitted)

  r8a7795-ksz9031-all-connected$ ethtool --cable-test eth0
  Pair A code OK
  Pair B code OK
  Pair C code OK
  Pair D code OK

The CTRL1000 CTL1000_ENABLE_MASTER and CTL1000_AS_MASTER bits are not
restored by calling phy_init_hw(), they must be manually cached in
ksz9x31_cable_test_start() and restored at the end of
ksz9x31_cable_test_get_status().

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Oleksij Rempel <linux@rempel-privat.de>
Cc: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20220407105534.85833-1-marex@denx.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-04-08 14:15:37 -07:00
..
mscc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-03-17 13:56:58 -07:00
adin.c
amd.c
aquantia.h
aquantia_hwmon.c
aquantia_main.c phy: make phy_set_max_speed() *void* 2022-01-31 11:30:56 +00:00
at803x.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-03 17:36:16 -08:00
ax88796b.c
bcm-cygnus.c
bcm-phy-lib.c
bcm-phy-lib.h
bcm7xxx.c net: phy: bcm7xxx: Add EPHY entry for 7712 2021-10-24 13:42:28 +01:00
bcm63xx.c
bcm87xx.c
bcm54140.c
bcm84881.c
broadcom.c net: phy: broadcom: Fix brcm_fet_config_init() 2022-03-25 16:59:21 -07:00
cicada.c
cortina.c
davicom.c
dp83tc811.c
dp83640.c dp83640: Use generic ptp_msg_is_sync() function 2022-03-07 11:31:34 +00:00
dp83640_reg.h ptp: dp83640: don't define PAGE0 2021-09-14 20:03:24 -07:00
dp83822.c net: phy: DP83822: clear MISR2 register to disable interrupts 2022-03-10 12:24:40 -08:00
dp83848.c
dp83867.c net: phy: constify netdev->dev_addr references 2021-10-24 13:59:44 +01:00
dp83869.c net: phy: add support for TI DP83561-SP phy 2021-11-19 20:13:07 -08:00
et1011c.c
fixed_phy.c Revert "net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in __fixed_phy_register" 2022-01-03 18:59:16 -08:00
icplus.c
intel-xway.c net: phy: intel-xway: Add RGMII internal delay configuration 2021-07-20 07:23:16 -07:00
Kconfig net: phy: Kconfig: micrel_phy: fix dependency issue 2022-03-15 12:28:56 +01:00
linkmode.c
lxt.c
Makefile net: phy: add Maxlinear GPY115/21x/24x driver 2021-07-20 06:55:20 -07:00
marvell-88x2222.c
marvell.c net: phy: marvell: Fix invalid comparison in the resume and suspend functions 2022-03-14 15:08:37 -07:00
marvell10g.c net: phy: marvell10g: add downshift tunable support 2021-09-30 13:22:46 +01:00
mdio-boardinfo.c
mdio-boardinfo.h
mdio_bus.c net: mdio: Demote probed message to debug print 2022-01-03 19:05:39 -08:00
mdio_device.c net: mdio: introduce a shutdown method to mdio device drivers 2021-09-19 12:08:37 +01:00
mdio_devres.c
mediatek-ge.c net: phy: mediatek: remove PHY mode check on MT7531 2022-02-15 14:21:01 +00:00
meson-gxl.c net: phy: meson-gxl: improve link-up behavior 2022-03-10 14:57:02 -08:00
micrel.c net: phy: micrel: ksz9031/ksz9131: add cabletest support 2022-04-08 14:15:37 -07:00
microchip.c
microchip_t1.c net: phy: lan87xx: use genphy_read_master_slave in read_status 2022-03-08 13:34:33 +01:00
mii_timestamper.c
motorcomm.c
mxl-gpy.c net: phy: enhance GPY115 loopback disable function 2021-09-27 13:49:38 +01:00
national.c
nxp-c45-tja11xx.c net: phy: Use netif_rx(). 2022-03-06 11:05:31 +00:00
nxp-tja11xx.c net: phy: nxp-tja11xx: log critical health state 2021-08-12 10:51:45 +01:00
phy-c45.c net: phy: fixed warning: Function parameter not described 2021-10-26 14:09:50 -07:00
phy-core.c phy: make phy_set_max_speed() *void* 2022-01-31 11:30:56 +00:00
phy.c net: phy: fix duplex out of sync problem while changing settings 2021-11-04 16:46:29 -07:00
phy_device.c net: phy: exported the genphy_read_master_slave function 2022-03-08 13:34:33 +01:00
phy_led_triggers.c
phylink.c net: phylink: use %pe for printing errors 2022-03-02 22:02:21 -08:00
qsemi.c
realtek.c net: phy: realtek: add support for RTL8365MB-VC internal PHYs 2021-10-18 14:02:56 +01:00
rockchip.c
sfp-bus.c net: sfp: add 2500base-X quirk for Lantech SFP module 2022-03-15 11:41:20 +01:00
sfp.c net: sfp: use %pe for printing errors 2022-03-02 22:03:34 -08:00
sfp.h
smsc.c
spi_ks8995.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
ste10Xp.c
swphy.c
swphy.h
teranetics.c
uPD60620.c
vitesse.c
xilinx_gmii2rgmii.c net: phy: gmii2rgmii: Support PHY loopback 2021-08-20 14:31:46 +01:00