aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorDavid Bauer <mail@david-bauer.net>2021-04-15 00:54:49 +0200
committerDavid Bauer <mail@david-bauer.net>2021-04-15 22:40:39 +0200
commit8222f8e1b9bec804fc4e8b21c546cc602b2e1fa2 (patch)
treef5f91fe99adff6c43bad2f26b91f96e7afd6e3c5 /target
parent7f703716ae0e4cb4810eff37605b7594cef1edb8 (diff)
downloadupstream-8222f8e1b9bec804fc4e8b21c546cc602b2e1fa2.tar.gz
upstream-8222f8e1b9bec804fc4e8b21c546cc602b2e1fa2.tar.bz2
upstream-8222f8e1b9bec804fc4e8b21c546cc602b2e1fa2.zip
ath79: fix link mode support list on UniFi AC
This fixes incorrect supported link modes indicated when using ethtool on the Ubiquiti UniFi AC lite / LR / Mesh. eroot@OpenWrt:~# ethtool eth0 Settings for eth0: Supported ports: [ TP MII ] Supported link modes: 100baseT/Half 100baseT/Full 1000baseT/Full 1000baseX/Full The reason for this is, that since kernel 5.4 the PHY capabilities are read dynamically from the PHY. As Ubiquiti leaves the PHY in a wrong state, the capabilities of the SGMII side of the PHY are read. As a side effect, 10 Mbit/s link modes did not work on these boards. Signed-off-by: David Bauer <mail@david-bauer.net>
Diffstat (limited to 'target')
-rw-r--r--target/linux/generic/pending-5.10/736-net-phy-at803x-add-at8031-features.patch36
-rw-r--r--target/linux/generic/pending-5.4/736-net-phy-at803x-add-at8031-features.patch36
2 files changed, 72 insertions, 0 deletions
diff --git a/target/linux/generic/pending-5.10/736-net-phy-at803x-add-at8031-features.patch b/target/linux/generic/pending-5.10/736-net-phy-at803x-add-at8031-features.patch
new file mode 100644
index 0000000000..77d3946aae
--- /dev/null
+++ b/target/linux/generic/pending-5.10/736-net-phy-at803x-add-at8031-features.patch
@@ -0,0 +1,36 @@
+Add back explicit PHY feature flags for the AR8031 and
+AR8033 PHY instead of reading them from the PHY.
+
+The Botloader for Ubiquiti UniFi AC boards (and possibly more)
+leave fiber page selected, thus we will end up reading the PHY
+capabilities of the SGMII side (which does not offer 10 Mbit/s).
+
+We already have a hack in place, which switches back to the copper
+page, however this happens after capabilities are read.
+
+The original conversation about 735-net-phy-at803x-fix-at8033-sgmii-mode
+back in 2015 explicitly mention the UniFi AC Lite. The issue however is
+not missing autonegotiation on the Fiber side, but the fact the PHY
+is never switched to the copper side. So half of this patch is superfluous.
+
+A fix is currently being upstreamed. Once this is mainlined and available to us,
+these patches can be dropped:
+
+735-net-phy-at803x-fix-at8033-sgmii-mode.patch
+736-net-phy-at803x-add-at8031-features.patch
+
+This was tested on a UniFi AC Lite.
+
+See https://patchwork.kernel.org/project/netdevbpf/list/?series=467341
+
+--- a/drivers/net/phy/at803x.c
++++ b/drivers/net/phy/at803x.c
+@@ -1119,7 +1119,7 @@ static struct phy_driver at803x_driver[]
+ .get_wol = at803x_get_wol,
+ .suspend = at803x_suspend,
+ .resume = at803x_resume,
+- /* PHY_GBIT_FEATURES */
++ .features = PHY_GBIT_FEATURES,
+ .read_status = at803x_read_status,
+ .aneg_done = at803x_aneg_done,
+ .ack_interrupt = &at803x_ack_interrupt,
diff --git a/target/linux/generic/pending-5.4/736-net-phy-at803x-add-at8031-features.patch b/target/linux/generic/pending-5.4/736-net-phy-at803x-add-at8031-features.patch
new file mode 100644
index 0000000000..aa70f82823
--- /dev/null
+++ b/target/linux/generic/pending-5.4/736-net-phy-at803x-add-at8031-features.patch
@@ -0,0 +1,36 @@
+Add back explicit PHY feature flags for the AR8031 and
+AR8033 PHY instead of reading them from the PHY.
+
+The Botloader for Ubiquiti UniFi AC boards (and possibly more)
+leave fiber page selected, thus we will end up reading the PHY
+capabilities of the SGMII side (which does not offer 10 Mbit/s).
+
+We already have a hack in place, which switches back to the copper
+page, however this happens after capabilities are read.
+
+The original conversation about 735-net-phy-at803x-fix-at8033-sgmii-mode
+back in 2015 explicitly mention the UniFi AC Lite. The issue however is
+not missing autonegotiation on the Fiber side, but the fact the PHY
+is never switched to the copper side. So half of this patch is superfluous.
+
+A fix is currently being upstreamed. Once this is mainlined and available to us,
+these patches can be dropped:
+
+735-net-phy-at803x-fix-at8033-sgmii-mode.patch
+736-net-phy-at803x-add-at8031-features.patch
+
+This was tested on a UniFi AC Lite.
+
+See https://patchwork.kernel.org/project/netdevbpf/list/?series=467341
+
+--- a/drivers/net/phy/at803x.c
++++ b/drivers/net/phy/at803x.c
+@@ -490,7 +490,7 @@ static struct phy_driver at803x_driver[]
+ .get_wol = at803x_get_wol,
+ .suspend = at803x_suspend,
+ .resume = at803x_resume,
+- /* PHY_GBIT_FEATURES */
++ .features = PHY_GBIT_FEATURES,
+ .read_status = at803x_read_status,
+ .aneg_done = at803x_aneg_done,
+ .ack_interrupt = &at803x_ack_interrupt,