ath25: switch default kernel to 5.15
[openwrt/staging/wigyori.git] / target / linux / ath79 / patches-5.10 / 425-at803x-allow-sgmii-aneg-override.patch
1 From: David Bauer <mail@david-bauer.net>
2 Subject: [PATCH] ath79: allow to override AR8033 SGMII aneg status
3
4 In order to make the QCA955x SGMII workaround work, the unsuccessful
5 SGMII autonegotiation on the AR8033 should not block the PHY
6 state-machine.
7
8 Otherwise, the ag71xx driver never becomes aware of the copper-side
9 link-establishment and the workaround is never executed.
10
11 Submitted-by: David Bauer <mail@david-bauer.net>
12 Submitted-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
13 ---
14 drivers/net/phy/at803x.c-override.patch | 7 +++++++
15 1 files changed, 7 insertions(+)
16
17 --- a/drivers/net/phy/at803x.c
18 +++ b/drivers/net/phy/at803x.c
19 @@ -959,6 +959,13 @@ static int at803x_aneg_done(struct phy_d
20 if (!(phy_read(phydev, AT803X_PSSR) & AT803X_PSSR_MR_AN_COMPLETE)) {
21 phydev_warn(phydev, "803x_aneg_done: SGMII link is not ok\n");
22 aneg_done = 0;
23 +#ifdef CONFIG_OF_MDIO
24 + if (phydev->mdio.dev.of_node &&
25 + of_property_read_bool(phydev->mdio.dev.of_node,
26 + "at803x-override-sgmii-link-check")) {
27 + aneg_done = 1;
28 + }
29 +#endif
30 }
31 /* switch back to copper page */
32 phy_write(phydev, AT803X_REG_CHIP_CONFIG, ccr | AT803X_BT_BX_REG_SEL);