Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp509119ybm; Mon, 20 May 2019 21:40:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzs882NbMbdgyt28z7/JI2aCU0a6MptCM6SR7p66KvcR3wd7oy47BbGeKZRHI/4/SCab8ci X-Received: by 2002:a63:950d:: with SMTP id p13mr80118285pgd.269.1558413600127; Mon, 20 May 2019 21:40:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558413600; cv=none; d=google.com; s=arc-20160816; b=LkYfF5IluIbLp24Knu5tKhvN8uesER/Xa+EAYWW+xrLMRqdlHHnXrpK65xugz3RLOn RHZD0UmHPtCo5wk9lVE6kM70mo8Ns/rZ3GMCO41hqrdKywXycfY9sz3qfw3tNzuWou66 kQikVsF6XJggGEyJYzZH4mNSCiIyaH9eLvTQIOoM9Wj6400sl7txD9GMEleFIeYannc7 lloGDcT+S7d6idmWvwnmV20IrrvxX0UVq29e12Fym0IVU13qimYTBFxbdXtQMSb/WLcL kgQoUaUlm8No6JDCZIY7HYcgTFLgzPcKonKuz84/NQFclsm0MykMOhMACUeEMlwBqD2/ AgnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EEOxcI1zjlMGOBPRrecdZNvmDlvaOTgxWw01PRb6cAk=; b=VjrWHjbuk32M7qHrGwt8TbbySHq30UULPWoiS3wEh8sQY1mH2mVVZKe43H3Tdo7ui6 be22PR00N2XY2QJR9jiHPNqTi3/5sklve7GLgqcqLel0NEfC++7pyKdtxXdnPg/J5q1z e9iYM/c/o8WLf7GWJ+7dhHmLGyW/ZzwrdDLVSDuqkKh/2Fw3hskaYj067F3pmWbGO7yX +uVuOUih2Yy146cKyzUaWCusY31vmLBS4LfjoYWDT4wj+DhdS8MutHfODI8vGrVwWnGm MZ00lxYUob1qZSOCMjqhzhYcJvxr7A7hkdO0qibMAvDVewIvUP17JrGSmxFFgP31yk9X d7NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XUh+oiXp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g14si6115443pgh.98.2019.05.20.21.39.45; Mon, 20 May 2019 21:40:00 -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; dkim=pass header.i=@kernel.org header.s=default header.b=XUh+oiXp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727484AbfEUEiM (ORCPT + 99 others); Tue, 21 May 2019 00:38:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:46054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725804AbfEUEiL (ORCPT ); Tue, 21 May 2019 00:38:11 -0400 Received: from localhost (unknown [106.201.107.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 81ADB216B7; Tue, 21 May 2019 04:38:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558413491; bh=4XX4rftcytXAmMV6UJKvOiyXZ94mgRgAhcGdMVSOYYE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XUh+oiXpbm38TqLjIBnHnx97cGR+QEtHqrbEvcNlVtydTwJ8TmXVMG6VoRF5UMmL0 cytkPrj9S83s3Gz4AiqjY9HGxxgGyGORnMNQCJnrw+uqvgJiL2Kggl1vuwL7p6zfcT wMJzOQ36Rt41lGzEWPIxULTVMbZR6eKOdJwopdDg= Date: Tue, 21 May 2019 10:08:07 +0530 From: Vinod Koul To: Peng Ma Cc: robh+dt@kernel.org, shawnguo@kernel.org, mark.rutland@arm.com, leoyang.li@nxp.com, dan.j.williams@intel.com, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 3/4] dmaengine: fsl-edma: support little endian for edma driver Message-ID: <20190521043807.GN15118@vkoul-mobl> References: <20190506090344.37784-1-peng.ma@nxp.com> <20190506090344.37784-3-peng.ma@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190506090344.37784-3-peng.ma@nxp.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06-05-19, 09:03, Peng Ma wrote: > improve edma driver to support little endian. Can you explain a bit more how adding the below lines adds little endian support... > > Signed-off-by: Peng Ma > --- > drivers/dma/fsl-edma-common.c | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c > index 680b2a0..6bf238e 100644 > --- a/drivers/dma/fsl-edma-common.c > +++ b/drivers/dma/fsl-edma-common.c > @@ -83,9 +83,14 @@ void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan, > u32 ch = fsl_chan->vchan.chan.chan_id; > void __iomem *muxaddr; > unsigned int chans_per_mux, ch_off; > + int endian_diff[4] = {3, 1, -1, -3}; > > chans_per_mux = fsl_chan->edma->n_chans / DMAMUX_NR; > ch_off = fsl_chan->vchan.chan.chan_id % chans_per_mux; > + > + if (!fsl_chan->edma->big_endian) > + ch_off += endian_diff[ch_off % 4]; > + > muxaddr = fsl_chan->edma->muxbase[ch / chans_per_mux]; > slot = EDMAMUX_CHCFG_SOURCE(slot); > > -- > 1.7.1 -- ~Vinod