Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp312073pxb; Wed, 27 Oct 2021 03:31:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzesjGQvxnDr3c5EnLO858pbIVW25jDtsCdm6e7O0fNHzD/CdeGP2EF0gCGwgv4m3fEO0Y1 X-Received: by 2002:a17:90a:62ca:: with SMTP id k10mr4948490pjs.38.1635330678678; Wed, 27 Oct 2021 03:31:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635330678; cv=none; d=google.com; s=arc-20160816; b=enaJo0Yy5FNH6dfijBKWFdqSjfrgQIj+AFcOY8yOPH4CLifpOuYiPI2pxoF7JSl5Z+ m6gSGvRwSR7Jr84L7g4eGixqNP0tnHex/3pYi0CX+Xd2Ws2T/MPo2nnGL13tq5f4rYHk o5eL8Gqx2vMpjGX6qNsLWa0c2cvCxL9YChya6jUgQBtTC+QXBTPvB2KxGi3CPqmevdMY V9Ull4FYW8xcxLt4LFchhetZ+16dEhJUMM3FNyc6kUDeOtcZZs3rgfwWINWFUJ2L4Vr0 syOCSdqFRp3GMs9aPlXpu7zYESKMX3Jah4fIK1CqnSvxOQsT2yuNskkFfAdPdWkApTJK 5NQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=WgW57u+5yEbJUHlDaeErLMbW3u24lbfeHj4ACnB7IUw=; b=NFwqSdPz8DqffcobiOcMDHT18mRQJ/XnSCBBdue7UIIeLYmAcqrYZ404X5tWmYlptY ojji98W9fHQ+kpMB2IOU3YUUiodcBxQbRSLNMhjSS7iOvAKJttHj+mt7Ut/DUYnRwjxp VEAM9z2es3ANr3wLqtao5oSuTuve/MkJNacwLo3W29XdaRIHeRjCfOpefheX81NXFDRA tN7Iu80CdWJdFhRZUiZBoH3zpiFl6qg31kNg+Higezw3/OXScXUSuNzF7e8VIq01NXZt ++ucJNWmJL+seUfEz0+55MpX9UVJqQ46g7vJtz4NC/+rjBNFhaowp+vpUjt8WMZfPfvD TR2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@wp.pl header.s=1024a header.b=Wugg7n9O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wp.pl Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u11si9787138plg.385.2021.10.27.03.31.05; Wed, 27 Oct 2021 03:31:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@wp.pl header.s=1024a header.b=Wugg7n9O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wp.pl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239401AbhJZVI0 (ORCPT + 99 others); Tue, 26 Oct 2021 17:08:26 -0400 Received: from mx4.wp.pl ([212.77.101.11]:6140 "EHLO mx4.wp.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239450AbhJZVIY (ORCPT ); Tue, 26 Oct 2021 17:08:24 -0400 Received: (wp-smtpd smtp.wp.pl 32638 invoked from network); 26 Oct 2021 22:59:18 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1635281958; bh=WgW57u+5yEbJUHlDaeErLMbW3u24lbfeHj4ACnB7IUw=; h=From:To:Cc:Subject; b=Wugg7n9O/oDiE6acVmuSQ/SMjOvtm4JeOIKpMT2xGoxbVrlitjbm76N4FMj0oaCOl UgVwf+enWFmng1S3YoMNlPNv+gah/cUTMYRDRpuQCp9fv1+c+xIr1trEA4IYmswp61 qzXaneeTrWD+K8Ota6xXbBmLvTwH5pbovp8MHhm8= Received: from riviera.nat.ds.pw.edu.pl (HELO LAPTOP-OLEK.lan) (olek2@wp.pl@[194.29.137.1]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 26 Oct 2021 22:59:18 +0200 From: Aleksander Jan Bajkowski To: hauke@hauke-m.de, davem@davemloft.net, kuba@kernel.org, robh+dt@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Aleksander Jan Bajkowski Subject: [PATCH 1/2] net: lantiq_xrx200: Hardcode the burst length value Date: Tue, 26 Oct 2021 22:59:01 +0200 Message-Id: <20211026205902.335936-1-olek2@wp.pl> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-WP-DKIM-Status: good (id: wp.pl) X-WP-MailID: 43aa16e0fb2cd16703b4d22842b9e459 X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 0000000 [kaNk] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All SoCs with this IP core support 8 burst length. Hauke suggested to hardcode this value and simplify the driver. Link: https://lkml.org/lkml/2021/9/14/1533 Signed-off-by: Aleksander Jan Bajkowski --- drivers/net/ethernet/lantiq_xrx200.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/net/ethernet/lantiq_xrx200.c b/drivers/net/ethernet/lantiq_xrx200.c index ecf1e11d9b91..0da09ea81980 100644 --- a/drivers/net/ethernet/lantiq_xrx200.c +++ b/drivers/net/ethernet/lantiq_xrx200.c @@ -25,6 +25,7 @@ #define XRX200_DMA_DATA_LEN (SZ_64K - 1) #define XRX200_DMA_RX 0 #define XRX200_DMA_TX 1 +#define XRX200_DMA_BURST_LEN 8 /* cpu port mac */ #define PMAC_RX_IPG 0x0024 @@ -73,9 +74,6 @@ struct xrx200_priv { struct net_device *net_dev; struct device *dev; - int tx_burst_len; - int rx_burst_len; - __iomem void *pmac_reg; }; @@ -323,7 +321,7 @@ static netdev_tx_t xrx200_start_xmit(struct sk_buff *skb, goto err_drop; /* dma needs to start on a burst length value aligned address */ - byte_offset = mapping % (priv->tx_burst_len * 4); + byte_offset = mapping % (XRX200_DMA_BURST_LEN * 4); desc->addr = mapping - byte_offset; /* Make sure the address is written before we give it to HW */ @@ -422,7 +420,8 @@ static int xrx200_dma_init(struct xrx200_priv *priv) int ret = 0; int i; - ltq_dma_init_port(DMA_PORT_ETOP, priv->tx_burst_len, rx_burst_len); + ltq_dma_init_port(DMA_PORT_ETOP, XRX200_DMA_BURST_LEN, + XRX200_DMA_BURST_LEN); ch_rx->dma.nr = XRX200_DMA_RX; ch_rx->dma.dev = priv->dev; @@ -531,18 +530,6 @@ static int xrx200_probe(struct platform_device *pdev) if (err) eth_hw_addr_random(net_dev); - err = device_property_read_u32(dev, "lantiq,tx-burst-length", &priv->tx_burst_len); - if (err < 0) { - dev_err(dev, "unable to read tx-burst-length property\n"); - return err; - } - - err = device_property_read_u32(dev, "lantiq,rx-burst-length", &priv->rx_burst_len); - if (err < 0) { - dev_err(dev, "unable to read rx-burst-length property\n"); - return err; - } - /* bring up the dma engine and IP core */ err = xrx200_dma_init(priv); if (err) -- 2.30.2