Skip to contentSkip to conversation

apalis_imx6: increase phy autoneg timeout

PATCH New Igor Opaniuk 3 participants 5 messages Jun 24, 2019 – Jun 27, 2019 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 apalis_imx6: increase phy autoneg timeout

From: Igor Opaniuk <[email protected]>

Default value (4000ms) of PHY_ANEG_TIMEOUT for Micrel KSZ9031 contoller isn't sufficient to finish auto-negotiation, which sometimes leads to timeout errors:

Apalis iMX6 # dhcp
FEC Waiting for PHY auto negotiation to complete......... TIMEOUT !

Increase the auto-negotiation time-out to 15000ms.

---

v2:
- Based on empirical results from Philippe Schenker, increased timeout value to 15s, just to be on the safe side

 include/configs/apalis_imx6.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/apalis_imx6.h +1 -0
index 4b0a3fb26b..df31cf6fe7 100644
@@ -58,6 +58,7 @@
 #define IMX_FEC_BASE			ENET_BASE_ADDR
 #define CONFIG_FEC_XCV_TYPE		RGMII
 #define CONFIG_ETHPRIME			"FEC"
+#define PHY_ANEG_TIMEOUT		15000 /* PHY needs longer aneg time */
 #define CONFIG_FEC_MXC_PHYADDR		6
 #define CONFIG_TFTP_TSIZE
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/1 apalis_imx6: increase phy autoneg timeout

Quoted 6 lines · Igor Opaniuk

From: Igor Opaniuk <[email protected]>

Default value (4000ms) of PHY_ANEG_TIMEOUT for Micrel KSZ9031 contoller isn't sufficient to finish auto-negotiation, which sometimes leads to timeout errors:

Quoted 6 lines

Apalis iMX6 # dhcp
FEC Waiting for PHY auto negotiation to complete......... TIMEOUT !

Increase the auto-negotiation time-out to 15000ms.

Quoted 21 lines

---

v2:
- Based on empirical results from Philippe Schenker, increased timeout value to 15s, just to be on the safe side

 include/configs/apalis_imx6.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/apalis_imx6.h +1 -0
index 4b0a3fb26b..df31cf6fe7 100644
@@ -58,6 +58,7 @@
 #define IMX_FEC_BASE			ENET_BASE_ADDR
 #define CONFIG_FEC_XCV_TYPE		RGMII
 #define CONFIG_ETHPRIME			"FEC"
+#define PHY_ANEG_TIMEOUT		15000 /* PHY needs longer aneg time */
 #define CONFIG_FEC_MXC_PHYADDR		6
 #define CONFIG_TFTP_TSIZE
 
#2 lore raw

PATCH v2 1/1 apalis_imx6: increase phy autoneg timeout

In reply to Igor Opaniuk

Hi Igor,

Quoted 11 lines · Igor Opaniuk

From: Igor Opaniuk <[email protected]>

Default value (4000ms) of PHY_ANEG_TIMEOUT for Micrel KSZ9031 contoller isn't sufficient to finish auto-negotiation, which sometimes leads to timeout errors:

Apalis iMX6 # dhcp
FEC Waiting for PHY auto negotiation to complete......... TIMEOUT !

Increase the auto-negotiation time-out to 15000ms.

I have no problems to merge this, it is your board. But this seems just hide the issue. 15 seconds for autonegotiation timeout is just a work-around. This means that the autonegotiation fails several times and (maybe with some switches) it has a bigger probability to succeed if we increase the timeout, that is the phy tries more time to set up the link.

Best regards,
Stefano Babic

Quoted 23 lines

---

v2:
- Based on empirical results from Philippe Schenker, increased timeout value to 15s, just to be on the safe side

 include/configs/apalis_imx6.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/apalis_imx6.h +1 -0
index 4b0a3fb26b..df31cf6fe7 100644
@@ -58,6 +58,7 @@
 #define IMX_FEC_BASE			ENET_BASE_ADDR
 #define CONFIG_FEC_XCV_TYPE		RGMII
 #define CONFIG_ETHPRIME			"FEC"
+#define PHY_ANEG_TIMEOUT		15000 /* PHY needs longer aneg time */
 #define CONFIG_FEC_MXC_PHYADDR		6
 #define CONFIG_TFTP_TSIZE
 
Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#3 lore raw

PATCH v2 1/1 apalis_imx6: increase phy autoneg timeout

Quoted 15 lines · Stefano Babic

Hi Igor,

Quoted 11 lines · Igor Opaniuk

From: Igor Opaniuk <[email protected]>

Default value (4000ms) of PHY_ANEG_TIMEOUT for Micrel KSZ9031 contoller isn't sufficient to finish auto-negotiation, which sometimes leads to timeout errors:

Apalis iMX6 # dhcp
FEC Waiting for PHY auto negotiation to complete......... TIMEOUT !

Increase the auto-negotiation time-out to 15000ms.

Quoted 8 lines

I have no problems to merge this, it is your board. But this seems just hide the issue. 15 seconds for autonegotiation timeout is just a work-around. This means that the autonegotiation fails several times and (maybe with some switches) it has a bigger probability to succeed if we increase the timeout, that is the phy tries more time to set up the link.

Best regards,
Stefano Babic

Hi Stefano,

I know that 15s for this timeout is huge. But I tried a lot of things with this PHY and had contact with Microchip about this with no outcome. We did some improvements on the clock side that got things better.
To mention here is that the KSZ9031 is also not compliant with IEEE802.3 in gigabit-mode. I suspect that the gigabit-part of that phy is just 'broken'. I also compared the same switches I tried to other boards like Beagle-X15, they have the same long aneg-times so I basically gave up on this and see this now as is.

Good news is that Microchip has a follow-up phy, the KSZ9131. We've tried it and it looks much better and also faster with autonegotiation.

We could also limit speed of the phy to 100Mbps, there autonegotiation is much faster, but this solution also hides just our problem. That's why we decided for that time-out.

Best regards,
Philippe

Quoted 26 lines
Quoted 24 lines

---

v2:
- Based on empirical results from Philippe Schenker, increased timeout value to 15s, just to be on the safe side

 include/configs/apalis_imx6.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/apalis_imx6.h +1 -0
index 4b0a3fb26b..df31cf6fe7 100644
@@ -58,6 +58,7 @@
 #define IMX_FEC_BASE			ENET_BASE_ADDR
 #define CONFIG_FEC_XCV_TYPE		RGMII
 #define CONFIG_ETHPRIME			"FEC"
+#define PHY_ANEG_TIMEOUT		15000 /* PHY needs longer aneg time */
 #define CONFIG_FEC_MXC_PHYADDR		6
 #define CONFIG_TFTP_TSIZE
 
#4 lore raw

PATCH v2 1/1 apalis_imx6: increase phy autoneg timeout

Hi Philippe,

Quoted 22 lines · Philippe Schenker
Quoted 21 lines · Stefano Babic

Hi Igor,

Quoted 11 lines · Igor Opaniuk

From: Igor Opaniuk <[email protected]>

Default value (4000ms) of PHY_ANEG_TIMEOUT for Micrel KSZ9031 contoller isn't sufficient to finish auto-negotiation, which sometimes leads to timeout errors:

Apalis iMX6 # dhcp
FEC Waiting for PHY auto negotiation to complete......... TIMEOUT !

Increase the auto-negotiation time-out to 15000ms.

I have no problems to merge this, it is your board. But this seems just hide the issue. 15 seconds for autonegotiation timeout is just a work-around. This means that the autonegotiation fails several times and (maybe with some switches) it has a bigger probability to succeed if we increase the timeout, that is the phy tries more time to set up the link.

Quoted 7 lines
Quoted 2 lines

Best regards,
Stefano Babic

Hi Stefano,

I know that 15s for this timeout is huge. But I tried a lot of things with this PHY and had contact with Microchip about this with no outcome.

ok

Quoted 7 lines

We did some
improvements on the clock side that got things better.
To mention here is that the KSZ9031 is also not compliant with IEEE802.3 in gigabit-mode. I suspect that the gigabit-part of that phy is just 'broken'. I also compared the same switches I tried to other boards like Beagle-X15, they have the same long aneg-times so I basically gave up on this and see this now as is.

Ok - thanks for clarification.

Quoted 7 lines

Good news is that Microchip has a follow-up phy, the KSZ9131. We've tried it and it looks much better and also faster with autonegotiation.

We could also limit speed of the phy to 100Mbps, there autonegotiation is much faster, but this solution also hides just our problem. That's why we decided for that time-out.

ok - so we know there is a HW issue, and we cannot solve it - just add this work-around. I apply this still for 2019.04 as "fix".

Best regards,
Stefano

Quoted 31 lines

Best regards,
Philippe

Quoted 26 lines
Quoted 24 lines

---

v2:
- Based on empirical results from Philippe Schenker, increased timeout value to 15s, just to be on the safe side

 include/configs/apalis_imx6.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/apalis_imx6.h +1 -0
index 4b0a3fb26b..df31cf6fe7 100644
@@ -58,6 +58,7 @@
 #define IMX_FEC_BASE			ENET_BASE_ADDR
 #define CONFIG_FEC_XCV_TYPE		RGMII
 #define CONFIG_ETHPRIME			"FEC"
+#define PHY_ANEG_TIMEOUT		15000 /* PHY needs longer aneg time */
 #define CONFIG_FEC_MXC_PHYADDR		6
 #define CONFIG_TFTP_TSIZE
 
Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================