Closed multivac61 closed 7 years ago
Btw I know that the SPI bus is on /dev/32764.0
because I ran the ever so popular spidev_test
and that works well.
Mainline SPI driver has rather small transfer size limits as far as I know.
@zador-blood-stained hmm, there must be some way to increase that? AFAIK the same works on the mainline driver for Raspberry Pis.
Yes, there were some experimental patches, but they never reached upstream and now they will need some rework since SPI driver code was changed. For example, this: https://groups.google.com/forum/#!searchin/linux-sunxi/SPI$20sun4i|sort:relevance/linux-sunxi/M8ZSFzWKjfY/vlAzi7Yl66sJ and this: https://groups.google.com/forum/#!searchin/linux-sunxi/SPI$20sun4i|sort:relevance/linux-sunxi/UAC2ayDFih4/Fc-MMackkyEJ
There's also https://patchwork.kernel.org/patch/9173711/, which seems to be a more modern approach for adding long SPI transfers via DMA, instead of by CPU-backed interrupts.
@multivac61 I have successfully updated a patch (v6-ARM-sun4i-spi-Allow-transfers-larger-than-FIFO-size.patch) to cleanly apply to sunxi-next and provide interrupt-driven SPI FIFO handling. I have tested this patch for several days of continuous SPI reads on a banana pi and seen no issues.
My patch is available at http://sprunge.us/ALKA - it's a pretty small edit on v6 to change some additional -90 checks added recently.
I will be considering exploring the DMA patch, but it did not cleanly apply and the much-simpler interrupt patch meets my needs.
I do not think the interrupt patch is mainlineable given that DMA is the ideal solution, but it should meet your needs.
As I think you're also using an A20 board, I would be glad to provide the kernel .deb I built including the patch, let me know!
@zador-blood-stained @igorpecovnik is there a weaker burden of proof to include a patch with armbian? This is a pretty popular feature request on boards using sun4i-spi, and all mainlining efforts around the interrupt or DMA patches appear to have stalled.
@itdaniher I am away for the weekend but will check the patch out once I get back home. Looks good.
For the reference - this patch was added to sunxi-next branch: fdd69714af50ac0197c98b10b3cf8c44599e053d
Closing since the patch was reported as working by @itdaniher Now it will be maintained here unless SPI code changes will require too much work to have it running again
Now that I have SPI working on my Olimex Lime 2 #500 I would like to connect a TFT screen to it. My setup is surprisingly similar to the one @igorpecovnik had here.
While Igor had a spi error code
-22
when runningmodprobe fbtft_device name=adafruit22a busnum=32764 gpios=dc:128,reset:129,led:34 debug=7
I get-90
which is a system error code that means "Message too long".I have tried increasing the SPI buffersize by running
modprobe spidev bufsiz=65536
but I still get the same errors:Has anyone here successfully connected a
ili9340
screen to their Olimex computer, or can lead me to the right direction?