aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/net/ti,dp83867.txt7
-rw-r--r--drivers/net/phy/dp83867.c11
2 files changed, 18 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/net/ti,dp83867.txt b/Documentation/devicetree/bindings/net/ti,dp83867.txt
index afe9630a5e7d..02c4353b5cf2 100644
--- a/Documentation/devicetree/bindings/net/ti,dp83867.txt
+++ b/Documentation/devicetree/bindings/net/ti,dp83867.txt
@@ -18,6 +18,13 @@ Optional property:
18 - ti,max-output-impedance - MAC Interface Impedance control to set 18 - ti,max-output-impedance - MAC Interface Impedance control to set
19 the programmable output impedance to 19 the programmable output impedance to
20 maximum value (70 ohms). 20 maximum value (70 ohms).
21 - ti,dp83867-rxctrl-strap-quirk - This denotes the fact that the
22 board has RX_DV/RX_CTRL pin strapped in
23 mode 1 or 2. To ensure PHY operation,
24 there are specific actions that
25 software needs to take when this pin is
26 strapped in these modes. See data manual
27 for details.
21 28
22Note: ti,min-output-impedance and ti,max-output-impedance are mutually 29Note: ti,min-output-impedance and ti,max-output-impedance are mutually
23 exclusive. When both properties are present ti,max-output-impedance 30 exclusive. When both properties are present ti,max-output-impedance
diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index b57f20e552ba..c1ab976cc800 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -91,6 +91,7 @@ struct dp83867_private {
91 int fifo_depth; 91 int fifo_depth;
92 int io_impedance; 92 int io_impedance;
93 int port_mirroring; 93 int port_mirroring;
94 bool rxctrl_strap_quirk;
94}; 95};
95 96
96static int dp83867_ack_interrupt(struct phy_device *phydev) 97static int dp83867_ack_interrupt(struct phy_device *phydev)
@@ -164,6 +165,9 @@ static int dp83867_of_init(struct phy_device *phydev)
164 else if (of_property_read_bool(of_node, "ti,min-output-impedance")) 165 else if (of_property_read_bool(of_node, "ti,min-output-impedance"))
165 dp83867->io_impedance = DP83867_IO_MUX_CFG_IO_IMPEDANCE_MIN; 166 dp83867->io_impedance = DP83867_IO_MUX_CFG_IO_IMPEDANCE_MIN;
166 167
168 dp83867->rxctrl_strap_quirk = of_property_read_bool(of_node,
169 "ti,dp83867-rxctrl-strap-quirk");
170
167 ret = of_property_read_u32(of_node, "ti,rx-internal-delay", 171 ret = of_property_read_u32(of_node, "ti,rx-internal-delay",
168 &dp83867->rx_id_delay); 172 &dp83867->rx_id_delay);
169 if (ret && 173 if (ret &&
@@ -214,6 +218,13 @@ static int dp83867_config_init(struct phy_device *phydev)
214 dp83867 = (struct dp83867_private *)phydev->priv; 218 dp83867 = (struct dp83867_private *)phydev->priv;
215 } 219 }
216 220
221 /* RX_DV/RX_CTRL strapped in mode 1 or mode 2 workaround */
222 if (dp83867->rxctrl_strap_quirk) {
223 val = phy_read_mmd(phydev, DP83867_DEVADDR, DP83867_CFG4);
224 val &= ~BIT(7);
225 phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_CFG4, val);
226 }
227
217 if (phy_interface_is_rgmii(phydev)) { 228 if (phy_interface_is_rgmii(phydev)) {
218 val = phy_read(phydev, MII_DP83867_PHYCTRL); 229 val = phy_read(phydev, MII_DP83867_PHYCTRL);
219 if (val < 0) 230 if (val < 0)