forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generic: 6.6: mtk_eth_soc: increase QDMA RESV_BUF size
Increase QDMA RESV_BUF from 2K to 3K for netsys v2 to match Mediatek SDK. This helps reduce the possibility of Ethernet transmit timeouts. Link: https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/19d8456c3051e5f6dabf42fa770916a2126ea4bf Signed-off-by: Daniel Golle <daniel@makrotopia.org>
- Loading branch information
Showing
2 changed files
with
71 additions
and
27 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
target/linux/generic/pending-6.6/734-net-ethernet-mediatek-enlarge-DMA-reserve-buffer.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
From: Chad Monroe <chad@monroe.io> | ||
Date: Mon, 16 Sep 2024 19:29:03 -0700 | ||
Subject: [PATCH] net: ethernet: mediatek: increase QDMA RESV_BUF size | ||
|
||
Increase QDMA RESV_BUF from 2K to 3K for netsys v2 to match Mediatek SDK[1]. | ||
This helps reduce the possibility of Ethernet transmit timeouts. | ||
|
||
[1]: https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/19d8456c3051e5f6dabf42fa770916a2126ea4bf | ||
|
||
Signed-off-by: Chad Monroe <chad@monroe.io> | ||
--- | ||
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 6 ++++-- | ||
drivers/net/ethernet/mediatek/mtk_eth_soc.h | 1 + | ||
2 files changed, 5 insertions(+), 2 deletions(-) | ||
|
||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h | ||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h | ||
@@ -271,6 +271,7 @@ | ||
#define MTK_WCOMP_EN BIT(24) | ||
#define MTK_RESV_BUF (0x80 << 16) | ||
#define MTK_MUTLI_CNT (0x4 << 12) | ||
+#define MTK_RESV_BUF_MASK (0xff << 16) | ||
#define MTK_LEAKY_BUCKET_EN BIT(11) | ||
|
||
/* QDMA Flow Control Register */ | ||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c | ||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c | ||
@@ -3309,12 +3309,14 @@ static int mtk_start_dma(struct mtk_eth | ||
MTK_TX_BT_32DWORDS | MTK_NDP_CO_PRO | | ||
MTK_RX_2B_OFFSET | MTK_TX_WB_DDONE; | ||
|
||
- if (mtk_is_netsys_v2_or_greater(eth)) | ||
+ if (mtk_is_netsys_v2_or_greater(eth)) { | ||
+ val &= ~MTK_RESV_BUF_MASK; | ||
val |= MTK_MUTLI_CNT | MTK_RESV_BUF | | ||
MTK_WCOMP_EN | MTK_DMAD_WR_WDONE | | ||
MTK_CHK_DDONE_EN | MTK_LEAKY_BUCKET_EN; | ||
- else | ||
+ } else { | ||
val |= MTK_RX_BT_32DWORDS; | ||
+ } | ||
mtk_w32(eth, val, reg_map->qdma.glo_cfg); | ||
|
||
mtk_w32(eth, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters