Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp754671rdb; Wed, 1 Nov 2023 01:19:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvQEpYR2tdf98MK7TwkT1d3crDET6ry01YNro/mJtc4o5pUtVOr738FRy4gG8lIlhJiiWA X-Received: by 2002:a17:90a:ce97:b0:280:4c36:5feb with SMTP id g23-20020a17090ace9700b002804c365febmr7270239pju.17.1698826783305; Wed, 01 Nov 2023 01:19:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698826783; cv=none; d=google.com; s=arc-20160816; b=REc3+mTi4y+KTpjs9+oFFRz9RjpDFTZzBpUTIzzOzdbXq7sqJscwVXs3RZuCcOOuvI qPVNLHAXqThUyjXML3KVFPnKZXdMnClp5pRagpzN/5kllasmY9RLIe0w9zVMEhHMbosW Adb+1cWIm4eO5+/7ToxR7F8SJFyBGAXwD2oRfoxGAxeID5BQvXxDGDM5QjIZ5CPPVj0a Ct1MNYIA694fgi3A28EGQUY1/mBBPRbN6t/iXLZDl4N6nZbp6ldZQhdeIsnysc0EH2Re ma2YEDpW6s5Ti95feC5Q/wkimkG3yz2TRwtfaqK4kWrbvVMXMgFfxMS7GRpHQXUH7B/p isPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=MdxQtqidvb8FeT45ZmHd45LLtbL3Vo8bjKEOad30BzE=; fh=CIsaGKjGtsLuti7Q65omDj5rHXGYFN7vKQThzinPppw=; b=M4r+ZEdGvPndAo8ThPM3J6ChGeGZWGmeqVIzYTvwu+357GVcAMQ8rFSKA6la6gqzp/ 07vu0cOEEvZQcMJAKAsrX2QYoKJ+aCUfpxVgH/72qV/eZ87JwTBJrf5B1SPEfDbScfly rVc6gLJnPDxm/xXeyhvDXXymM4H8eQ/4bvE9nZMeiFldezPPXzh7uAcIk026zbIbaL6z KDgEpRHAWXXqZxWcQ3isLr5aC+an+rhmu53RYBMaaXPfxRlq3XAltPtZjYlfHhvUxhbI DrFvdakfdFDZDQjRMG41afDiKBAMDCyw/iNo3nTFiEzEHSxUrkaodlsyRxM+hYw6n8v2 iK1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id m7-20020a17090a71c700b0028065b30a0dsi336382pjs.124.2023.11.01.01.19.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 01:19:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id CB78880439AE; Wed, 1 Nov 2023 01:19:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231251AbjKAITV (ORCPT + 99 others); Wed, 1 Nov 2023 04:19:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229590AbjKAITU (ORCPT ); Wed, 1 Nov 2023 04:19:20 -0400 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5628A6 for ; Wed, 1 Nov 2023 01:19:17 -0700 (PDT) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 6FC4C1A117F; Wed, 1 Nov 2023 09:19:16 +0100 (CET) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 1FBF31A05BE; Wed, 1 Nov 2023 09:19:16 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 5AA21180031E; Wed, 1 Nov 2023 16:19:14 +0800 (+08) From: Shengjiu Wang To: vkoul@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, shengjiu.wang@gmail.com, linux-imx@nxp.com, dmaengine@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] dmaengine: imx-sdma: support dual fifo for DEV_TO_DEV Date: Wed, 1 Nov 2023 15:40:26 +0800 Message-Id: <1698824426-16111-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 01 Nov 2023 01:19:40 -0700 (PDT) SSI and SPDIF are dual fifo interface, when support ASRC P2P with SSI and SPDIF, the src fifo or dst fifo number can be two. The p2p watermark level bit 13 and 14 are designed for these use case. This patch is to complete this function in driver. Signed-off-by: Shengjiu Wang Signed-off-by: Joy Zou --- drivers/dma/imx-sdma.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index f81ecf5863e8..892e23cc0ce8 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -137,7 +137,11 @@ * 0: Source on AIPS * 12 Destination Bit(DP) 1: Destination on SPBA * 0: Destination on AIPS - * 13-15 --------- MUST BE 0 + * 13 Source FIFO 1: Source is dual FIFO + * 0: Source is single FIFO + * 14 Destination FIFO 1: Destination is dual FIFO + * 0: Destination is single FIFO + * 15 --------- MUST BE 0 * 16-23 Higher WML HWML * 24-27 N Total number of samples after * which Pad adding/Swallowing @@ -168,6 +172,8 @@ #define SDMA_WATERMARK_LEVEL_SPDIF BIT(10) #define SDMA_WATERMARK_LEVEL_SP BIT(11) #define SDMA_WATERMARK_LEVEL_DP BIT(12) +#define SDMA_WATERMARK_LEVEL_SD BIT(13) +#define SDMA_WATERMARK_LEVEL_DD BIT(14) #define SDMA_WATERMARK_LEVEL_HWML (0xFF << 16) #define SDMA_WATERMARK_LEVEL_LWE BIT(28) #define SDMA_WATERMARK_LEVEL_HWE BIT(29) @@ -1259,6 +1265,16 @@ static void sdma_set_watermarklevel_for_p2p(struct sdma_channel *sdmac) sdmac->watermark_level |= SDMA_WATERMARK_LEVEL_DP; sdmac->watermark_level |= SDMA_WATERMARK_LEVEL_CONT; + + /* + * Limitation: The p2p script support dual fifos in maximum, + * So when fifo number is larger than 1, force enable dual + * fifos. + */ + if (sdmac->n_fifos_src > 1) + sdmac->watermark_level |= SDMA_WATERMARK_LEVEL_SD; + if (sdmac->n_fifos_dst > 1) + sdmac->watermark_level |= SDMA_WATERMARK_LEVEL_DD; } static void sdma_set_watermarklevel_for_sais(struct sdma_channel *sdmac) -- 2.34.1