Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: imx: keep dma request disabled before dma transfer setup

Since sdma hardware configure postpone to transfer phase, have to disable
dma request before dma transfer setup because there is a hardware
limitation on sdma event enable(ENBLn) as below:

"It is thus essential for the Arm platform to program them before any DMA
request is triggered to the SDMA, otherwise an unpredictable combination
of channels may be started."

Signed-off-by: Carlos Song <carlos.song@nxp.com>
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Link: https://patch.msgid.link/20251024055320.408482-1-carlos.song@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Robin Gong and committed by
Mark Brown
86d57d9c 3cd2018e

+11 -4
+11 -4
drivers/spi/spi-imx.c
··· 519 519 { 520 520 u32 reg; 521 521 522 - reg = readl(spi_imx->base + MX51_ECSPI_CTRL); 523 - reg |= MX51_ECSPI_CTRL_XCH; 524 - writel(reg, spi_imx->base + MX51_ECSPI_CTRL); 522 + if (spi_imx->usedma) { 523 + reg = readl(spi_imx->base + MX51_ECSPI_DMA); 524 + reg |= MX51_ECSPI_DMA_TEDEN | MX51_ECSPI_DMA_RXDEN; 525 + writel(reg, spi_imx->base + MX51_ECSPI_DMA); 526 + } else { 527 + reg = readl(spi_imx->base + MX51_ECSPI_CTRL); 528 + reg |= MX51_ECSPI_CTRL_XCH; 529 + writel(reg, spi_imx->base + MX51_ECSPI_CTRL); 530 + } 525 531 } 526 532 527 533 static void mx51_ecspi_disable(struct spi_imx_data *spi_imx) ··· 765 759 writel(MX51_ECSPI_DMA_RX_WML(spi_imx->wml - 1) | 766 760 MX51_ECSPI_DMA_TX_WML(tx_wml) | 767 761 MX51_ECSPI_DMA_RXT_WML(spi_imx->wml) | 768 - MX51_ECSPI_DMA_TEDEN | MX51_ECSPI_DMA_RXDEN | 769 762 MX51_ECSPI_DMA_RXTDEN, spi_imx->base + MX51_ECSPI_DMA); 770 763 } 771 764 ··· 1524 1519 dmaengine_submit(desc_tx); 1525 1520 reinit_completion(&spi_imx->dma_tx_completion); 1526 1521 dma_async_issue_pending(controller->dma_tx); 1522 + 1523 + spi_imx->devtype_data->trigger(spi_imx); 1527 1524 1528 1525 transfer_timeout = spi_imx_calculate_timeout(spi_imx, transfer->len); 1529 1526