Commit c7604783 authored by Anton Vorontsov's avatar Anton Vorontsov Committed by Kim Phillips
Browse files

tsec: fix link detection for the RTL8211B PHY

RTL8211B sets link state register after autonegotiation complete,
so with bootdelay=0 RTL8211B will report lack of the link.

To fix this, we should wait for aneg to complete, even if the
link is currently down.
Signed-off-by: default avatarAnton Vorontsov <>
Signed-off-by: default avatarKim Phillips <>
parent 7fa9cbb0
......@@ -583,10 +583,11 @@ uint mii_parse_RTL8211B_sr(uint mii_reg, struct tsec_private * priv)
uint speed;
mii_reg = read_phy_reg(priv, MIIM_RTL8211B_PHY_STATUS);
if ((mii_reg & MIIM_RTL8211B_PHYSTAT_LINK) &&
!(mii_reg & MIIM_RTL8211B_PHYSTAT_SPDDONE)) {
if (!(mii_reg & MIIM_RTL8211B_PHYSTAT_SPDDONE)) {
int i = 0;
/* in case of timeout ->link is cleared */
priv->link = 1;
puts("Waiting for PHY realtime link");
while (!(mii_reg & MIIM_RTL8211B_PHYSTAT_SPDDONE)) {
/* Timeout reached ? */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment