2017-08-18 16:11:52 +00:00
|
|
|
From de3c04b820e1d396bf12e88ea87271a84f6fedb7 Mon Sep 17 00:00:00 2001
|
2017-04-07 15:42:08 +00:00
|
|
|
From: Sean Wang <sean.wang@mediatek.com>
|
2017-08-18 16:11:52 +00:00
|
|
|
Date: Wed, 29 Mar 2017 17:38:21 +0800
|
|
|
|
Subject: [PATCH 29/57] net-next: ethernet: mediatek: add CDM able to recognize
|
|
|
|
the tag for DSA
|
2017-04-07 15:42:08 +00:00
|
|
|
|
|
|
|
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 <sean.wang@mediatek.com>
|
|
|
|
Signed-off-by: Landen Chao <Landen.Chao@mediatek.com>
|
|
|
|
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
|
|
|
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
|
|
|
|
---
|
|
|
|
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 6 ++++++
|
|
|
|
drivers/net/ethernet/mediatek/mtk_eth_soc.h | 4 ++++
|
|
|
|
2 files changed, 10 insertions(+)
|
|
|
|
|
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
2017-08-18 16:11:52 +00:00
|
|
|
@@ -1864,6 +1864,12 @@ static int mtk_hw_init(struct mtk_eth *e
|
|
|
|
val = mtk_r32(eth, MTK_CDMQ_IG_CTRL);
|
|
|
|
mtk_w32(eth, val | MTK_CDMQ_STAG_EN, MTK_CDMQ_IG_CTRL);
|
2017-04-07 15:42:08 +00:00
|
|
|
|
|
|
|
+ /* Indicates CDM to parse the MTK special tag from CPU
|
|
|
|
+ * which also is working out for untag packets.
|
|
|
|
+ */
|
|
|
|
+ val = mtk_r32(eth, MTK_CDMQ_IG_CTRL);
|
|
|
|
+ mtk_w32(eth, val | MTK_CDMQ_STAG_EN, MTK_CDMQ_IG_CTRL);
|
|
|
|
+
|
|
|
|
/* Enable RX VLan Offloading */
|
|
|
|
mtk_w32(eth, 1, MTK_CDMP_EG_CTRL);
|
|
|
|
|
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
|
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
|
2017-08-18 16:11:52 +00:00
|
|
|
@@ -74,6 +74,10 @@
|
|
|
|
#define MTK_CDMQ_IG_CTRL 0x1400
|
|
|
|
#define MTK_CDMQ_STAG_EN BIT(0)
|
2017-04-07 15:42:08 +00:00
|
|
|
|
|
|
|
+/* CDMP Ingress Control Register */
|
|
|
|
+#define MTK_CDMQ_IG_CTRL 0x1400
|
|
|
|
+#define MTK_CDMQ_STAG_EN BIT(0)
|
|
|
|
+
|
|
|
|
/* CDMP Exgress Control Register */
|
|
|
|
#define MTK_CDMP_EG_CTRL 0x404
|
|
|
|
|