|
183 | 183 | BIT(DMA_DEV_TO_DEV))
|
184 | 184 |
|
185 | 185 | #define SDMA_WATERMARK_LEVEL_N_FIFOS GENMASK(15, 12)
|
| 186 | +#define SDMA_WATERMARK_LEVEL_OFF_FIFOS GENMASK(19, 16) |
| 187 | +#define SDMA_WATERMARK_LEVEL_WORDS_PER_FIFO GENMASK(31, 28) |
186 | 188 | #define SDMA_WATERMARK_LEVEL_SW_DONE BIT(23)
|
187 | 189 |
|
188 | 190 | #define SDMA_DONE0_CONFIG_DONE_SEL BIT(7)
|
@@ -429,6 +431,9 @@ struct sdma_desc {
|
429 | 431 | * @n_fifos_src: number of source device fifos
|
430 | 432 | * @n_fifos_dst: number of destination device fifos
|
431 | 433 | * @sw_done: software done flag
|
| 434 | + * @stride_fifos_src: stride for source device FIFOs |
| 435 | + * @stride_fifos_dst: stride for destination device FIFOs |
| 436 | + * @words_per_fifo: copy number of words one time for one FIFO |
432 | 437 | */
|
433 | 438 | struct sdma_channel {
|
434 | 439 | struct virt_dma_chan vc;
|
@@ -456,6 +461,9 @@ struct sdma_channel {
|
456 | 461 | bool is_ram_script;
|
457 | 462 | unsigned int n_fifos_src;
|
458 | 463 | unsigned int n_fifos_dst;
|
| 464 | + unsigned int stride_fifos_src; |
| 465 | + unsigned int stride_fifos_dst; |
| 466 | + unsigned int words_per_fifo; |
459 | 467 | bool sw_done;
|
460 | 468 | };
|
461 | 469 |
|
@@ -1245,17 +1253,29 @@ static void sdma_set_watermarklevel_for_p2p(struct sdma_channel *sdmac)
|
1245 | 1253 | static void sdma_set_watermarklevel_for_sais(struct sdma_channel *sdmac)
|
1246 | 1254 | {
|
1247 | 1255 | unsigned int n_fifos;
|
| 1256 | + unsigned int stride_fifos; |
| 1257 | + unsigned int words_per_fifo; |
1248 | 1258 |
|
1249 | 1259 | if (sdmac->sw_done)
|
1250 | 1260 | sdmac->watermark_level |= SDMA_WATERMARK_LEVEL_SW_DONE;
|
1251 | 1261 |
|
1252 |
| - if (sdmac->direction == DMA_DEV_TO_MEM) |
| 1262 | + if (sdmac->direction == DMA_DEV_TO_MEM) { |
1253 | 1263 | n_fifos = sdmac->n_fifos_src;
|
1254 |
| - else |
| 1264 | + stride_fifos = sdmac->stride_fifos_src; |
| 1265 | + } else { |
1255 | 1266 | n_fifos = sdmac->n_fifos_dst;
|
| 1267 | + stride_fifos = sdmac->stride_fifos_dst; |
| 1268 | + } |
| 1269 | + |
| 1270 | + words_per_fifo = sdmac->words_per_fifo; |
1256 | 1271 |
|
1257 | 1272 | sdmac->watermark_level |=
|
1258 | 1273 | FIELD_PREP(SDMA_WATERMARK_LEVEL_N_FIFOS, n_fifos);
|
| 1274 | + sdmac->watermark_level |= |
| 1275 | + FIELD_PREP(SDMA_WATERMARK_LEVEL_OFF_FIFOS, stride_fifos); |
| 1276 | + if (words_per_fifo) |
| 1277 | + sdmac->watermark_level |= |
| 1278 | + FIELD_PREP(SDMA_WATERMARK_LEVEL_WORDS_PER_FIFO, (words_per_fifo - 1)); |
1259 | 1279 | }
|
1260 | 1280 |
|
1261 | 1281 | static int sdma_config_channel(struct dma_chan *chan)
|
@@ -1769,6 +1789,9 @@ static int sdma_config(struct dma_chan *chan,
|
1769 | 1789 | }
|
1770 | 1790 | sdmac->n_fifos_src = sdmacfg->n_fifos_src;
|
1771 | 1791 | sdmac->n_fifos_dst = sdmacfg->n_fifos_dst;
|
| 1792 | + sdmac->stride_fifos_src = sdmacfg->stride_fifos_src; |
| 1793 | + sdmac->stride_fifos_dst = sdmacfg->stride_fifos_dst; |
| 1794 | + sdmac->words_per_fifo = sdmacfg->words_per_fifo; |
1772 | 1795 | sdmac->sw_done = sdmacfg->sw_done;
|
1773 | 1796 | }
|
1774 | 1797 |
|
|
0 commit comments