Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2236919yba; Mon, 6 May 2019 02:14:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHQBxmavAigzIZr4ShMvstUHM0KuYhYah92ZV4p3EC4Vsl5HwZTATrRueSFm4Nk/iltajv X-Received: by 2002:a17:902:9a0c:: with SMTP id v12mr31352232plp.184.1557134057786; Mon, 06 May 2019 02:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557134057; cv=none; d=google.com; s=arc-20160816; b=rszrK78dmIxzVAWpV+7ln7XsDR1r+TJksdjVNLoZv9BRj+GZZqHepPaXX/22e2264i 2OJyVSNFxV5Kl3E7O0vte2s+89ugwZ7M89Q86IQHT2STQ8NQWawCJTLsZJHjQeUG06bO CU/q85F6iYrud3yHusZmiQZEMKlLEdLGvXHSoVumAPkDeczeBNzxFIihgxlgfIuXKF77 1CZoZRpLOJq85m4TLxtaaKbaX7JqMna6aYjtiovH8Tdg2RXTcTkeEe8Y6hhKUf88YU56 jXrASuliRAf+yudd7A3pb6Hi69NRSkZ3aq1nUtsfp9BwlTSuHvAlhlRyH4zhD94zCkEv Es8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=ygyOdQ0qhm/gR5ZynkJtfo5IQyvqzJUupTyAXqEVvgY=; b=GYwTxEdWhJWXKKKk0V4pSD77KlBxBeFyK94nkj1E/H3gXX2ptdqkf/GptvoLojrpmu T6aIXueqDKbeFTZyMB+0Ig1HNpo7CuEmNYG90gSoQs4flwKNNrv/hgL/eUiILlYwvW5d JMwObrxWd5M0LNvRjjz48TnR6YuvITFw/Sh5oVo67FKfmHdBgwQdc3xUw4uTw3kYwY8o +M3IzmzAIZxduBPMaynRDzR2f23ovfBvZgoCVtmoth7E7vAVA9ZbSoH1hU6SeDEQfH7L D8kR97oEnXSwm1PumTjYvkEkz1/ysZcxn0u6Wwtp+HXNDKZuocYfih5GXeWM3ghrwEED /hEQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f14si13442293pgg.336.2019.05.06.02.14.02; Mon, 06 May 2019 02:14:17 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726509AbfEFJLt (ORCPT + 99 others); Mon, 6 May 2019 05:11:49 -0400 Received: from inva020.nxp.com ([92.121.34.13]:44052 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725883AbfEFJLh (ORCPT ); Mon, 6 May 2019 05:11:37 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id AD3041A024E; Mon, 6 May 2019 11:11:35 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id C77381A0017; Mon, 6 May 2019 11:11:30 +0200 (CEST) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 70EDE402C7; Mon, 6 May 2019 17:11:24 +0800 (SGT) From: Peng Ma To: vkoul@kernel.org, robh+dt@kernel.org, shawnguo@kernel.org, mark.rutland@arm.com, leoyang.li@nxp.com Cc: dan.j.williams@intel.com, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Peng Ma Subject: [PATCH 3/4] dmaengine: fsl-edma: support little endian for edma driver Date: Mon, 6 May 2019 09:03:43 +0000 Message-Id: <20190506090344.37784-3-peng.ma@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190506090344.37784-1-peng.ma@nxp.com> References: <20190506090344.37784-1-peng.ma@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org improve edma driver to support little endian. 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