AnsweredAssumed Answered ecspi DMA issue

Question asked by Steven Yu on Jan 3, 2019
Latest reply on Jan 10, 2019 by Lenka Polaskova

Hi Support,


Basically, the ecspi DMA works fine until we modify below function to enable burst transfer. Because originally a SPI clock burst can only transfer 8 bits, and we would like to transfer more bits in one SPI clock burst. However, when we configure MX51_ECSPI_CTRL_BL_OFFSET and MX51_ECSPI_CONFIG_SBBCTRL to enable burst transfer, the return data of DMA are wrong (e.g. half 0x00 and half 0xff). Anythings we miss when we want to use BL(Burst Length) in ecspi DMA ?



Steven Yu


static int mx51_ecspi_config(struct spi_device *spi)


=====from: 8 bits per SPI clock=====

ctrl |= (bits - 1) << MX51_ECSPI_CTRL_BL_OFFSET;
cfg |= MX51_ECSPI_CONFIG_SBBCTRL(spi->chip_select);


=====to: x bits per SPI clock; x depends on data length=====


spi_imx->rxcount = spi_imx->len;


if (reg > 0) {
ctrl |= reg << (MX51_ECSPI_CTRL_BL_OFFSET + 5);

cfg &= ~(MX51_ECSPI_CONFIG_SBBCTRL(spi->chip_select));