aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorNick Hainke <vincent@systemli.org>2022-04-18 15:04:25 +0200
committerDavid Bauer <mail@david-bauer.net>2022-04-29 00:27:58 +0200
commitd4053d2e8e098c53d6fc6ab860ba71cd8edf5455 (patch)
tree296d12407f131b2525160227e9deb9687a84ed04 /target/linux
parent5a117042442bbeb1712999a1eb1c677f72a77158 (diff)
downloadupstream-d4053d2e8e098c53d6fc6ab860ba71cd8edf5455.tar.gz
upstream-d4053d2e8e098c53d6fc6ab860ba71cd8edf5455.tar.bz2
upstream-d4053d2e8e098c53d6fc6ab860ba71cd8edf5455.zip
ipq40xx: 5.10: fix ar40xx driver
This commit is completely based on the work of adron-s: https://github.com/openwrt/openwrt/pull/4721#issuecomment-1101108651 The commit fixes the data corruption on TX packets. Packets are transmitted, but their contents are replaced with zeros. This error is caused by the lack of guard (50 ms) intervals between calibration phases. This error is treated by adding mdelay(50) to the calibration function code. In the original qca-ssda code [0], these mdelays were existing, but in the ar41xx.c they are gone. Tested on: - Fritz!Box 4040 - Fritz!Box 7530 - Mikrotik SXTsq 5AC - ZyXEL NBG6617 - [0] https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-ssdk/-/blob/NHSS.QSDK.11.4/src/init/ssdk_init.c#L2072 Suggested-by: Serhii Serhieiev <adron@mstnt.com> Reviewed-by: Robert Marko <robimarko@gmail.com> Signed-off-by: Nick Hainke <vincent@systemli.org> (cherry picked from commit ab7e53e5cce703c7a62efbe1d41fb94c2228a178)
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ipq40xx/files-5.10/drivers/net/mdio/ar40xx.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/target/linux/ipq40xx/files-5.10/drivers/net/mdio/ar40xx.c b/target/linux/ipq40xx/files-5.10/drivers/net/mdio/ar40xx.c
index f7ce42b9ff..d5ef7af151 100644
--- a/target/linux/ipq40xx/files-5.10/drivers/net/mdio/ar40xx.c
+++ b/target/linux/ipq40xx/files-5.10/drivers/net/mdio/ar40xx.c
@@ -936,6 +936,7 @@ ar40xx_malibu_psgmii_ess_reset(struct ar40xx_priv *priv)
*/
mdelay(2);
}
+ mdelay(50);
/*check malibu psgmii calibration done end..*/
@@ -954,6 +955,7 @@ ar40xx_malibu_psgmii_ess_reset(struct ar40xx_priv *priv)
/* Polling interval to check PSGMII PLL in ESS is ready */
mdelay(2);
}
+ mdelay(50);
/* check dakota psgmii calibration done end..*/
@@ -961,6 +963,7 @@ ar40xx_malibu_psgmii_ess_reset(struct ar40xx_priv *priv)
mdiobus_write(bus, 5, 0x1a, 0x3230);
/* release phy psgmii RX 20bit */
mdiobus_write(bus, 5, 0x0, 0x005f);
+ mdelay(200);
}
static void