armv8: ls2080aqds: fix SGMII repeater settings

The current value to check whether the PHY was configured has dependency
on MC, it expects MC to start PCS AN, this is not true during boot up,
so it should be changed to remove the dependency.

The PHY's register space should be restore to default after accessing
extended space.

Signed-off-by: Shaohui Xie <Shaohui.Xie@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
This commit is contained in:
Shaohui Xie 2016-10-17 16:20:48 +08:00 committed by York Sun
parent 5eef15ea9d
commit c435a7c8c1

View file

@ -144,8 +144,10 @@ static void sgmii_configure_repeater(int serdes_port)
mdelay(10); mdelay(10);
if ((value & 0xfff) == 0x40f) { if ((value & 0xfff) == 0x401) {
printf("DPMAC %d:PHY is ..... Configured\n", dpmac_id); printf("DPMAC %d:PHY is ..... Configured\n", dpmac_id);
miiphy_write(dev[mii_bus], riser_phy_addr[dpmac],
0x1f, 0);
continue; continue;
} }
@ -181,22 +183,21 @@ static void sgmii_configure_repeater(int serdes_port)
if (ret > 0) if (ret > 0)
goto error; goto error;
mdelay(1); mdelay(100);
ret = miiphy_read(dev[mii_bus], ret = miiphy_read(dev[mii_bus],
riser_phy_addr[dpmac], riser_phy_addr[dpmac],
0x11, &value); 0x11, &value);
if (ret > 0) if (ret > 0)
goto error; goto error;
mdelay(10);
if ((value & 0xfff) == 0x40f) { if ((value & 0xfff) == 0x401) {
printf("DPMAC %d :PHY is configured ", printf("DPMAC %d :PHY is configured ",
dpmac_id); dpmac_id);
printf("after setting repeater 0x%x\n", printf("after setting repeater 0x%x\n",
value); value);
i = 5; i = 5;
j = 5; j = 5;
} else } else {
printf("DPMAC %d :PHY is failed to ", printf("DPMAC %d :PHY is failed to ",
dpmac_id); dpmac_id);
printf("configure the repeater 0x%x\n", printf("configure the repeater 0x%x\n",
@ -204,6 +205,8 @@ static void sgmii_configure_repeater(int serdes_port)
} }
} }
} }
miiphy_write(dev[mii_bus], riser_phy_addr[dpmac], 0x1f, 0);
}
error: error:
if (ret) if (ret)
printf("DPMAC %d ..... FAILED to configure PHY\n", dpmac_id); printf("DPMAC %d ..... FAILED to configure PHY\n", dpmac_id);