[OpenWrt-Devel] [PATCH 3/4] ath79: allow to override AR8033 SGMII aneg status
David Bauer
mail at david-bauer.net
Thu Apr 11 11:59:44 EDT 2019
In order to make the QCA955x SGMII workaround work, the unsuccessful
SGMII autonegotiation on the AR8033 should not block the PHY
state-machine.
Otherwise, the ag71xx driver never becomes aware of the copper-side
link-establishment and the workaround is never executed.
Signed-off-by: David Bauer <mail at david-bauer.net>
---
.../425-at803x-allow-sgmii-aneg-override.patch | 16 ++++++++++++++++
.../425-at803x-allow-sgmii-aneg-override.patch | 16 ++++++++++++++++
2 files changed, 32 insertions(+)
create mode 100644 target/linux/ath79/patches-4.14/425-at803x-allow-sgmii-aneg-override.patch
create mode 100644 target/linux/ath79/patches-4.19/425-at803x-allow-sgmii-aneg-override.patch
diff --git a/target/linux/ath79/patches-4.14/425-at803x-allow-sgmii-aneg-override.patch b/target/linux/ath79/patches-4.14/425-at803x-allow-sgmii-aneg-override.patch
new file mode 100644
index 0000000000..0ac6af38f3
--- /dev/null
+++ b/target/linux/ath79/patches-4.14/425-at803x-allow-sgmii-aneg-override.patch
@@ -0,0 +1,16 @@
+--- a/drivers/net/phy/at803x.c
++++ b/drivers/net/phy/at803x.c
+@@ -484,6 +484,13 @@ static int at803x_aneg_done(struct phy_d
+ if (!(phy_read(phydev, AT803X_PSSR) & AT803X_PSSR_MR_AN_COMPLETE)) {
+ pr_warn("803x_aneg_done: SGMII link is not ok\n");
+ aneg_done = 0;
++#ifdef CONFIG_OF_MDIO
++ if (phydev->mdio.dev.of_node &&
++ of_property_read_bool(phydev->mdio.dev.of_node,
++ "at803x-override-sgmii-link-check")) {
++ aneg_done = 1;
++ }
++#endif
+ }
+ /* switch back to copper page */
+ phy_write(phydev, AT803X_REG_CHIP_CONFIG, ccr | AT803X_BT_BX_REG_SEL);
diff --git a/target/linux/ath79/patches-4.19/425-at803x-allow-sgmii-aneg-override.patch b/target/linux/ath79/patches-4.19/425-at803x-allow-sgmii-aneg-override.patch
new file mode 100644
index 0000000000..0ac6af38f3
--- /dev/null
+++ b/target/linux/ath79/patches-4.19/425-at803x-allow-sgmii-aneg-override.patch
@@ -0,0 +1,16 @@
+--- a/drivers/net/phy/at803x.c
++++ b/drivers/net/phy/at803x.c
+@@ -484,6 +484,13 @@ static int at803x_aneg_done(struct phy_d
+ if (!(phy_read(phydev, AT803X_PSSR) & AT803X_PSSR_MR_AN_COMPLETE)) {
+ pr_warn("803x_aneg_done: SGMII link is not ok\n");
+ aneg_done = 0;
++#ifdef CONFIG_OF_MDIO
++ if (phydev->mdio.dev.of_node &&
++ of_property_read_bool(phydev->mdio.dev.of_node,
++ "at803x-override-sgmii-link-check")) {
++ aneg_done = 1;
++ }
++#endif
+ }
+ /* switch back to copper page */
+ phy_write(phydev, AT803X_REG_CHIP_CONFIG, ccr | AT803X_BT_BX_REG_SEL);
--
2.21.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list