Skip to contentSkip to conversation

net: phy: ti: Use default values for tx/rx delay and fifo size

PATCH In review Trent Piepho 3 participants 3 messages May 9, 2019 – Jul 15, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: phy: ti: Use default values for tx/rx delay and fifo size

When not using DM_ETH, these PHY settings are programmed with default values hardcoded into the driver. When using DM_ETH, they should come from the device tree. However, if the device tree does not have the properties, the driver will silent use -1. Which is entirely out of range, programs nonsense into the PHY's registers, and does not work.

Change this to use the same defaults as non-DM_ETH if the device tree is lacking the properties.

As an alternative, the kernel driver for the phy will display an error message and fail if the device tree is lacking.

Cc Joe Hershberger <[email protected]>
Cc Janine Hagemann <[email protected]>
Cc Grygorii Strashko <[email protected]>
---
 drivers/net/phy/ti.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/phy/ti.c +3 -3
index 6db6edd0d0..33f5687e0e 100644
@@ -240,14 +240,14 @@ static int dp83867_of_init(struct phy_device *phydev)
 		dp83867->rxctrl_strap_quirk = true;
 	dp83867->rx_id_delay = ofnode_read_u32_default(node,
 						       "ti,rx-internal-delay",
-						       -1);
+						       DEFAULT_RX_ID_DELAY);
 
 	dp83867->tx_id_delay = ofnode_read_u32_default(node,
 						       "ti,tx-internal-delay",
-						       -1);
+						       DEFAULT_TX_ID_DELAY);
 
 	dp83867->fifo_depth = ofnode_read_u32_default(node, "ti,fifo-depth",
-						      -1);
+						      DEFAULT_FIFO_DEPTH);
 	if (ofnode_read_bool(node, "enet-phy-lane-swap"))
 		dp83867->port_mirroring = DP83867_PORT_MIRRORING_EN;
 
Signature · 1 line
2.14.5
#1 lore raw

PATCH 1/1 net: phy: ti: Use default values for tx/rx delay and fifo size

Quoted 19 lines

-----Original Message-----
From: Trent Piepho <[email protected]>
Sent: Thursday, May 09, 2019 2:42 PM
To: u-boot at lists.denx.de
Cc: Trent Piepho <[email protected]>; Joseph Hershberger <[email protected]>; Janine Hagemann <[email protected]>; Grygorii Strashko <[email protected]>
Subject: [EXTERNAL] [PATCH] net: phy: ti: Use default values for tx/rx delay and fifo size

When not using DM_ETH, these PHY settings are programmed with default values hardcoded into the driver. When using DM_ETH, they should come from the device tree. However, if the device tree does not have the properties, the driver will silent use -1. Which is entirely out of range, programs nonsense into the PHY's registers, and does not work.

Change this to use the same defaults as non-DM_ETH if the device tree is lacking the properties.

Quoted 7 lines

As an alternative, the kernel driver for the phy will display an error message and fail if the device tree is lacking.

Cc Joe Hershberger <[email protected]>
Cc Janine Hagemann <[email protected]>
Cc Grygorii Strashko <[email protected]>