From: Frank Li <Frank.Li@nxp.com> To: Vinod Koul <vkoul@kernel.org>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, NXP Linux Team <linux-imx@nxp.com>, Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Joy Zou <joy.zou@nxp.com> Cc: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, Frank Li <Frank.Li@nxp.com>, Shengjiu Wang <shengjiu.wang@nxp.com>, Iuliana Prodan <iuliana.prodan@nxp.com> Subject: [PATCH v4 3/5] dmaengine: imx-sdma: support dual fifo for DEV_TO_DEV Date: Fri, 29 Mar 2024 10:34:43 -0400 [thread overview] Message-ID: <20240329-sdma_upstream-v4-3-daeb3067dea7@nxp.com> (raw) In-Reply-To: <20240329-sdma_upstream-v4-0-daeb3067dea7@nxp.com> From: Shengjiu Wang <shengjiu.wang@nxp.com> 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 <shengjiu.wang@nxp.com> Signed-off-by: Joy Zou <joy.zou@nxp.com> Acked-by: Iuliana Prodan <iuliana.prodan@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com> --- 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 6be4c1e441266..f68ab34a3c880 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -138,7 +138,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 @@ -169,6 +173,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) @@ -1258,6 +1264,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
WARNING: multiple messages have this Message-ID (diff)
From: Frank Li <Frank.Li@nxp.com> To: Vinod Koul <vkoul@kernel.org>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, NXP Linux Team <linux-imx@nxp.com>, Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Joy Zou <joy.zou@nxp.com> Cc: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, Frank Li <Frank.Li@nxp.com>, Shengjiu Wang <shengjiu.wang@nxp.com>, Iuliana Prodan <iuliana.prodan@nxp.com> Subject: [PATCH v4 3/5] dmaengine: imx-sdma: support dual fifo for DEV_TO_DEV Date: Fri, 29 Mar 2024 10:34:43 -0400 [thread overview] Message-ID: <20240329-sdma_upstream-v4-3-daeb3067dea7@nxp.com> (raw) In-Reply-To: <20240329-sdma_upstream-v4-0-daeb3067dea7@nxp.com> From: Shengjiu Wang <shengjiu.wang@nxp.com> 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 <shengjiu.wang@nxp.com> Signed-off-by: Joy Zou <joy.zou@nxp.com> Acked-by: Iuliana Prodan <iuliana.prodan@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com> --- 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 6be4c1e441266..f68ab34a3c880 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -138,7 +138,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 @@ -169,6 +173,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) @@ -1258,6 +1264,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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-03-29 14:35 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-03-29 14:34 [PATCH v4 0/5] dmaengine: fsl-sdma: Some improvement for fsl-sdma Frank Li 2024-03-29 14:34 ` Frank Li 2024-03-29 14:34 ` [PATCH v4 1/5] dmaengine: imx-sdma: Support allocate memory from internal SRAM (iram) Frank Li 2024-03-29 14:34 ` Frank Li 2024-03-29 14:34 ` [PATCH v4 2/5] dmaengine: imx-sdma: Support 24bit/3bytes for sg mode Frank Li 2024-03-29 14:34 ` Frank Li 2024-03-29 14:34 ` Frank Li [this message] 2024-03-29 14:34 ` [PATCH v4 3/5] dmaengine: imx-sdma: support dual fifo for DEV_TO_DEV Frank Li 2024-03-29 14:34 ` [PATCH v4 4/5] dt-bindings: fsl-imx-sdma: Add I2C peripheral types ID Frank Li 2024-03-29 14:34 ` Frank Li 2024-04-02 12:20 ` Rob Herring 2024-04-02 12:20 ` Rob Herring 2024-04-07 9:04 ` Krzysztof Kozlowski 2024-04-07 9:04 ` Krzysztof Kozlowski 2024-04-07 11:21 ` Vinod Koul 2024-04-07 11:21 ` Vinod Koul 2024-03-29 14:34 ` [PATCH v4 5/5] dmaengine: imx-sdma: Add i2c dma support Frank Li 2024-03-29 14:34 ` Frank Li 2024-04-07 11:20 ` Vinod Koul 2024-04-07 11:20 ` Vinod Koul 2024-04-07 16:39 ` [PATCH v4 0/5] dmaengine: fsl-sdma: Some improvement for fsl-sdma Vinod Koul 2024-04-07 16:39 ` Vinod Koul
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20240329-sdma_upstream-v4-3-daeb3067dea7@nxp.com \ --to=frank.li@nxp.com \ --cc=conor+dt@kernel.org \ --cc=devicetree@vger.kernel.org \ --cc=dmaengine@vger.kernel.org \ --cc=festevam@gmail.com \ --cc=imx@lists.linux.dev \ --cc=iuliana.prodan@nxp.com \ --cc=joy.zou@nxp.com \ --cc=kernel@pengutronix.de \ --cc=krzysztof.kozlowski+dt@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-imx@nxp.com \ --cc=linux-kernel@vger.kernel.org \ --cc=robh@kernel.org \ --cc=s.hauer@pengutronix.de \ --cc=shawnguo@kernel.org \ --cc=shengjiu.wang@nxp.com \ --cc=vkoul@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.