1 From 0dcbe607cec32ccae23b02a641b8bd6191a328ae Mon Sep 17 00:00:00 2001
2 Message-Id: <0dcbe607cec32ccae23b02a641b8bd6191a328ae.1662243796.git.lorenzo@kernel.org>
3 In-Reply-To: <43a21841ce0175d29f23c34a65ceaaf9dd7eb8b7.1662243796.git.lorenzo@kernel.org>
4 References: <43a21841ce0175d29f23c34a65ceaaf9dd7eb8b7.1662243796.git.lorenzo@kernel.org>
5 From: Lorenzo Bianconi <lorenzo@kernel.org>
6 Date: Tue, 23 Aug 2022 23:09:05 +0200
7 Subject: [PATCH net-next 2/4] net: ethernet: mtk_eth_soc: move wdma_base
8 definitions in mtk register map
10 This is a preliminary patch to introduce mt7986 wed support.
12 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
14 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 16 ++++++++++------
15 drivers/net/ethernet/mediatek/mtk_eth_soc.h | 4 +---
16 2 files changed, 11 insertions(+), 9 deletions(-)
18 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
19 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
20 @@ -75,6 +75,10 @@ static const struct mtk_reg_map mtk_reg_
22 .gdma_to_ppe0 = 0x4444,
30 static const struct mtk_reg_map mt7628_reg_map = {
31 @@ -130,6 +134,10 @@ static const struct mtk_reg_map mt7986_r
33 .gdma_to_ppe0 = 0x3333,
41 /* strings used by ethtool */
42 @@ -3966,16 +3974,12 @@ static int mtk_probe(struct platform_dev
44 struct device_node *np = of_parse_phandle(pdev->dev.of_node,
46 - static const u32 wdma_regs[] = {
52 - if (!np || i >= ARRAY_SIZE(wdma_regs))
53 + if (!np || i >= ARRAY_SIZE(eth->soc->reg_map->wdma_base))
56 - wdma = eth->base + wdma_regs[i];
57 + wdma = eth->base + eth->soc->reg_map->wdma_base[i];
58 mtk_wed_add_hw(np, eth, wdma, i);
61 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
62 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
64 #define TX_DMA_FPORT_MASK_V2 0xf
65 #define TX_DMA_SWC_V2 BIT(30)
67 -#define MTK_WDMA0_BASE 0x2800
68 -#define MTK_WDMA1_BASE 0x2c00
70 /* QDMA descriptor txd4 */
71 #define TX_DMA_CHKSUM (0x7 << 29)
72 #define TX_DMA_TSO BIT(28)
73 @@ -954,6 +951,7 @@ struct mtk_reg_map {
80 /* struct mtk_eth_data - This is the structure holding all differences