]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: at803x: Add support for hardware reset
authorDaniel Mack <zonque@gmail.com>
Wed, 18 Jun 2014 09:01:43 +0000 (11:01 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 21 Jun 2014 22:50:00 +0000 (15:50 -0700)
commitd3a69f66d29796f7b339c3abd25854c6b2f00c00
tree268100006a23483618c21fc14dd2aff0c728488b
parentd8840777eb8275b6771373e2c591fc3cd19e0807
net: phy: at803x: Add support for hardware reset

The AT8030 will enter a FIFO error mode if a packet is transmitted while
the cable is unplugged. This hardware issue is acknowledged by the
vendor, and the only proposed solution is to conduct a hardware reset
via the external pin each time the link goes down. There is apparantly
no way to fix up the state via the register set.

This patch adds support for reading a 'reset-gpios' property from the DT
node of the PHY. If present, this gpio is used to apply a hardware reset
each time a 'link down' condition is detected. All relevant registers
are read out before, and written back after the reset cycle.

Doing this every time the link goes down might seem like overkill, but
there is unfortunately no way of figuring out whether the PHY is in
such a lock-up state. Hence, this is the only way of reliably fixing up
things.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/at803x.c