Skip to contentSkip to conversation

mx6cuboxi: Fix the reset delay for the AR8035 PHY

PATCH Superseded Fabio Estevam 2 participants 3 messages Jan 4, 2016 – Jan 7, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mx6cuboxi: Fix the reset delay for the AR8035 PHY

From: Fabio Estevam <[email protected]>

Since commit 59370f3fcd1350 ("net: phy: delay only if reset handler is registered") Ethernet is no longer functional:

Booting from net ...
FEC Waiting for PHY auto negotiation to complete......... TIMEOUT ! BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4

This commit does not have an issue in itself, but it revelead a problem with the Ethernet initialization.

As per the AR8035 datasheet:

"For a reliable power on reset, suggest to keep asserting the reset low long enough (10ms) to ensure the clock is stable and clock-to-reset 1ms requirement is satisfied."

So do as suggested and keep the reset low for 10ms.

Also add a 100us delay after deasserting the reset line to guarantee that the PHY ID can be read correctly and the Atheros PHY can be loaded as per Troy Kisky's suggestion.

---
Changes since v1:
- Fix the issue in a single patch by adding an extra udelay(100) as suggested by Troy.

 board/solidrun/mx6cuboxi/mx6cuboxi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
board/solidrun/mx6cuboxi/mx6cuboxi.c +2 -1
index fc37f1e..18b08d1 100644
@@ -143,8 +143,9 @@ static void setup_iomux_enet(void)
 	SETUP_IOMUX_PADS(enet_pads);
 
 	gpio_direction_output(ETH_PHY_RESET, 0);
-	mdelay(2);
+	mdelay(10);
 	gpio_set_value(ETH_PHY_RESET, 1);
+	udelay(100);
 }
 
 int board_phy_config(struct phy_device *phydev)
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/1 mx6cuboxi: Fix the reset delay for the AR8035 PHY

Quoted 21 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Since commit 59370f3fcd1350 ("net: phy: delay only if reset handler is registered") Ethernet is no longer functional:

Booting from net ...
FEC Waiting for PHY auto negotiation to complete......... TIMEOUT ! BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4

This commit does not have an issue in itself, but it revelead a problem with the Ethernet initialization.

As per the AR8035 datasheet:

"For a reliable power on reset, suggest to keep asserting the reset low long enough (10ms) to ensure the clock is stable and clock-to-reset 1ms requirement is satisfied."

Quoted 7 lines

So do as suggested and keep the reset low for 10ms.

Also add a 100us delay after deasserting the reset line to guarantee that the PHY ID can be read correctly and the Atheros PHY can be loaded as per Troy Kisky's suggestion.

Repeated my test from V1, still passes (and takes a while for the initial BOOTP reply):

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160104/586f6e7a/attachment.sig>
#2 lore raw

PATCH v2 1/1 mx6cuboxi: Fix the reset delay for the AR8035 PHY

Quoted 4 lines · Tom Rini

Repeated my test from V1, still passes (and takes a while for the initial BOOTP reply):

Thanks for testing it, Tom.

Stefano,

Please apply this one for 2016.01, thanjs.