Skip to content

Commit 87e3df4

Browse files
moore-brosdavem330
authored andcommitted
net-next: ethernet: mediatek: add CDM able to recognize the tag for DSA
The patch adds the setup for allowing CDM can recognize these packets with carrying port-distinguishing tag. Otherwise, these tagging packets will be handled incorrectly by CDM. The setup is also working out for general untag packets as well. Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Landen Chao <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5cd8985 commit 87e3df4

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

drivers/net/ethernet/mediatek/mtk_eth_soc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,6 +1846,12 @@ static int mtk_hw_init(struct mtk_eth *eth)
18461846
/* GE2, Force 1000M/FD, FC ON */
18471847
mtk_w32(eth, MAC_MCR_FIXED_LINK, MTK_MAC_MCR(1));
18481848

1849+
/* Indicates CDM to parse the MTK special tag from CPU
1850+
* which also is working out for untag packets.
1851+
*/
1852+
val = mtk_r32(eth, MTK_CDMQ_IG_CTRL);
1853+
mtk_w32(eth, val | MTK_CDMQ_STAG_EN, MTK_CDMQ_IG_CTRL);
1854+
18491855
/* Enable RX VLan Offloading */
18501856
mtk_w32(eth, 1, MTK_CDMP_EG_CTRL);
18511857

drivers/net/ethernet/mediatek/mtk_eth_soc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070
/* Frame Engine Interrupt Grouping Register */
7171
#define MTK_FE_INT_GRP 0x20
7272

73+
/* CDMP Ingress Control Register */
74+
#define MTK_CDMQ_IG_CTRL 0x1400
75+
#define MTK_CDMQ_STAG_EN BIT(0)
76+
7377
/* CDMP Exgress Control Register */
7478
#define MTK_CDMP_EG_CTRL 0x404
7579

0 commit comments

Comments
 (0)