debian sun7i spi 不适用于 >= 64 字节

debian sun7i spi 不适用于 >= 64 字节

我的 Cubieboard2 spi 适用于小于 64 字节的数组,但对于大于 64 字节的数组,我会收到“操作不允许”错误。

dmesg 输出:

[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

我的猜测是 SPI 上的 DMA 有问题。我对设备树没有执行任何操作,arch/arm/boot/dts/ 目录不存在。我还检查了irq状态,发现irq状态的第13位是1。

来自 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 */
#define SPI_STAT_ERR        (SPI_STAT_TO|SPI_STAT_RU|SPI_STAT_RO) //Slave mode,no SPI_STAT_TU

请帮助我如何解决这个问题。我在这件事上坚持了两个星期。

答案1

我的错。在之前的Kbuild文件中,有SPI_SUNXI_NDMA,我已经用SUN7I替换了SUNXI,而我应该写SUN7I_SPI_NDMA,而不是SPI_SUN7I_NDMA。

相关内容