]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: mediatek: fix usability with wget command
authorWeijie Gao <weijie.gao@mediatek.com>
Tue, 17 Dec 2024 08:40:03 +0000 (16:40 +0800)
committerTom Rini <trini@konsulko.com>
Tue, 31 Dec 2024 16:58:52 +0000 (10:58 -0600)
The wget command currently cannot work correctly with mtk_eth driver.
This patch fixed this by increase DMA ring size and invalidate ring data
after use.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
drivers/net/mtk_eth.c

index 888e8c1e855075d9b517dfb8e0616514d52bba04..454caa3cd3ae025147dd3bdd436d6f5e48c16ade 100644 (file)
@@ -29,8 +29,8 @@
 
 #include "mtk_eth.h"
 
-#define NUM_TX_DESC            24
-#define NUM_RX_DESC            24
+#define NUM_TX_DESC            32
+#define NUM_RX_DESC            32
 #define TX_TOTAL_BUF_SIZE      (NUM_TX_DESC * PKTSIZE_ALIGN)
 #define RX_TOTAL_BUF_SIZE      (NUM_RX_DESC * PKTSIZE_ALIGN)
 #define TOTAL_PKT_BUF_SIZE     (TX_TOTAL_BUF_SIZE + RX_TOTAL_BUF_SIZE)
@@ -1897,6 +1897,9 @@ static int mtk_eth_free_pkt(struct udevice *dev, uchar *packet, int length)
 
        rxd = priv->rx_ring_noc + idx * priv->soc->rxd_size;
 
+       invalidate_dcache_range((ulong)rxd->rxd1,
+                               (ulong)rxd->rxd1 + PKTSIZE_ALIGN);
+
        if (MTK_HAS_CAPS(priv->soc->caps, MTK_NETSYS_V2) ||
            MTK_HAS_CAPS(priv->soc->caps, MTK_NETSYS_V3))
                rxd->rxd2 = PDMA_V2_RXD2_PLEN0_SET(PKTSIZE_ALIGN);