I have managed to get the SPI capable devices from this collection working with the Zedboard under the Xilinx Linux distribution.Specifically what I did was:
1. Include the Xilinx AXI_Lite SPI IP Core with 5 slave selects, a 100 Mhz clock with a clock devisor of 8, giving a SPI clock of 12.5 Mhz. SS (Slave Select) 0 is connected to JA1, MOSI to JA2, MISO to JA3, and SCK to JA4. This is consistent with the Maxim PMOD standard. I connected SS 1-4 to JA 7-10 (the other 4 slave select lines).
2. I downloaded and installed Xilinx's device tree generator to the SDK and used to generate a device tree file that I used as a template to edit the new SPI interface into the Zedboard device tree.
3. I added additional devices under the SPI interface tree for the 5 slave selects I configured
4. I turned on the Xilinx SPI and SPIDEV in the xilinx_zynq_defconfig to get driver support and generated linux-xlnx.
5. Spent a lot of time debugging xilinx_spi driver (first a bad bitstream generation caused kernel bus errors (406) during driver initialization) and then failure to launch (xilinx_spi drover defaulting to Big endian when ARM is little endian).
6. Added a new property to SPI interface device tree entry to enable specification of endian selection in the driver, and added code to get and use property in driver during initialization with default being little rather than big endian.
7. Wrote a test Linux application to exercise MAX31855 (temperature sensor) via the SPIDEV protocol driver using its standard IOCTL and Read interfaces (Device doesn't do write, MOSI not connected)
8. At least one of the other Maxim PMODs uses a high slave select signal, which is the inverse of the SPI standard of slave select active low. This PMOD is unusable under Linux as the driver only supports an active low slave select. I plan on making an adapter board, with a 12 pin PMOD cable connector for connection the JA/1 PMOD connector on the Zedboard and with 5 6 pin sockets for SPI devices, numbered SPIDEV0-4, and with the 5 slave selects from the Zedboard routed to Pin 1 of each socket. This will allow the use of up to 5 SPI devices off of a single PMOD port on the Zedboard. I will also put in inverters on the slave selects, each configurable by jumper, to optionally invert individual slave selects and this will overcome the high slave select issue.
9. The other problem is the clock rate is fixed in the IP core. The only way of changing it is to change the PL (new bitstream, boot.bin and device tree entry) and of course it then applies to all SPI devices on the interface. Best is to pick a speed that is suitable for the slowest SPI device that will be used.
The system works very well. Linux maintains an input queue of SPI transfer requests between the protocol driver (SPIDEV) and the SPI interface controller (XILINX_SPI) ensuring each operation is atomic and so they don't interfere with each other. Slave select is dropped after each operation, so to perform write/read operations without dropping slave select (required by some SPI devices) you have to use SPIDEV ioctrl's message transfer method rather than simple write/reads. But it works very well. I've tested with multiple end user applications running simultaneously on the same device and on multiple devices without problems.
Very little of this is documented anywhere, so finding and fixing these problems was challenging. Anyone embarking on the same endeavor with the Zedboard may want to contact me.
Peter