Skip to content

Commit a20f10d

Browse files
TE-N-ShengjiuWangvinodkoul
authored andcommitted
dmaengine: imx-sdma: support dual fifo for DEV_TO_DEV
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> Link: https://lore.kernel.org/r/20240329-sdma_upstream-v4-3-daeb3067dea7@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 2881093 commit a20f10d

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

drivers/dma/imx-sdma.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@
138138
* 0: Source on AIPS
139139
* 12 Destination Bit(DP) 1: Destination on SPBA
140140
* 0: Destination on AIPS
141-
* 13-15 --------- MUST BE 0
141+
* 13 Source FIFO 1: Source is dual FIFO
142+
* 0: Source is single FIFO
143+
* 14 Destination FIFO 1: Destination is dual FIFO
144+
* 0: Destination is single FIFO
145+
* 15 --------- MUST BE 0
142146
* 16-23 Higher WML HWML
143147
* 24-27 N Total number of samples after
144148
* which Pad adding/Swallowing
@@ -169,6 +173,8 @@
169173
#define SDMA_WATERMARK_LEVEL_SPDIF BIT(10)
170174
#define SDMA_WATERMARK_LEVEL_SP BIT(11)
171175
#define SDMA_WATERMARK_LEVEL_DP BIT(12)
176+
#define SDMA_WATERMARK_LEVEL_SD BIT(13)
177+
#define SDMA_WATERMARK_LEVEL_DD BIT(14)
172178
#define SDMA_WATERMARK_LEVEL_HWML (0xFF << 16)
173179
#define SDMA_WATERMARK_LEVEL_LWE BIT(28)
174180
#define SDMA_WATERMARK_LEVEL_HWE BIT(29)
@@ -1258,6 +1264,16 @@ static void sdma_set_watermarklevel_for_p2p(struct sdma_channel *sdmac)
12581264
sdmac->watermark_level |= SDMA_WATERMARK_LEVEL_DP;
12591265

12601266
sdmac->watermark_level |= SDMA_WATERMARK_LEVEL_CONT;
1267+
1268+
/*
1269+
* Limitation: The p2p script support dual fifos in maximum,
1270+
* So when fifo number is larger than 1, force enable dual
1271+
* fifos.
1272+
*/
1273+
if (sdmac->n_fifos_src > 1)
1274+
sdmac->watermark_level |= SDMA_WATERMARK_LEVEL_SD;
1275+
if (sdmac->n_fifos_dst > 1)
1276+
sdmac->watermark_level |= SDMA_WATERMARK_LEVEL_DD;
12611277
}
12621278

12631279
static void sdma_set_watermarklevel_for_sais(struct sdma_channel *sdmac)

0 commit comments

Comments
 (0)