mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2024-11-27 23:34:30 +00:00
dceb5938f8
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.29 Removed upstreamed: generic/backport-6.6/740-v6.9-01-netfilter-flowtable-validate-pppoe-header.patch[1] generic/backport-6.6/740-v6.9-02-netfilter-flowtable-incorrect-pppoe-tuple.patch[2] generic/backport-6.6/790-29-v6.9-net-dsa-mt7530-fix-improper-frames-on-all-25MHz-and-.patch[3] generic/backport-6.6/790-31-v6.10-net-dsa-mt7530-fix-enabling-EEE-on-MT7531-switch-on-.patch[4] generic/backport-6.6/790-34-v6.10-net-dsa-mt7530-fix-mirroring-frames-received-on-loca.patch[5] generic/backport-6.6/790-35-v6.10-net-dsa-mt7530-fix-port-mirroring-for-MT7988-SoC-swi.patch[6] mediatek/patches-6.6/963-net-ethernet-mtk_eth_soc-fix-WED-wifi-reset.patch[7] Manually rebased: generic/backport-6.6/790-23-v6.9-net-dsa-mt7530-get-rid-of-priv-info-cpu_port_config.patch All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.29&id=a2471d271042ea18e8a6babc132a8716bb2f08b9 2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.29&id=4ed82dd368ad883dc4284292937b882f044e625d 3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.29&id=21b9d89d93422221cdda1b82fd075fa3c94a11d9 4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.29&id=bd41ee1efd478852a0882ce5f136bc2b5e83eff2 5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.29&id=d1be3960539249a8690ed09a29d0e3bf34189dd2 6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.29&id=f8de1b6208bf71bd3102548d33dd8475573ad2ea 7. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.29&id=6855f724f19620c3ddff57c349e0abba797475b1 Build system: x86/64 Build-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Run-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Signed-off-by: John Audia <therealgraysky@proton.me>
235 lines
7.4 KiB
Diff
235 lines
7.4 KiB
Diff
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
|
Date: Mon, 18 Sep 2023 12:29:06 +0200
|
|
Subject: [PATCH] net: ethernet: mtk_wed: do not configure rx offload if not
|
|
supported
|
|
|
|
Check if rx offload is supported running mtk_wed_get_rx_capa routine
|
|
before configuring it. This is a preliminary patch to introduce Wireless
|
|
Ethernet Dispatcher (WED) support for MT7988 SoC.
|
|
|
|
Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
|
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
|
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
|
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|
---
|
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
|
@@ -606,7 +606,7 @@ mtk_wed_stop(struct mtk_wed_device *dev)
|
|
wdma_w32(dev, MTK_WDMA_INT_MASK, 0);
|
|
wdma_w32(dev, MTK_WDMA_INT_GRP2, 0);
|
|
|
|
- if (mtk_wed_is_v1(dev->hw))
|
|
+ if (!mtk_wed_get_rx_capa(dev))
|
|
return;
|
|
|
|
wed_w32(dev, MTK_WED_EXT_INT_MASK1, 0);
|
|
@@ -732,16 +732,21 @@ mtk_wed_set_wpdma(struct mtk_wed_device
|
|
{
|
|
if (mtk_wed_is_v1(dev->hw)) {
|
|
wed_w32(dev, MTK_WED_WPDMA_CFG_BASE, dev->wlan.wpdma_phys);
|
|
- } else {
|
|
- mtk_wed_bus_init(dev);
|
|
-
|
|
- wed_w32(dev, MTK_WED_WPDMA_CFG_BASE, dev->wlan.wpdma_int);
|
|
- wed_w32(dev, MTK_WED_WPDMA_CFG_INT_MASK, dev->wlan.wpdma_mask);
|
|
- wed_w32(dev, MTK_WED_WPDMA_CFG_TX, dev->wlan.wpdma_tx);
|
|
- wed_w32(dev, MTK_WED_WPDMA_CFG_TX_FREE, dev->wlan.wpdma_txfree);
|
|
- wed_w32(dev, MTK_WED_WPDMA_RX_GLO_CFG, dev->wlan.wpdma_rx_glo);
|
|
- wed_w32(dev, MTK_WED_WPDMA_RX_RING, dev->wlan.wpdma_rx);
|
|
+ return;
|
|
}
|
|
+
|
|
+ mtk_wed_bus_init(dev);
|
|
+
|
|
+ wed_w32(dev, MTK_WED_WPDMA_CFG_BASE, dev->wlan.wpdma_int);
|
|
+ wed_w32(dev, MTK_WED_WPDMA_CFG_INT_MASK, dev->wlan.wpdma_mask);
|
|
+ wed_w32(dev, MTK_WED_WPDMA_CFG_TX, dev->wlan.wpdma_tx);
|
|
+ wed_w32(dev, MTK_WED_WPDMA_CFG_TX_FREE, dev->wlan.wpdma_txfree);
|
|
+
|
|
+ if (!mtk_wed_get_rx_capa(dev))
|
|
+ return;
|
|
+
|
|
+ wed_w32(dev, MTK_WED_WPDMA_RX_GLO_CFG, dev->wlan.wpdma_rx_glo);
|
|
+ wed_w32(dev, MTK_WED_WPDMA_RX_RING, dev->wlan.wpdma_rx);
|
|
}
|
|
|
|
static void
|
|
@@ -973,15 +978,17 @@ mtk_wed_hw_init(struct mtk_wed_device *d
|
|
MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
|
|
} else {
|
|
wed_clr(dev, MTK_WED_TX_TKID_CTRL, MTK_WED_TX_TKID_CTRL_PAUSE);
|
|
- /* rx hw init */
|
|
- wed_w32(dev, MTK_WED_WPDMA_RX_D_RST_IDX,
|
|
- MTK_WED_WPDMA_RX_D_RST_CRX_IDX |
|
|
- MTK_WED_WPDMA_RX_D_RST_DRV_IDX);
|
|
- wed_w32(dev, MTK_WED_WPDMA_RX_D_RST_IDX, 0);
|
|
-
|
|
- mtk_wed_rx_buffer_hw_init(dev);
|
|
- mtk_wed_rro_hw_init(dev);
|
|
- mtk_wed_route_qm_hw_init(dev);
|
|
+ if (mtk_wed_get_rx_capa(dev)) {
|
|
+ /* rx hw init */
|
|
+ wed_w32(dev, MTK_WED_WPDMA_RX_D_RST_IDX,
|
|
+ MTK_WED_WPDMA_RX_D_RST_CRX_IDX |
|
|
+ MTK_WED_WPDMA_RX_D_RST_DRV_IDX);
|
|
+ wed_w32(dev, MTK_WED_WPDMA_RX_D_RST_IDX, 0);
|
|
+
|
|
+ mtk_wed_rx_buffer_hw_init(dev);
|
|
+ mtk_wed_rro_hw_init(dev);
|
|
+ mtk_wed_route_qm_hw_init(dev);
|
|
+ }
|
|
}
|
|
|
|
wed_clr(dev, MTK_WED_TX_BM_CTRL, MTK_WED_TX_BM_CTRL_PAUSE);
|
|
@@ -1353,8 +1360,6 @@ mtk_wed_configure_irq(struct mtk_wed_dev
|
|
|
|
wed_clr(dev, MTK_WED_WDMA_INT_CTRL, wdma_mask);
|
|
} else {
|
|
- wdma_mask |= FIELD_PREP(MTK_WDMA_INT_MASK_TX_DONE,
|
|
- GENMASK(1, 0));
|
|
/* initail tx interrupt trigger */
|
|
wed_w32(dev, MTK_WED_WPDMA_INT_CTRL_TX,
|
|
MTK_WED_WPDMA_INT_CTRL_TX0_DONE_EN |
|
|
@@ -1373,15 +1378,20 @@ mtk_wed_configure_irq(struct mtk_wed_dev
|
|
FIELD_PREP(MTK_WED_WPDMA_INT_CTRL_TX_FREE_DONE_TRIG,
|
|
dev->wlan.txfree_tbit));
|
|
|
|
- wed_w32(dev, MTK_WED_WPDMA_INT_CTRL_RX,
|
|
- MTK_WED_WPDMA_INT_CTRL_RX0_EN |
|
|
- MTK_WED_WPDMA_INT_CTRL_RX0_CLR |
|
|
- MTK_WED_WPDMA_INT_CTRL_RX1_EN |
|
|
- MTK_WED_WPDMA_INT_CTRL_RX1_CLR |
|
|
- FIELD_PREP(MTK_WED_WPDMA_INT_CTRL_RX0_DONE_TRIG,
|
|
- dev->wlan.rx_tbit[0]) |
|
|
- FIELD_PREP(MTK_WED_WPDMA_INT_CTRL_RX1_DONE_TRIG,
|
|
- dev->wlan.rx_tbit[1]));
|
|
+ if (mtk_wed_get_rx_capa(dev)) {
|
|
+ wed_w32(dev, MTK_WED_WPDMA_INT_CTRL_RX,
|
|
+ MTK_WED_WPDMA_INT_CTRL_RX0_EN |
|
|
+ MTK_WED_WPDMA_INT_CTRL_RX0_CLR |
|
|
+ MTK_WED_WPDMA_INT_CTRL_RX1_EN |
|
|
+ MTK_WED_WPDMA_INT_CTRL_RX1_CLR |
|
|
+ FIELD_PREP(MTK_WED_WPDMA_INT_CTRL_RX0_DONE_TRIG,
|
|
+ dev->wlan.rx_tbit[0]) |
|
|
+ FIELD_PREP(MTK_WED_WPDMA_INT_CTRL_RX1_DONE_TRIG,
|
|
+ dev->wlan.rx_tbit[1]));
|
|
+
|
|
+ wdma_mask |= FIELD_PREP(MTK_WDMA_INT_MASK_TX_DONE,
|
|
+ GENMASK(1, 0));
|
|
+ }
|
|
|
|
wed_w32(dev, MTK_WED_WDMA_INT_CLR, wdma_mask);
|
|
wed_set(dev, MTK_WED_WDMA_INT_CTRL,
|
|
@@ -1400,6 +1410,8 @@ mtk_wed_configure_irq(struct mtk_wed_dev
|
|
static void
|
|
mtk_wed_dma_enable(struct mtk_wed_device *dev)
|
|
{
|
|
+ int i;
|
|
+
|
|
wed_set(dev, MTK_WED_WPDMA_INT_CTRL, MTK_WED_WPDMA_INT_CTRL_SUBRT_ADV);
|
|
|
|
wed_set(dev, MTK_WED_GLO_CFG,
|
|
@@ -1419,33 +1431,33 @@ mtk_wed_dma_enable(struct mtk_wed_device
|
|
if (mtk_wed_is_v1(dev->hw)) {
|
|
wdma_set(dev, MTK_WDMA_GLO_CFG,
|
|
MTK_WDMA_GLO_CFG_RX_INFO3_PRERES);
|
|
- } else {
|
|
- int i;
|
|
+ return;
|
|
+ }
|
|
|
|
- wed_set(dev, MTK_WED_WPDMA_CTRL,
|
|
- MTK_WED_WPDMA_CTRL_SDL1_FIXED);
|
|
+ wed_set(dev, MTK_WED_WPDMA_CTRL,
|
|
+ MTK_WED_WPDMA_CTRL_SDL1_FIXED);
|
|
+ wed_set(dev, MTK_WED_WPDMA_GLO_CFG,
|
|
+ MTK_WED_WPDMA_GLO_CFG_RX_DRV_R0_PKT_PROC |
|
|
+ MTK_WED_WPDMA_GLO_CFG_RX_DRV_R0_CRX_SYNC);
|
|
+ wed_clr(dev, MTK_WED_WPDMA_GLO_CFG,
|
|
+ MTK_WED_WPDMA_GLO_CFG_TX_TKID_KEEP |
|
|
+ MTK_WED_WPDMA_GLO_CFG_TX_DMAD_DW3_PREV);
|
|
|
|
- wed_set(dev, MTK_WED_WDMA_GLO_CFG,
|
|
- MTK_WED_WDMA_GLO_CFG_TX_DRV_EN |
|
|
- MTK_WED_WDMA_GLO_CFG_TX_DDONE_CHK);
|
|
+ if (!mtk_wed_get_rx_capa(dev))
|
|
+ return;
|
|
|
|
- wed_set(dev, MTK_WED_WPDMA_GLO_CFG,
|
|
- MTK_WED_WPDMA_GLO_CFG_RX_DRV_R0_PKT_PROC |
|
|
- MTK_WED_WPDMA_GLO_CFG_RX_DRV_R0_CRX_SYNC);
|
|
-
|
|
- wed_clr(dev, MTK_WED_WPDMA_GLO_CFG,
|
|
- MTK_WED_WPDMA_GLO_CFG_TX_TKID_KEEP |
|
|
- MTK_WED_WPDMA_GLO_CFG_TX_DMAD_DW3_PREV);
|
|
+ wed_set(dev, MTK_WED_WDMA_GLO_CFG,
|
|
+ MTK_WED_WDMA_GLO_CFG_TX_DRV_EN |
|
|
+ MTK_WED_WDMA_GLO_CFG_TX_DDONE_CHK);
|
|
|
|
- wed_set(dev, MTK_WED_WPDMA_RX_D_GLO_CFG,
|
|
- MTK_WED_WPDMA_RX_D_RX_DRV_EN |
|
|
- FIELD_PREP(MTK_WED_WPDMA_RX_D_RXD_READ_LEN, 0x18) |
|
|
- FIELD_PREP(MTK_WED_WPDMA_RX_D_INIT_PHASE_RXEN_SEL,
|
|
- 0x2));
|
|
+ wed_set(dev, MTK_WED_WPDMA_RX_D_GLO_CFG,
|
|
+ MTK_WED_WPDMA_RX_D_RX_DRV_EN |
|
|
+ FIELD_PREP(MTK_WED_WPDMA_RX_D_RXD_READ_LEN, 0x18) |
|
|
+ FIELD_PREP(MTK_WED_WPDMA_RX_D_INIT_PHASE_RXEN_SEL,
|
|
+ 0x2));
|
|
|
|
- for (i = 0; i < MTK_WED_RX_QUEUES; i++)
|
|
- mtk_wed_check_wfdma_rx_fill(dev, i);
|
|
- }
|
|
+ for (i = 0; i < MTK_WED_RX_QUEUES; i++)
|
|
+ mtk_wed_check_wfdma_rx_fill(dev, i);
|
|
}
|
|
|
|
static void
|
|
@@ -1472,7 +1484,7 @@ mtk_wed_start(struct mtk_wed_device *dev
|
|
|
|
val |= BIT(0) | (BIT(1) * !!dev->hw->index);
|
|
regmap_write(dev->hw->mirror, dev->hw->index * 4, val);
|
|
- } else {
|
|
+ } else if (mtk_wed_get_rx_capa(dev)) {
|
|
/* driver set mid ready and only once */
|
|
wed_w32(dev, MTK_WED_EXT_INT_MASK1,
|
|
MTK_WED_EXT_INT_STATUS_WPDMA_MID_RDY);
|
|
@@ -1484,7 +1496,6 @@ mtk_wed_start(struct mtk_wed_device *dev
|
|
|
|
if (mtk_wed_rro_cfg(dev))
|
|
return;
|
|
-
|
|
}
|
|
|
|
mtk_wed_set_512_support(dev, dev->wlan.wcid_512);
|
|
@@ -1550,13 +1561,14 @@ mtk_wed_attach(struct mtk_wed_device *de
|
|
}
|
|
|
|
mtk_wed_hw_init_early(dev);
|
|
- if (mtk_wed_is_v1(hw)) {
|
|
+ if (mtk_wed_is_v1(hw))
|
|
regmap_update_bits(hw->hifsys, HIFSYS_DMA_AG_MAP,
|
|
BIT(hw->index), 0);
|
|
- } else {
|
|
+ else
|
|
dev->rev_id = wed_r32(dev, MTK_WED_REV_ID);
|
|
+
|
|
+ if (mtk_wed_get_rx_capa(dev))
|
|
ret = mtk_wed_wo_init(hw);
|
|
- }
|
|
out:
|
|
if (ret) {
|
|
dev_err(dev->hw->dev, "failed to attach wed device\n");
|
|
--- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
|
|
@@ -207,7 +207,7 @@ int mtk_wed_mcu_msg_update(struct mtk_we
|
|
{
|
|
struct mtk_wed_wo *wo = dev->hw->wed_wo;
|
|
|
|
- if (mtk_wed_is_v1(dev->hw))
|
|
+ if (!mtk_wed_get_rx_capa(dev))
|
|
return 0;
|
|
|
|
if (WARN_ON(!wo))
|