My Cubieboard2 spi work for arrays less that 64 bytes but for greater than it, I get these errors:
Operation not permitted
[spi-err] sun7i_spi_handler: spi0 ERR comes, irq status = 0x00003f01
[spi-err] sun7i_spi_handler: spi0 master mode error: txFIFO overflow/rxFIFO underrun or overflow
[spi-err] sun7i_spi_xfer: spi0 cpu transfer data time out
[spi-err] sun7i_spi_xfer: spi0 xfer failed
My guess is that some thing is wrong with DMA on SPI. I did nothing to Device Tree, arch/arm/boot/dts/ directory does not exist. I also checked irq status and I figured out that 13th bit of irq status is 1.
#define SPI_STAT_RO (0x1 << 5) /* rxFIFO overflow, 0: rxfifo is available;1:rxfifo has overflowed! */
#define SPI_STAT_RU (0x1 << 6) /* rxFIFO underrun,fectch data with no data available in FIFO */
#define SPI_STAT_TO (0x1 << 13) /* txFIFO overflow 0:not overflow;1:overflow */
#define SPI_STAT_ERR (SPI_STAT_TO|SPI_STAT_RU|SPI_STAT_RO) //Slave mode,no SPI_STAT_TU
please help me how to fix this problem. I'm stuck on this for two weeks.
My bad. In the previous Kbuild file there was SPI_SUNXI_NDMA and I have been repalced SUNXI with SUN7I while I should write SUN7I_SPI_NDMA, not SPI_SUN7I_NDMA