Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1275112ybi; Fri, 31 May 2019 17:18:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPrXmAfQaV4Jygb+8BFq5TKxofL/Z9asKJCZqyNmVp2cCL36GXA1xQqewah//BUZjeMFyw X-Received: by 2002:a17:90a:9201:: with SMTP id m1mr12976926pjo.38.1559348283485; Fri, 31 May 2019 17:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559348283; cv=none; d=google.com; s=arc-20160816; b=WGPqAXoeXybGAMR1Mh2KuFLmgn77JeEqpS8jzuYaW4ClVv7g0Vq2hr7EDaS1N/G5G8 gB2DR0ItB0AdAEp7s06KQRt3L8vCMZVEFD4gOFUHir9rXVTTOM9z1gfdIU2GENeDZLTA e7RVV+U10iwSBiZgJwOweyMUE/wZ4oQjYQAjPshbLkgEBsBawJW6/LWMbk2giXaEMrKL nmUtN2ShtEL0ZoXr4igCaFoY1PaoPqT057z/JwSCseU0sIMMzCPUW3lzEMiAjnuqutvT FnqeHVjWr2Nx1ReNiIi9ZFjsgb1yaheEnzA10ypkMuBwmSmYjCQjulCSkHmHwdJElTUU k8IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=yxy62Sfgc+1Mh6h4Gp0Y+nrwxwzgqLqIwWq5nSUbIKI=; b=dwtedzc/La5g0pyJlmCBPDnnMDGI2L8xpRL6kGsQqPlOqUONxBfO9bWJHTtVu/oXbj IU3bKs9iwxG1Rne/CYpmCBc1+qRJvlkplPIwT67thn9UFsyt3Nkvm3D9L+Uya6voxafk c1pD66N/cz4gw9jnT/UXorbySlMCpLaqwuAWOqfq5wKwdFVpzgcWT5YA1hAGN62EeoOq G1ENd/0sgzjaNBvPYx6w2618KubUtXpMNpDl4MCJEkyLBRhBTS/uEqRrH20Tmxl02nzM mltNbcjhae7q7yGSKdoxalwhYHk2LSQ2a6Iq3NFI2f3IvJQR5bG+zEHl+wlT4QbL+dvl yR0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si7911625plt.95.2019.05.31.17.17.47; Fri, 31 May 2019 17:18:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727005AbfFAAQg (ORCPT + 99 others); Fri, 31 May 2019 20:16:36 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:23431 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726518AbfFAAQg (ORCPT ); Fri, 31 May 2019 20:16:36 -0400 X-UUID: 5271996c16df40fba33bcdd53ac2b4a6-20190601 X-UUID: 5271996c16df40fba33bcdd53ac2b4a6-20190601 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 40283549; Sat, 01 Jun 2019 08:16:30 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sat, 1 Jun 2019 08:16:28 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Sat, 1 Jun 2019 08:16:28 +0800 From: To: , CC: , , , , Sean Wang , Mark Lee Subject: [PATCH net v1 2/2] net: ethernet: mediatek: Use NET_IP_ALIGN to judge if HW RX_2BYTE_OFFSET is enabled Date: Sat, 1 Jun 2019 08:16:27 +0800 Message-ID: <1559348187-14941-2-git-send-email-sean.wang@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1559348187-14941-1-git-send-email-sean.wang@mediatek.com> References: <1559348187-14941-1-git-send-email-sean.wang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: A0B3E15B67915A6D9E21AD7A1D9C947EE3F76452E73B813B3042EC22ACAB26252000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Wang Should only enable HW RX_2BYTE_OFFSET function in the case NET_IP_ALIGN equals to 2. Signed-off-by: Mark Lee Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 0b88febbaf2a..765cd56ebcd2 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -1778,6 +1778,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); @@ -1794,7 +1795,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); -- 2.17.1