b42102a9661c0886ed4d48bc9b42ff997e82b765
[openwrt/openwrt.git] / target / linux / ath79 / patches-5.10 / 425-at803x-allow-sgmii-aneg-override.patch
1 --- a/drivers/net/phy/at803x.c
2 +++ b/drivers/net/phy/at803x.c
3 @@ -698,6 +698,13 @@ static int at803x_aneg_done(struct phy_d
4 if (!(phy_read(phydev, AT803X_PSSR) & AT803X_PSSR_MR_AN_COMPLETE)) {
5 phydev_warn(phydev, "803x_aneg_done: SGMII link is not ok\n");
6 aneg_done = 0;
7 +#ifdef CONFIG_OF_MDIO
8 + if (phydev->mdio.dev.of_node &&
9 + of_property_read_bool(phydev->mdio.dev.of_node,
10 + "at803x-override-sgmii-link-check")) {
11 + aneg_done = 1;
12 + }
13 +#endif
14 }
15 /* switch back to copper page */
16 phy_write(phydev, AT803X_REG_CHIP_CONFIG, ccr | AT803X_BT_BX_REG_SEL);