Other Parts Discussed in Thread: TMDSEVM437X
Hello,
I'm using the SPI1 interface on a TMDSEVM437X evaluation board.
It all works as expected with fewer than 160 bytes sent in a single block. In this case the driver uses PIO mode.
With 160 bytes or more, the driver uses DMA mode, at least that is the intention. However CS0 goes low, SCLK stays low, D1 (MOSI) stays high, and the driver hangs in this state.
After much reading and experimentation it's still unclear how to enable the magic of DMA. Hopefully someone can put me on the right track.
Edit: updated detail in follow-up post.
I can see that the driver spins forever on the txrxdone
flag:
static unsigned omap2_mcspi_rx_dma(struct spi_device *spi, struct spi_transfer *xfer, struct dma_slave_config cfg, unsigned es) { /* ... */ ret = mcspi_wait_for_completion(mcspi, &mcspi->txrxdone); /* ... */ }
Below are some plots demonstrating the issue and the commands used to test:
root@am437x-evm:~# spi-pipe -d /dev/spidev1.0 -m 0 -s 100000 -n 1 -b 8 < /dev/urandom > /dev/null
root@am437x-evm:~# spi-pipe -d /dev/spidev1.0 -m 0 -s 100000 -n 1 -b 159 < /dev/urandom > /dev/null
root@am437x-evm:~# spi-pipe -d /dev/spidev1.0 -m 0 -s 100000 -n 1 -b 160 < /dev/urandom > /dev/null
<-- command hangs
For the avoidance of doubt, with the two lines commented from the dts, i.e. DMA disabled, it's possible to transfer up to 4096 bytes in a single block with no apparent issue.