Skip to content

Commit 34c55cf

Browse files
Karicheri, Muralidharandavem330
authored andcommitted
net: phy: dp83867: allow RGMII_TXID/RGMII_RXID interface types
Currently dp83867 driver returns error if phy interface type PHY_INTERFACE_MODE_RGMII_RXID is used to set the rx only internal delay. Similarly issue happens for PHY_INTERFACE_MODE_RGMII_TXID. Fix this by checking also the interface type if a particular delay value is missing in the phy dt bindings. Also update the DT document accordingly. Signed-off-by: Murali Karicheri <[email protected]> Signed-off-by: Sekhar Nori <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 02ca042 commit 34c55cf

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Documentation/devicetree/bindings/net/ti,dp83867.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
Required properties:
44
- reg - The ID number for the phy, usually a small integer
55
- ti,rx-internal-delay - RGMII Receive Clock Delay - see dt-bindings/net/ti-dp83867.h
6-
for applicable values
6+
for applicable values. Required only if interface type is
7+
PHY_INTERFACE_MODE_RGMII_ID or PHY_INTERFACE_MODE_RGMII_RXID
78
- ti,tx-internal-delay - RGMII Transmit Clock Delay - see dt-bindings/net/ti-dp83867.h
8-
for applicable values
9+
for applicable values. Required only if interface type is
10+
PHY_INTERFACE_MODE_RGMII_ID or PHY_INTERFACE_MODE_RGMII_TXID
911
- ti,fifo-depth - Transmitt FIFO depth- see dt-bindings/net/ti-dp83867.h
1012
for applicable values
1113

drivers/net/phy/dp83867.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,16 @@ static int dp83867_of_init(struct phy_device *phydev)
132132

133133
ret = of_property_read_u32(of_node, "ti,rx-internal-delay",
134134
&dp83867->rx_id_delay);
135-
if (ret)
135+
if (ret &&
136+
(phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
137+
phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID))
136138
return ret;
137139

138140
ret = of_property_read_u32(of_node, "ti,tx-internal-delay",
139141
&dp83867->tx_id_delay);
140-
if (ret)
142+
if (ret &&
143+
(phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
144+
phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID))
141145
return ret;
142146

143147
return of_property_read_u32(of_node, "ti,fifo-depth",

0 commit comments

Comments
 (0)