]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: realtek: add support for configuring the RX delay on RTL8211F
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Thu, 26 Dec 2019 18:51:48 +0000 (19:51 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 26 Dec 2019 21:22:17 +0000 (13:22 -0800)
commit4b865ea2125eb48ad1b032f46abc37bf3a927994
treeabf617c9934dac2c8bb31ccb2e70f3422071e2fc
parent0e2aa4cb68fc49bf7949db30c369f6e7950c8bdb
net: phy: realtek: add support for configuring the RX delay on RTL8211F

On RTL8211F the RX and TX delays (2ns) can be configured in two ways:
- pin strapping (RXD1 for the TX delay and RXD0 for the RX delay, LOW
  means "off" and HIGH means "on") which is read during PHY reset
- using software to configure the TX and RX delay registers

So far only the configuration using pin strapping has been supported.
Add support for enabling or disabling the RGMII RX delay based on the
phy-mode to be able to get the RX delay into a known state. This is
important because the RX delay has to be coordinated between the PHY,
MAC and the PCB design (trace length). With an invalid RX delay applied
(for example if both PHY and MAC add a 2ns RX delay) Ethernet may not
work at all.

Also add debug logging when configuring the RX delay (just like the TX
delay) because this is a common source of problems.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/realtek.c