UPSTREAM: net: phy: dp83867: Recover from "port mirroring" N/A MODE4
authorLukasz Majewski <lukma@denx.de>
Tue, 7 Feb 2017 05:20:24 +0000 (06:20 +0100)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 31 May 2017 03:06:48 +0000 (11:06 +0800)
commit5c980a55bed1c059f9f9612129a8ebdb2cf6bc25
treeea8bd0d20cfd0150692e7abd2da5ae8eb100f6b7
parent5add4f84a83454bcbba1f270c7aa4eb5bd8c81dd
UPSTREAM: net: phy: dp83867: Recover from "port mirroring" N/A MODE4

The DP83867 when not properly bootstrapped - especially with LED_0 pin -
can enter N/A MODE4 for "port mirroring" feature.

To provide normal operation of the PHY, one needs not only to explicitly
disable the port mirroring feature, but as well stop some IC internal
testing (which disables RGMII communication).

To do that the STRAP_STS1 (0x006E) register must be read and RESERVED bit
11 examined. When it is set, the another RESERVED bit (11) at PHYCR
(0x0010) register must be clear to disable testing mode and enable RGMII
communication.

Thorough explanation of the problem can be found at following e2e thread:
"DP83867IR: Problem with RESERVED bits in PHY Control Register (PHYCR) -
Linux driver"

https://e2e.ti.com/support/interface/ethernet/f/903/p/571313/2096954#2096954

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ac6e058b75be71208e98a5808453aae9a17be480)
Change-Id: I1b17b6c88e76230fde3fd1c93c3bb09ee0c2790d
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
drivers/net/phy/dp83867.c