mirror of
https://github.com/openwrt/openwrt.git
synced 2026-11-28 20:54:37 +04:00
kernel: mtk_wed: bypass the RROQM when hw_rro is used
With hw_rro on WED v3, the WLAN chip reorders RX frames, and WED takes them from the RRO rings into the RRO ingress of the route QM. The RROQM, whose MIOD and feedback rings serve the WO firmware, and the legacy ingress of the route QM (IGRS1) are still configured as for WED v2. Add pending patch 794, based on the MediaTek SDK patch "add wedv3 support RROQM bypass WO", which sets the RROQM bypass and forces the destination of IGRS1. Apply it only when hw_rro is used: without hw_rro, for example with mt7915 on WED v3, RX reordering still goes through the WO firmware and the RROQM. Refresh 797-01, 797-02, 798 and 799, whose hunks the patch shifts. Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
1 parent
7bc917532c
commit
ab2006029b
5 files changed
+66
-7
No files matched your search
+59
@@ -0,0 +1,59 @@
|
||||
From: Rex Lu <rex.lu@mediatek.com>
|
||||
Date: Wed, 11 Mar 2026 14:52:49 +0800
|
||||
Subject: [PATCH] net: ethernet: mtk_wed: bypass the RROQM when hw_rro is used
|
||||
|
||||
With hw_rro on WED v3, the WLAN chip reorders RX frames, and WED takes
|
||||
them from the RRO rings into the RRO ingress of the route QM. The RROQM,
|
||||
whose MIOD and feedback rings serve the WO firmware, and the legacy
|
||||
ingress of the route QM (IGRS1) are still configured as for WED v2. The
|
||||
MediaTek SDK sets the RROQM bypass and forces the destination of IGRS1
|
||||
in this mode.
|
||||
|
||||
Do the same when hw_rro is used. Without hw_rro, for example with
|
||||
mt7915 on WED v3, RX reordering still goes through the WO firmware and
|
||||
the RROQM, so keep the configuration there.
|
||||
|
||||
Signed-off-by: Rex Lu <rex.lu@mediatek.com>
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||
@@ -1406,6 +1406,8 @@ mtk_wed_rro_hw_init(struct mtk_wed_devic
|
||||
|
||||
wed_w32(dev, MTK_WED_RROQM_RST_IDX, 0);
|
||||
wed_w32(dev, MTK_WED_RROQM_MIOD_CTRL2, MTK_WED_MIOD_CNT - 1);
|
||||
+ if (dev->wlan.hw_rro)
|
||||
+ wed_set(dev, MTK_WED_RROQM_GLO_CFG, MTK_WED_RROQM_GLO_CFG_BYPASS);
|
||||
wed_set(dev, MTK_WED_CTRL, MTK_WED_CTRL_RX_RRO_QM_EN);
|
||||
}
|
||||
|
||||
@@ -1433,6 +1435,10 @@ mtk_wed_route_qm_hw_init(struct mtk_wed_
|
||||
FIELD_PREP(MTK_WED_RTQM_ENQ_CFG_TXDMAD_FPORT,
|
||||
0x3 + dev->hw->index));
|
||||
}
|
||||
+
|
||||
+ if (dev->wlan.hw_rro)
|
||||
+ wed_set(dev, MTK_WED_RTQM_IGRS1_CFG0,
|
||||
+ FIELD_PREP(MTK_WED_RTQM_IGRS1_CFG0_DEST_FORCE, 0x2));
|
||||
/* enable RX_ROUTE_QM */
|
||||
wed_set(dev, MTK_WED_CTRL, MTK_WED_CTRL_RX_ROUTE_QM_EN);
|
||||
}
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_wed_regs.h
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_wed_regs.h
|
||||
@@ -529,6 +529,8 @@ struct mtk_wdma_desc {
|
||||
#define MTK_WED_RTQM_IGRS0_I2H_PKT_CNT(_n) (0xb2c + (_n) * 0x4)
|
||||
#define MTK_WED_RTQM_IGRS0_FDROP_CNT 0xb34
|
||||
|
||||
+#define MTK_WED_RTQM_IGRS1_CFG0 0xb3c
|
||||
+#define MTK_WED_RTQM_IGRS1_CFG0_DEST_FORCE GENMASK(2, 0)
|
||||
#define MTK_WED_RTQM_IGRS1_I2HW_DMAD_CNT 0xb44
|
||||
#define MTK_WED_RTQM_IGRS1_I2H_DMAD_CNT(_n) (0xb48 + (_n) * 0x4)
|
||||
#define MTK_WED_RTQM_IGRS1_I2HW_PKT_CNT 0xb50
|
||||
@@ -574,6 +576,7 @@ struct mtk_wdma_desc {
|
||||
#define MTK_WED_RTQM_DEQ_ERR_CNT 0xbec
|
||||
|
||||
#define MTK_WED_RROQM_GLO_CFG 0xc04
|
||||
+#define MTK_WED_RROQM_GLO_CFG_BYPASS BIT(24)
|
||||
#define MTK_WED_RROQM_RST_IDX 0xc08
|
||||
#define MTK_WED_RROQM_RST_IDX_MIOD BIT(0)
|
||||
#define MTK_WED_RROQM_RST_IDX_FDBK BIT(4)
|
||||
+3
-3
@@ -667,7 +667,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
static void
|
||||
mtk_wed_detach(struct mtk_wed_device *dev)
|
||||
{
|
||||
@@ -1965,7 +1991,7 @@ mtk_wed_wdma_tx_ring_setup(struct mtk_we
|
||||
@@ -1971,7 +1997,7 @@ mtk_wed_wdma_tx_ring_setup(struct mtk_we
|
||||
|
||||
static void
|
||||
mtk_wed_ppe_check(struct mtk_wed_device *dev, struct sk_buff *skb,
|
||||
@@ -676,7 +676,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
{
|
||||
struct mtk_eth *eth = dev->hw->eth;
|
||||
struct ethhdr *eh;
|
||||
@@ -1979,7 +2005,22 @@ mtk_wed_ppe_check(struct mtk_wed_device
|
||||
@@ -1985,7 +2011,22 @@ mtk_wed_ppe_check(struct mtk_wed_device
|
||||
skb_set_mac_header(skb, 0);
|
||||
eh = eth_hdr(skb);
|
||||
skb->protocol = eh->h_proto;
|
||||
@@ -700,7 +700,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2819,6 +2860,7 @@ void mtk_wed_add_hw(struct device_node *
|
||||
@@ -2825,6 +2866,7 @@ void mtk_wed_add_hw(struct device_node *
|
||||
.rro_rx_ring_setup = mtk_wed_rro_rx_ring_setup,
|
||||
.msdu_pg_rx_ring_setup = mtk_wed_msdu_pg_rx_ring_setup,
|
||||
.ind_rx_ring_setup = mtk_wed_ind_rx_ring_setup,
|
||||
|
||||
+2
-2
@@ -131,7 +131,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
{
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||
@@ -2023,6 +2023,21 @@ mtk_wed_flow_flush(struct mtk_wed_device
|
||||
@@ -2029,6 +2029,21 @@ mtk_wed_flow_flush(struct mtk_wed_device
|
||||
mtk_flow_offload_unbind_wcid(dev->hw->eth, dev->hw->index, wcid, &m);
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
static void
|
||||
mtk_wed_configure_irq(struct mtk_wed_device *dev, u32 irq_mask)
|
||||
{
|
||||
@@ -2861,6 +2876,7 @@ void mtk_wed_add_hw(struct device_node *
|
||||
@@ -2867,6 +2882,7 @@ void mtk_wed_add_hw(struct device_node *
|
||||
.msdu_pg_rx_ring_setup = mtk_wed_msdu_pg_rx_ring_setup,
|
||||
.ind_rx_ring_setup = mtk_wed_ind_rx_ring_setup,
|
||||
.flow_flush = mtk_wed_flow_flush,
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
||||
@@ -1749,7 +1749,6 @@ mtk_wed_rx_reset(struct mtk_wed_device *
|
||||
@@ -1755,7 +1755,6 @@ mtk_wed_rx_reset(struct mtk_wed_device *
|
||||
false);
|
||||
}
|
||||
mtk_wed_free_rx_buffer(dev);
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
mtk_eth_set_dma_device(hw->eth, hw->eth->dev);
|
||||
|
||||
memset(dev, 0, sizeof(*dev));
|
||||
@@ -2476,7 +2487,7 @@ mtk_wed_attach(struct mtk_wed_device *de
|
||||
@@ -2482,7 +2493,7 @@ mtk_wed_attach(struct mtk_wed_device *de
|
||||
"mtk_wed_attach without holding the RCU read lock");
|
||||
|
||||
if ((dev->wlan.bus_type == MTK_WED_BUS_PCIE &&
|
||||
|
||||
Reference in new issue
Block a user