Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1023896pxb; Tue, 14 Sep 2021 14:23:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwndxcraPzAhwnsjhaAE2tSx+gc4ATtzuKA6Fgpfkhospwj1yUQprIqyaFE5MJr+bzVtl9I X-Received: by 2002:a2e:a7d6:: with SMTP id x22mr17403899ljp.293.1631654618913; Tue, 14 Sep 2021 14:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631654618; cv=none; d=google.com; s=arc-20160816; b=ELRQ0fLugOG90cblt8SAlgT9s/Cp3G5d/I0gpG+6ecx91yWwdNIB8QA6BKinfmQxO8 29yLqg3/dU4TUZ+SpI2HcoGiV6K26hA9FkjtbWDtdqqZRE7Ofp8WMHLC9y46gQpm55Vm nKnNaTWieSCDU7f3f8R0kMLl2LBOsrLW1q6n9sVUJ6AOvyRkUwNUSGgdwZVk/7wyTn1y PGEDOR04OsMJLeVTs/S1VJyaQ/sZ6adEfbSBt2buXIGAR+wGJJTILNcHTgRz+nQCGtd5 xiBLOcevfT6jOt9Gpa/EcDW/b8QpB3JTL+I4vIhpA2/yE5dxWfyZg4kpFmRdOlgE/YA9 7XMw== 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 :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=W/NPuoEczw/1+slCOS8Gu5B0QOgyM1rf9FWm8bZsl6Q=; b=wykStKuVhQnDpYhuTryLirMOsYLAXFivd/RKE1jfJwfm73ewDFDS+3yxCYnKx4Bsuw vIkHSu9WxI8EJGmydNgDm3kKY8W7fgsSv53qpKcaCQVAzrvKTvPX2YY+R1mnN+s7Sczy JPSJb9Nv6yvythg/0jVr/IwGXVJU8zrTh3AbxarYqw1/xXPRJiPxyuHyuthfLUDXh7fH 5oAH/751P0jBuKrtKwYBWeN11+jpFQJE2By72dJT1tPpnPobiiZyIozqvmVMDKYLW+fN bYAkarZGR5Qwj39eThK6rJIt68gy11DhGyHHpFOZa+C/B8fGFgfJcaMKI+iXYAseOoX5 g9Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@wp.pl header.s=1024a header.b=r5vvkhpL; 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 k5si16626928ljq.168.2021.09.14.14.22.57; Tue, 14 Sep 2021 14:23:38 -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=r5vvkhpL; 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 S234251AbhINVWi (ORCPT + 99 others); Tue, 14 Sep 2021 17:22:38 -0400 Received: from mx3.wp.pl ([212.77.101.10]:40984 "EHLO mx3.wp.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234363AbhINVWf (ORCPT ); Tue, 14 Sep 2021 17:22:35 -0400 Received: (wp-smtpd smtp.wp.pl 9876 invoked from network); 14 Sep 2021 23:21:15 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1631654475; bh=W/NPuoEczw/1+slCOS8Gu5B0QOgyM1rf9FWm8bZsl6Q=; h=From:To:Subject; b=r5vvkhpL++H3Pe/B8r48RDJ0oMI31s8xK2Ikj9ljq7arIoLwF4jYpQEf57mNKQEc2 q8Qeo7wx3CVdOTiKijJduDxW7dgbnSQIpKG3bdp/qzuMPMaboshw+aGWKmyI3EHCNQ fAgXpAB8QhSyVWncvvInxKtPQ0mkhwGKMRWiXtKU= Received: from 46.204.52.243.nat.umts.dynamic.t-mobile.pl (HELO LAPTOP-OLEK.Free) (olek2@wp.pl@[46.204.52.243]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 14 Sep 2021 23:21:15 +0200 From: Aleksander Jan Bajkowski To: john@phrozen.org, tsbogend@alpha.franken.de, olek2@wp.pl, maz@kernel.org, ralf@linux-mips.org, ralph.hempel@lantiq.com, davem@davemloft.net, kuba@kernel.org, robh+dt@kernel.org, hauke@hauke-m.de, dev@kresin.me, arnd@arndb.de, jgg@ziepe.ca, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 3/8] MIPS: lantiq: dma: fix burst length for DEU Date: Tue, 14 Sep 2021 23:21:00 +0200 Message-Id: <20210914212105.76186-3-olek2@wp.pl> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210914212105.76186-1-olek2@wp.pl> References: <20210914212105.76186-1-olek2@wp.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-WP-MailID: 6de83637f0ab21c13dc811727efd7217 X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 0000000 [cYNU] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The current definition of 2W burst length is invalid. This patch fixes it. Current downstream DEU driver doesn't use DMA. An incorrect burst length value doesn't cause any errors. This patch also adds other burst length values. Fixes: dfec1a827d2b ("MIPS: Lantiq: Add DMA support") Signed-off-by: Aleksander Jan Bajkowski --- arch/mips/lantiq/xway/dma.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/mips/lantiq/xway/dma.c b/arch/mips/lantiq/xway/dma.c index 364ab39eb8a4..53fcc672a294 100644 --- a/arch/mips/lantiq/xway/dma.c +++ b/arch/mips/lantiq/xway/dma.c @@ -41,7 +41,11 @@ #define DMA_IRQ_ACK 0x7e /* IRQ status register */ #define DMA_POLL BIT(31) /* turn on channel polling */ #define DMA_CLK_DIV4 BIT(6) /* polling clock divider */ -#define DMA_2W_BURST BIT(1) /* 2 word burst length */ +#define DMA_PCTRL_2W_BURST 0x1 /* 2 word burst length */ +#define DMA_PCTRL_4W_BURST 0x2 /* 4 word burst length */ +#define DMA_PCTRL_8W_BURST 0x3 /* 8 word burst length */ +#define DMA_TX_BURST_SHIFT 4 /* tx burst shift */ +#define DMA_RX_BURST_SHIFT 2 /* rx burst shift */ #define DMA_ETOP_ENDIANNESS (0xf << 8) /* endianness swap etop channels */ #define DMA_WEIGHT (BIT(17) | BIT(16)) /* default channel wheight */ @@ -192,7 +196,8 @@ ltq_dma_init_port(int p) break; case DMA_PORT_DEU: - ltq_dma_w32((DMA_2W_BURST << 4) | (DMA_2W_BURST << 2), + ltq_dma_w32((DMA_PCTRL_2W_BURST << DMA_TX_BURST_SHIFT) | + (DMA_PCTRL_2W_BURST << DMA_RX_BURST_SHIFT), LTQ_DMA_PCTRL); break; -- 2.30.2