mediatek: update to latest kernel patchset from v4.13-rc
[openwrt/openwrt.git] / target / linux / mediatek / patches-4.9 / 0043-net-next-mediatek-enable-special-tag-indication-for-.patch
1 From 53e3d9af39805a7e1ba81a047a9ab433be0e82f5 Mon Sep 17 00:00:00 2001
2 From: John Crispin <john@phrozen.org>
3 Date: Wed, 9 Aug 2017 14:56:53 +0200
4 Subject: [PATCH 43/57] net-next: mediatek: enable special tag indication for
5 PDMA
6
7 The Ingress special tag indication was only enabled for QDMA and not PDMA.
8 Properly initialize the STAG bit. This broke HW NAT and Qos from working
9 for traffic coming in via a DSA device. The PPE failed to properly parse
10 the traffic as it was not expecting the special tag.
11
12 Signed-off-by: John Crispin <john@phrozen.org>
13 ---
14 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 ++
15 drivers/net/ethernet/mediatek/mtk_eth_soc.h | 4 ++++
16 2 files changed, 6 insertions(+)
17
18 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
19 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
20 @@ -1894,6 +1894,8 @@ static int mtk_hw_init(struct mtk_eth *e
21 */
22 val = mtk_r32(eth, MTK_CDMQ_IG_CTRL);
23 mtk_w32(eth, val | MTK_CDMQ_STAG_EN, MTK_CDMQ_IG_CTRL);
24 + val = mtk_r32(eth, MTK_CDMP_IG_CTRL);
25 + mtk_w32(eth, val | MTK_CDMP_STAG_EN, MTK_CDMP_IG_CTRL);
26
27 /* Enable RX VLan Offloading */
28 if (MTK_HW_FEATURES & NETIF_F_HW_VLAN_CTAG_RX)
29 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
30 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
31 @@ -76,6 +76,10 @@
32 #define MTK_CDMQ_IG_CTRL 0x1400
33 #define MTK_CDMQ_STAG_EN BIT(0)
34
35 +/* CDMP Ingress Control Register */
36 +#define MTK_CDMP_IG_CTRL 0x400
37 +#define MTK_CDMP_STAG_EN BIT(0)
38 +
39 /* CDMP Exgress Control Register */
40 #define MTK_CDMP_EG_CTRL 0x404
41