From b506b2ae67a55a30a8e33462e41fccb4e0146fa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=B7=E9=AB=85=E5=A4=B4?= <74764072+DHDAXCW@users.noreply.github.com> Date: Sat, 16 Jul 2022 17:28:21 +0800 Subject: [PATCH] rockchip: fix rk3399 pppoe error in kernel 5.18 --- .../patches-5.18/801-fix-stmmac_mdio.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 target/linux/rockchip/patches-5.18/801-fix-stmmac_mdio.patch diff --git a/target/linux/rockchip/patches-5.18/801-fix-stmmac_mdio.patch b/target/linux/rockchip/patches-5.18/801-fix-stmmac_mdio.patch new file mode 100644 index 00000000000000..328b1af9eb9cc4 --- /dev/null +++ b/target/linux/rockchip/patches-5.18/801-fix-stmmac_mdio.patch @@ -0,0 +1,24 @@ ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +@@ -498,6 +498,11 @@ int stmmac_mdio_register(struct net_devi + if (priv->plat->has_xgmac) + stmmac_xgmac2_mdio_read(new_bus, 0, MII_ADDR_C45); + ++ stmmac_mdio_write(new_bus,0,31,2627); ++ stmmac_mdio_write(new_bus,0,25,0x1801); ++ stmmac_mdio_write(new_bus,0,31,0); ++ stmmac_mdio_write(new_bus,0,0,0x8000); ++ + if (priv->plat->phy_node || mdio_node) + goto bus_register_done; + +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +@@ -2907,6 +2907,8 @@ static int stmmac_init_dma_engine(struct + if (priv->extend_desc && (priv->mode == STMMAC_RING_MODE)) + atds = 1; + ++ msleep(1500); ++ + ret = stmmac_reset(priv, priv->ioaddr); + if (ret) { + dev_err(priv->device, "Failed to reset the dma\n");