Skip to content

Commit

Permalink
net: ethernet: mtk_eth_wed: add wed support for mt7986 chipset
Browse files Browse the repository at this point in the history
Introduce Wireless Etherne Dispatcher support on transmission side
for mt7986 chipset

Tested-by: Daniel Golle <daniel@makrotopia.org>
Co-developed-by: Bo Jiao <Bo.Jiao@mediatek.com>
Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
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>
  • Loading branch information
LorenzoBianconi authored and intel-lab-lkp committed Sep 13, 2022
1 parent f78d9c1 commit a92faa2
Show file tree
Hide file tree
Showing 6 changed files with 408 additions and 97 deletions.
34 changes: 25 additions & 9 deletions drivers/net/ethernet/mediatek/mtk_eth_soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3944,6 +3944,7 @@ void mtk_eth_set_dma_device(struct mtk_eth *eth, struct device *dma_dev)

static int mtk_probe(struct platform_device *pdev)
{
struct resource *res = NULL;
struct device_node *mac_np;
struct mtk_eth *eth;
int err, i;
Expand Down Expand Up @@ -4024,16 +4025,31 @@ static int mtk_probe(struct platform_device *pdev)
}
}

for (i = 0;; i++) {
struct device_node *np = of_parse_phandle(pdev->dev.of_node,
"mediatek,wed", i);
void __iomem *wdma;

if (!np || i >= ARRAY_SIZE(eth->soc->reg_map->wdma_base))
break;
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -EINVAL;
}

wdma = eth->base + eth->soc->reg_map->wdma_base[i];
mtk_wed_add_hw(np, eth, wdma, i);
if (eth->soc->offload_version) {
for (i = 0;; i++) {
struct device_node *np;
phys_addr_t wdma_phy;
u32 wdma_base;

if (i >= ARRAY_SIZE(eth->soc->reg_map->wdma_base))
break;

np = of_parse_phandle(pdev->dev.of_node,
"mediatek,wed", i);
if (!np)
break;

wdma_base = eth->soc->reg_map->wdma_base[i];
wdma_phy = res ? res->start + wdma_base : 0;
mtk_wed_add_hw(np, eth, eth->base + wdma_base,
wdma_phy, i);
}
}

for (i = 0; i < 3; i++) {
Expand Down

0 comments on commit a92faa2

Please sign in to comment.