|
|
@@ -114,7 +114,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
|
|
|
/* unmap dma */
|
|
|
mtk_tx_unmap(eth, tx_buf, NULL, false);
|
|
|
-@@ -1715,7 +1720,7 @@ static struct mtk_rx_ring *mtk_get_rx_ri
|
|
|
+@@ -1723,7 +1728,7 @@ static struct mtk_rx_ring *mtk_get_rx_ri
|
|
|
|
|
|
ring = ð->rx_ring[i];
|
|
|
idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size);
|
|
|
@@ -123,7 +123,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
if (rxd->rxd2 & RX_DMA_DONE) {
|
|
|
ring->calc_idx_update = true;
|
|
|
return ring;
|
|
|
-@@ -1883,7 +1888,7 @@ static int mtk_xdp_submit_frame(struct m
|
|
|
+@@ -1891,7 +1896,7 @@ static int mtk_xdp_submit_frame(struct m
|
|
|
}
|
|
|
htxd = txd;
|
|
|
|
|
|
@@ -132,7 +132,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
memset(tx_buf, 0, sizeof(*tx_buf));
|
|
|
htx_buf = tx_buf;
|
|
|
|
|
|
-@@ -1902,7 +1907,7 @@ static int mtk_xdp_submit_frame(struct m
|
|
|
+@@ -1910,7 +1915,7 @@ static int mtk_xdp_submit_frame(struct m
|
|
|
goto unmap;
|
|
|
|
|
|
tx_buf = mtk_desc_to_tx_buf(ring, txd,
|
|
|
@@ -141,7 +141,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
memset(tx_buf, 0, sizeof(*tx_buf));
|
|
|
n_desc++;
|
|
|
}
|
|
|
-@@ -1940,7 +1945,7 @@ static int mtk_xdp_submit_frame(struct m
|
|
|
+@@ -1948,7 +1953,7 @@ static int mtk_xdp_submit_frame(struct m
|
|
|
} else {
|
|
|
int idx;
|
|
|
|
|
|
@@ -150,7 +150,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
mtk_w32(eth, NEXT_DESP_IDX(idx, ring->dma_size),
|
|
|
MT7628_TX_CTX_IDX0);
|
|
|
}
|
|
|
-@@ -1951,7 +1956,7 @@ static int mtk_xdp_submit_frame(struct m
|
|
|
+@@ -1959,7 +1964,7 @@ static int mtk_xdp_submit_frame(struct m
|
|
|
|
|
|
unmap:
|
|
|
while (htxd != txd) {
|
|
|
@@ -159,7 +159,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
mtk_tx_unmap(eth, tx_buf, NULL, false);
|
|
|
|
|
|
htxd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU;
|
|
|
-@@ -2083,7 +2088,7 @@ static int mtk_poll_rx(struct napi_struc
|
|
|
+@@ -2091,7 +2096,7 @@ static int mtk_poll_rx(struct napi_struc
|
|
|
goto rx_done;
|
|
|
|
|
|
idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size);
|
|
|
@@ -168,7 +168,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
data = ring->data[idx];
|
|
|
|
|
|
if (!mtk_rx_get_desc(eth, &trxd, rxd))
|
|
|
-@@ -2347,7 +2352,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
|
|
+@@ -2355,7 +2360,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
|
|
|
break;
|
|
|
|
|
|
tx_buf = mtk_desc_to_tx_buf(ring, desc,
|
|
|
@@ -177,7 +177,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
if (!tx_buf->data)
|
|
|
break;
|
|
|
|
|
|
-@@ -2398,7 +2403,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
|
|
|
+@@ -2406,7 +2411,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
|
|
|
}
|
|
|
mtk_tx_unmap(eth, tx_buf, &bq, true);
|
|
|
|
|
|
@@ -186,7 +186,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
ring->last_free = desc;
|
|
|
atomic_inc(&ring->free_count);
|
|
|
|
|
|
-@@ -2516,7 +2521,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
|
|
+@@ -2524,7 +2529,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
|
|
{
|
|
|
const struct mtk_soc_data *soc = eth->soc;
|
|
|
struct mtk_tx_ring *ring = ð->tx_ring;
|
|
|
@@ -195,7 +195,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
struct mtk_tx_dma_v2 *txd;
|
|
|
int ring_size;
|
|
|
u32 ofs, val;
|
|
|
-@@ -2563,7 +2568,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
|
|
+@@ -2571,7 +2576,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
|
|
* descriptors in ring->dma_pdma.
|
|
|
*/
|
|
|
if (!MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
|
|
|
@@ -204,7 +204,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
&ring->phys_pdma, GFP_KERNEL);
|
|
|
if (!ring->dma_pdma)
|
|
|
goto no_tx_mem;
|
|
|
-@@ -2578,7 +2583,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
|
|
+@@ -2586,7 +2591,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
|
|
atomic_set(&ring->free_count, ring_size - 2);
|
|
|
ring->next_free = ring->dma;
|
|
|
ring->last_free = (void *)txd;
|
|
|
@@ -213,7 +213,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
ring->thresh = MAX_SKB_FRAGS;
|
|
|
|
|
|
/* make sure that all changes to the dma ring are flushed before we
|
|
|
-@@ -2590,7 +2595,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
|
|
+@@ -2598,7 +2603,7 @@ static int mtk_tx_alloc(struct mtk_eth *
|
|
|
mtk_w32(eth, ring->phys, soc->reg_map->qdma.ctx_ptr);
|
|
|
mtk_w32(eth, ring->phys, soc->reg_map->qdma.dtx_ptr);
|
|
|
mtk_w32(eth,
|
|
|
@@ -222,7 +222,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
soc->reg_map->qdma.crx_ptr);
|
|
|
mtk_w32(eth, ring->last_free_ptr, soc->reg_map->qdma.drx_ptr);
|
|
|
|
|
|
-@@ -2639,14 +2644,14 @@ static void mtk_tx_clean(struct mtk_eth
|
|
|
+@@ -2647,14 +2652,14 @@ static void mtk_tx_clean(struct mtk_eth
|
|
|
}
|
|
|
if (!MTK_HAS_CAPS(soc->caps, MTK_SRAM) && ring->dma) {
|
|
|
dma_free_coherent(eth->dma_dev,
|
|
|
@@ -239,7 +239,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
ring->dma_pdma, ring->phys_pdma);
|
|
|
ring->dma_pdma = NULL;
|
|
|
}
|
|
|
-@@ -2702,15 +2707,13 @@ static int mtk_rx_alloc(struct mtk_eth *
|
|
|
+@@ -2710,15 +2715,13 @@ static int mtk_rx_alloc(struct mtk_eth *
|
|
|
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SRAM) ||
|
|
|
rx_flag != MTK_RX_FLAGS_NORMAL) {
|
|
|
ring->dma = dma_alloc_coherent(eth->dma_dev,
|
|
|
@@ -258,7 +258,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
}
|
|
|
|
|
|
if (!ring->dma)
|
|
|
-@@ -2721,7 +2724,7 @@ static int mtk_rx_alloc(struct mtk_eth *
|
|
|
+@@ -2729,7 +2732,7 @@ static int mtk_rx_alloc(struct mtk_eth *
|
|
|
dma_addr_t dma_addr;
|
|
|
void *data;
|
|
|
|
|
|
@@ -267,7 +267,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
if (ring->page_pool) {
|
|
|
data = mtk_page_pool_get_buff(ring->page_pool,
|
|
|
&dma_addr, GFP_KERNEL);
|
|
|
-@@ -2812,7 +2815,7 @@ static void mtk_rx_clean(struct mtk_eth
|
|
|
+@@ -2820,7 +2823,7 @@ static void mtk_rx_clean(struct mtk_eth
|
|
|
if (!ring->data[i])
|
|
|
continue;
|
|
|
|
|
|
@@ -276,7 +276,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
if (!rxd->rxd1)
|
|
|
continue;
|
|
|
|
|
|
-@@ -2829,7 +2832,7 @@ static void mtk_rx_clean(struct mtk_eth
|
|
|
+@@ -2837,7 +2840,7 @@ static void mtk_rx_clean(struct mtk_eth
|
|
|
|
|
|
if (!in_sram && ring->dma) {
|
|
|
dma_free_coherent(eth->dma_dev,
|
|
|
@@ -285,7 +285,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
ring->dma, ring->phys);
|
|
|
ring->dma = NULL;
|
|
|
}
|
|
|
-@@ -3200,7 +3203,7 @@ static void mtk_dma_free(struct mtk_eth
|
|
|
+@@ -3208,7 +3211,7 @@ static void mtk_dma_free(struct mtk_eth
|
|
|
|
|
|
if (!MTK_HAS_CAPS(soc->caps, MTK_SRAM) && eth->scratch_ring) {
|
|
|
dma_free_coherent(eth->dma_dev,
|
|
|
@@ -294,7 +294,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
eth->scratch_ring, eth->phy_scratch_ring);
|
|
|
eth->scratch_ring = NULL;
|
|
|
eth->phy_scratch_ring = 0;
|
|
|
-@@ -5228,6 +5231,9 @@ static void mtk_remove(struct platform_d
|
|
|
+@@ -5236,6 +5239,9 @@ static void mtk_remove(struct platform_d
|
|
|
mtk_mdio_cleanup(eth);
|
|
|
}
|
|
|
|
|
|
@@ -304,7 +304,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
static const struct mtk_soc_data mt2701_data = {
|
|
|
.reg_map = &mtk_reg_map,
|
|
|
.caps = MT7623_CAPS | MTK_HWLRO,
|
|
|
-@@ -5236,14 +5242,14 @@ static const struct mtk_soc_data mt2701_
|
|
|
+@@ -5244,14 +5250,14 @@ static const struct mtk_soc_data mt2701_
|
|
|
.required_pctl = true,
|
|
|
.version = 1,
|
|
|
.tx = {
|
|
|
@@ -321,7 +321,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
.irq_done_mask = MTK_RX_DONE_INT,
|
|
|
.dma_l4_valid = RX_DMA_L4_VALID,
|
|
|
.dma_size = MTK_DMA_SIZE(2K),
|
|
|
-@@ -5264,14 +5270,14 @@ static const struct mtk_soc_data mt7621_
|
|
|
+@@ -5272,14 +5278,14 @@ static const struct mtk_soc_data mt7621_
|
|
|
.hash_offset = 2,
|
|
|
.foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
|
|
|
.tx = {
|
|
|
@@ -338,7 +338,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
.irq_done_mask = MTK_RX_DONE_INT,
|
|
|
.dma_l4_valid = RX_DMA_L4_VALID,
|
|
|
.dma_size = MTK_DMA_SIZE(2K),
|
|
|
-@@ -5294,14 +5300,14 @@ static const struct mtk_soc_data mt7622_
|
|
|
+@@ -5302,14 +5308,14 @@ static const struct mtk_soc_data mt7622_
|
|
|
.has_accounting = true,
|
|
|
.foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
|
|
|
.tx = {
|
|
|
@@ -355,7 +355,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
.irq_done_mask = MTK_RX_DONE_INT,
|
|
|
.dma_l4_valid = RX_DMA_L4_VALID,
|
|
|
.dma_size = MTK_DMA_SIZE(2K),
|
|
|
-@@ -5323,14 +5329,14 @@ static const struct mtk_soc_data mt7623_
|
|
|
+@@ -5331,14 +5337,14 @@ static const struct mtk_soc_data mt7623_
|
|
|
.foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
|
|
|
.disable_pll_modes = true,
|
|
|
.tx = {
|
|
|
@@ -372,7 +372,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
.irq_done_mask = MTK_RX_DONE_INT,
|
|
|
.dma_l4_valid = RX_DMA_L4_VALID,
|
|
|
.dma_size = MTK_DMA_SIZE(2K),
|
|
|
-@@ -5349,14 +5355,14 @@ static const struct mtk_soc_data mt7629_
|
|
|
+@@ -5357,14 +5363,14 @@ static const struct mtk_soc_data mt7629_
|
|
|
.has_accounting = true,
|
|
|
.version = 1,
|
|
|
.tx = {
|
|
|
@@ -389,7 +389,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
.irq_done_mask = MTK_RX_DONE_INT,
|
|
|
.dma_l4_valid = RX_DMA_L4_VALID,
|
|
|
.dma_size = MTK_DMA_SIZE(2K),
|
|
|
-@@ -5379,14 +5385,14 @@ static const struct mtk_soc_data mt7981_
|
|
|
+@@ -5387,14 +5393,14 @@ static const struct mtk_soc_data mt7981_
|
|
|
.has_accounting = true,
|
|
|
.foe_entry_size = MTK_FOE_ENTRY_V2_SIZE,
|
|
|
.tx = {
|
|
|
@@ -406,7 +406,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
.irq_done_mask = MTK_RX_DONE_INT,
|
|
|
.dma_l4_valid = RX_DMA_L4_VALID_V2,
|
|
|
.dma_max_len = MTK_TX_DMA_BUF_LEN,
|
|
|
-@@ -5409,14 +5415,14 @@ static const struct mtk_soc_data mt7986_
|
|
|
+@@ -5417,14 +5423,14 @@ static const struct mtk_soc_data mt7986_
|
|
|
.has_accounting = true,
|
|
|
.foe_entry_size = MTK_FOE_ENTRY_V2_SIZE,
|
|
|
.tx = {
|
|
|
@@ -423,7 +423,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
.irq_done_mask = MTK_RX_DONE_INT,
|
|
|
.dma_l4_valid = RX_DMA_L4_VALID_V2,
|
|
|
.dma_max_len = MTK_TX_DMA_BUF_LEN,
|
|
|
-@@ -5439,14 +5445,14 @@ static const struct mtk_soc_data mt7988_
|
|
|
+@@ -5447,14 +5453,14 @@ static const struct mtk_soc_data mt7988_
|
|
|
.has_accounting = true,
|
|
|
.foe_entry_size = MTK_FOE_ENTRY_V3_SIZE,
|
|
|
.tx = {
|
|
|
@@ -440,7 +440,7 @@ Signed-off-by: Felix Fietkau <[email protected]>
|
|
|
.irq_done_mask = MTK_RX_DONE_INT_V2,
|
|
|
.dma_l4_valid = RX_DMA_L4_VALID_V2,
|
|
|
.dma_max_len = MTK_TX_DMA_BUF_LEN_V2,
|
|
|
-@@ -5463,13 +5469,13 @@ static const struct mtk_soc_data rt5350_
|
|
|
+@@ -5471,13 +5477,13 @@ static const struct mtk_soc_data rt5350_
|
|
|
.required_pctl = false,
|
|
|
.version = 1,
|
|
|
.tx = {
|