January 20, 2021, 02:01:11 am


Have you visited the Allwinner Chipset wiki? - http://linux-sunxi.org/

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - frd1995

Beginners / sun7i spi does not work for >= 64 bytes
July 24, 2019, 02:19:06 am
My Cubieboard2 spi work for arrays less that 64  bytes but for greater than it, I get these errors:
Operation not permitted
dmesg output:

[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.
from arch/arm/mach-sun7i/include/mach/spi.h:

#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 */

please help me how to fix this problem. I'm stuck on this for two weeks.