net: ethernet: ti: davinci_mdio: Add workaround for errata i2329
authorRavi Gunasekaran <r-gunasekaran@ti.com>
Wed, 17 Aug 2022 09:44:06 +0000 (15:14 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Aug 2022 11:52:06 +0000 (12:52 +0100)
commitd04807b80691c6041ca8e3dcf1870d1bf1082c22
tree1c30356601348ea029c9bd15b4cb265e1f5fadfe
parentbb726b753f75a4eeda291438f89dfd9b94783569
net: ethernet: ti: davinci_mdio: Add workaround for errata i2329

On the CPSW and ICSS peripherals, there is a possibility that the MDIO
interface returns corrupt data on MDIO reads or writes incorrect data
on MDIO writes. There is also a possibility for the MDIO interface to
become unavailable until the next peripheral reset.

The workaround is to configure the MDIO in manual mode and disable the
MDIO state machine and emulate the MDIO protocol by reading and writing
appropriate fields in MDIO_MANUAL_IF_REG register of the MDIO controller
to manipulate the MDIO clock and data pins.

More details about the errata i2329 and the workaround is available in:
https://www.ti.com/lit/er/sprz487a/sprz487a.pdf

Add implementation to disable MDIO state machine, configure MDIO in manual
mode and achieve MDIO read and writes via MDIO Bitbanging

Signed-off-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/davinci_mdio.c