Hi,
My customer writes:
Have a question regarding the AM335x SPI interface with a little background.
We are using the SPI1 interface in “Master simultaneous Transmit & Receive mode” to interface to an FPGA. So, the MOSI and MISO lines are active at exactly the same time as the AM335x puts out the clock during the SPI transaction. This of course makes FPGA reads a bit challenging since data essentially has to be ready as soon as the SPI transaction starts, so I’ve been playing around with different SPI speeds and SPI word bit lengths to build time into the cycle to be able to return read data in real-time. We had a lot of early development problems with SPI (both H/W and Linux) on the past spin of the board, but now we’re cleaning things up and attempting to boost the performance quite a bit so we can speed up our network.
Using Linux SPIDEV, we’ve been experimenting with SPI performance a bit and have been able to get SPI block writes to work for writing packets over SPI to the FPGA, but we were unable to get SPI block reads to work, which I think makes sense after thinking about it since read data back to the AM335x over the MISO line must be driven concurrently by writes over the MOSI line since both lines are active together in Master TX/RX mode. Our Linux Firmware Eng. has indicated that there exists some sort of simultaneous block read/write capability that could address this; however, it is supported in Kernel version 4.1.18 which we have not gone to yet.
So, I think what this looks like is the Firmware, during block reads, would have conduct a dummy block write in order to drive that read data back to the AM335x as a block read. This would seem to create a bottleneck in the SPI controller running block-type transactions simultaneously in both directions, but maybe it works.
Question is, are we on the right track here on how to drive block reads from the FPGA over SPI? We don’t want to go too far down this path if there is a better way to boost performance of SPI in both directions. Would updating to the newer version of Linux solve this problem for us?
Any suggestions about a Kernel migration or the best way to do block reads over SPI?
Thanks! Blake

