aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Wang <sean.wang@mediatek.com>2019-06-01 08:16:27 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-25 11:35:57 +0800
commit377958c3ff2cf358feba192a73c667699ee89d60 (patch)
treece7d0a838e71f2fc918d2f71345dbb28e9fc2470
parentee2f9878bc04678a1f30b013272c698468420d0e (diff)
downloadlinux-yocto-377958c3ff2cf358feba192a73c667699ee89d60.tar.gz
linux-yocto-377958c3ff2cf358feba192a73c667699ee89d60.tar.bz2
linux-yocto-377958c3ff2cf358feba192a73c667699ee89d60.zip
net: ethernet: mediatek: Use NET_IP_ALIGN to judge if HW RX_2BYTE_OFFSET is enabled
[ Upstream commit 880c2d4b2fdfd580ebcd6bb7240a8027a1d34751 ] Should only enable HW RX_2BYTE_OFFSET function in the case NET_IP_ALIGN equals to 2. Signed-off-by: Mark Lee <mark-mc.lee@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/net/ethernet/mediatek/mtk_eth_soc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 0c70fb345f83..1d55f014725e 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -1784,6 +1784,7 @@ static void mtk_poll_controller(struct net_device *dev)
static int mtk_start_dma(struct mtk_eth *eth)
{
+ u32 rx_2b_offset = (NET_IP_ALIGN == 2) ? MTK_RX_2B_OFFSET : 0;
int err;
err = mtk_dma_init(eth);
@@ -1800,7 +1801,7 @@ static int mtk_start_dma(struct mtk_eth *eth)
MTK_QDMA_GLO_CFG);
mtk_w32(eth,
- MTK_RX_DMA_EN | MTK_RX_2B_OFFSET |
+ MTK_RX_DMA_EN | rx_2b_offset |
MTK_RX_BT_32DWORDS | MTK_MULTI_EN,
MTK_PDMA_GLO_CFG);