1 From: MarkLee <Mark-MC.Lee@mediatek.com>
2 Date: Wed, 13 Nov 2019 10:38:43 +0800
3 Subject: [PATCH] net: ethernet: mediatek: Refine the timing of GDM/PSE setup
5 Refine the timing of GDM/PSE setup, move it from mtk_hw_init
6 to mtk_open. This is recommended by the mt762x HW design to
7 do GDM/PSE setup only after PDMA has been started.
9 We exclude mt7628 in mtk_gdm_config function since it is a old IP
10 and there is no GDM/PSE block on it.
12 Signed-off-by: MarkLee <Mark-MC.Lee@mediatek.com>
13 Signed-off-by: David S. Miller <davem@davemloft.net>
16 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
17 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
18 @@ -2236,6 +2236,9 @@ static void mtk_gdm_config(struct mtk_et
22 + if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
25 for (i = 0; i < MTK_MAC_COUNT; i++) {
26 u32 val = mtk_r32(eth, MTK_GDMA_FWD_CFG(i));
28 @@ -2274,6 +2277,8 @@ static int mtk_open(struct net_device *d
32 + mtk_gdm_config(eth, MTK_GDMA_TO_PDMA);
34 napi_enable(ð->tx_napi);
35 napi_enable(ð->rx_napi);
36 mtk_tx_irq_enable(eth, MTK_TX_DONE_INT);
37 @@ -2457,8 +2462,6 @@ static int mtk_hw_init(struct mtk_eth *e
38 mtk_w32(eth, MTK_RX_DONE_INT, MTK_QDMA_INT_GRP2);
39 mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
41 - mtk_gdm_config(eth, MTK_GDMA_TO_PDMA);