Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1730982ybm; Tue, 21 May 2019 20:30:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyX59i3bwnRTr8RSAh4SX8lRMg6h4c8WZSNbiScFq31gmRfPXvLrkrr9mXpkC2Vl5tCBqkJ X-Received: by 2002:a17:902:28c9:: with SMTP id f67mr68290135plb.190.1558495823218; Tue, 21 May 2019 20:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558495823; cv=none; d=google.com; s=arc-20160816; b=MMsCUtaQKu167OOyaLI2wLQ5E0uFBkYbo0S4JzBEp4iun1qHfQQU8O2Q9mg7dqT52X aLcSh163ToLwu7ASQOMwZOedF+0wvFskfLU62nbN17VKE28Y5stu4HAmOFSJJDZoWHP6 Jpa1Yjy0/Hrpsxm7vFgSX1M2LwDlzWSLO3hVHtd2kUvjtPQelCZbkjFTV5OuNkF3Zx+n zut29ODAW0PyFxK4AUT5g3fCk++slTSNWh6QKJMEqdQyWhIvNdQTc79TuKq3RTJeglVH r+1cKPleOkDksp6zRiDEqNxgjetLQLiCWxbv0nl1at+r/AogHLc2WS0ynpZLiW63C4ls 3f4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=QvwWV8iecxRn8bEQzH+UOWu4Zy54FYyDl/4arAl4cDg=; b=WU2e4iqfsmXw8cK2nHh6PC55b1mH4PV3TKrnlgRL8HjLwGHgAaSAzRxHGD5cEd8hMb Sxp/BIvBkpWMx77TjBCmNc9c3mXLsUJPLnS2ei6nLC4rhXBixRGoY9rLLabDS2+ug3uO 58ujHZaGVWqyhPtEItMMF73mY8cB4PV9H3GozfEODCW9Jk2ma3hxb5de9RuE2d0HFMkE EoZ5p5gOwZOvJaR0EFU/2vJZezOMufG2QGJcnpIPioTBruRmCPYp+2mVR/0C3IClP1NZ Q/5IoHvyUiqgjZw5912a91wGZSgjQwpwlIOWapU5D7Xk1hqPSlnF1LfsH4owyYms6Y2V hDVQ== 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 f1si24812669pgi.432.2019.05.21.20.30.07; Tue, 21 May 2019 20:30:23 -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 S1728323AbfEVD3E (ORCPT + 99 others); Tue, 21 May 2019 23:29:04 -0400 Received: from inva021.nxp.com ([92.121.34.21]:45326 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728085AbfEVD3E (ORCPT ); Tue, 21 May 2019 23:29:04 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 0631520001C; Wed, 22 May 2019 05:29:02 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 6C203200008; Wed, 22 May 2019 05:28:59 +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 DBD8D402E0; Wed, 22 May 2019 11:28:55 +0800 (SGT) From: Peng Ma To: vkoul@kernel.org, dan.j.williams@intel.com Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Peng Ma Subject: [V3 1/2] dmaengine: fsl-qdma: fixed the source/destination descriptor format Date: Wed, 22 May 2019 03:21:02 +0000 Message-Id: <20190522032103.13713-1-peng.ma@nxp.com> X-Mailer: git-send-email 2.14.1 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 CMD of Source/Destination descriptor format should be lower of struct fsl_qdma_engine number data address. Signed-off-by: Peng Ma --- changed for V3: - Delete macro to simplify code. drivers/dma/fsl-qdma.c | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c index aa1d0ae..da8fdf5 100644 --- a/drivers/dma/fsl-qdma.c +++ b/drivers/dma/fsl-qdma.c @@ -113,6 +113,7 @@ /* Field definition for Descriptor offset */ #define QDMA_CCDF_STATUS 20 #define QDMA_CCDF_OFFSET 20 +#define QDMA_SDDF_CMD(x) (((u64)(x)) << 32) /* Field definition for safe loop count*/ #define FSL_QDMA_HALT_COUNT 1500 @@ -341,6 +342,7 @@ static void fsl_qdma_free_chan_resources(struct dma_chan *chan) static void fsl_qdma_comp_fill_memcpy(struct fsl_qdma_comp *fsl_comp, dma_addr_t dst, dma_addr_t src, u32 len) { + u32 cmd; struct fsl_qdma_format *sdf, *ddf; struct fsl_qdma_format *ccdf, *csgf_desc, *csgf_src, *csgf_dest; @@ -369,14 +371,14 @@ static void fsl_qdma_comp_fill_memcpy(struct fsl_qdma_comp *fsl_comp, /* This entry is the last entry. */ qdma_csgf_set_f(csgf_dest, len); /* Descriptor Buffer */ - sdf->data = - cpu_to_le64(FSL_QDMA_CMD_RWTTYPE << - FSL_QDMA_CMD_RWTTYPE_OFFSET); - ddf->data = - cpu_to_le64(FSL_QDMA_CMD_RWTTYPE << - FSL_QDMA_CMD_RWTTYPE_OFFSET); - ddf->data |= - cpu_to_le64(FSL_QDMA_CMD_LWC << FSL_QDMA_CMD_LWC_OFFSET); + cmd = cpu_to_le32(FSL_QDMA_CMD_RWTTYPE << + FSL_QDMA_CMD_RWTTYPE_OFFSET); + sdf->data = QDMA_SDDF_CMD(cmd); + + cmd = cpu_to_le32(FSL_QDMA_CMD_RWTTYPE << + FSL_QDMA_CMD_RWTTYPE_OFFSET); + cmd |= cpu_to_le32(FSL_QDMA_CMD_LWC << FSL_QDMA_CMD_LWC_OFFSET); + ddf->data = QDMA_SDDF_CMD(cmd); } /* -- 1.7.1