This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SPI driver 3.00.01.06

Other Parts Discussed in Thread: OMAP3530

Hello all,

 

I'm having an issue with spi on the omap3530. I have an FPGA connected to mcspi3 CS0, and i wrote a kernel module that reads from it. there are two problems.

 

my board spi configure structure looks like this
 {
        .modalias               = "fpga_comm",
        .bus_num                = 3,
        .chip_select            = 0,
        .irq                    = OMAP_GPIO_IRQ(QNA_HC_BUTTONS_GPIO),
}

the driver i wrote later sets the spi_device structure like this:

dev->mode &= SPI_MODE_0;
dev->max_speed_hz = 10000;
dev->bits_per_word = 32;

Two problems.

1. Alignment seems off. I'm reading 1 32 bit word at a time, and the four bytes come through out of order.

2. every few reads, one fails, and the following is printed to the console:

[ 47.506134] fpga_comm spi3.0: RXS timed out

This seems to originate in omap2_mcspi.c.

 

 

Does anyone know what i can do to diagnose and fix this issue?

thanks a bunch,

Woody

  • Well, i fixed problem 1. I needed to call spi_setup after setting the mode and bits_per_word.

    problem 2 is still an issue though. We scoped the actual bus, and when it times out, the CS goes LOW but no transaction actually takes place. i'm starting to tear apart the mcspi driver (omap2_mcspi.c), and i can't seem to determine why this would happen.

     

    Should i try posting to the hardware forum? Has anyone seen this RXS problem before?

     

    Thanks,
    Woody

  • I've worked around problem 2. The error only seems to happen with half-duplex reads. full-duplex works fine, i just have to come up with dummy data to write.

     

    This is fine for now. If anyone has any questions or would like me to try anything, let me know.

  • I know this thread has been idle for almost a year now, but I have come across this same bug.  Half duplex reads on the SPI bus fail.  I see the chip select go low, but no clock is generated for the transfer.  I have since patched the omap2_mcspi.c file with the latest driver updates in the v3.0 kernel to no avail.  Anyone out there have a solution for this problem?

  • At least thanks for mentioning a workaround. I bumped into the same issue, bunches of "spi3.0: RXS timed out" messages while reading data. I just supply a dummy buffer filled with zeroes as the "tx" buffer instead of a NULL pointer, and then the messages no longer occur. Seems to be a bug in the driver.