Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

134
Views
Linux driver for quad spi on Zedboard

I am quite new SoC, and I am currently working with the evaluation platform Zedboard. I have included a quad SPI in my block design and want to communicate with it through Linux running on one of the ARM processors. I need the SPI to transmit/receive 32bits in one burst and handle the communication from C++. However, I can't get it working.

The quad SPI is setup as standard, no FIFO and transaction width = 32 bits. I have updated the Linux device tree as follows:

axi_quad_spi_0@41E00000 {
compatible = "xlnx,xps-spi-2.00.b", "xlnx,xps-spi-2.00.a";
#address-cells = <0x1>;
#size-cells = <0x0>;
interrupt-parent = <0x2>;
interrupts = <0x0 0x39 0x1>;
reg = <0x41e00000 0xffff>;
xlnx,fifo-exist = <0x0>;
xlnx,num-ss-bits = <0x2>;
xlnx,num-transfer-bits = <0x20>;
xlnx,sck-ratio = <0x10>;
device@0 {
compatible = "spidev";
reg = <0x0>;
spi-max-frequency = <0x5f5e10>;
};
device@1 {
compatible = "spidev";
reg = <0x1>;
spi-max-frequency = <0x5f5e10>;
};

After this I can see spidev0.0 and spidev.0.1 in /dev as expected. Furthermore, when writing to the device files with bits_per_word = 8 I get an 8bit burst out of the quad SPI but with 32 clock periods, i.e. I get the first byte out corresponding to 1/4 of the 32 bit burst (seen with debug probes in Vivado). I guess I see this because the transaction width is set to 32bits.

However, when I want to change the burst to 32 bit (bits_per_word = 32) it doesn't work - I get the message "xilinx_spi_setup_transfer, unsupported bits_per_word=32" in my Linux terminal.

I use the following code in C++:

uint8_t tx[] = { 0xAD, 0xEF, 0x01, 0x23 }; 
uint8_t rx[4] = { 0 };
struct spi_ioc_transfer tr[2];
tr[0].tx_buf = (unsigned long)tx;
tr[0].rx_buf = (unsigned long)rx;
tr[0].len = 4;
tr[0].delay_usecs = delay;
tr[0].speed_hz = speed;
tr[0].bits_per_word = 32;
tr[0].cs_change = 0;

ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);

I have tried to compile the xilinx driver xilinx-spi.c but when I try to install it (with "modprobe xilinx_spi" in Linux) it says that the "Device or ressource busy".

How do I get this to support 32bit so I can transmit/receive 32bits in one burst? Can anybody help me out here? Thanks!

Br. Jacob

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!