spi-s3c64xx: problems with SPI_MODE_3 transfers

Jassi Brar jassisinghbrar at gmail.com
Mon Apr 9 02:51:08 EDT 2012


On Mon, Apr 9, 2012 at 12:09 AM, Heiko Stübner <heiko at sntech.de> wrote:
> [@jassi: I know that you do not work at this stuff any longer, but I included
> you in the list of recipients in the hope that you might be able to give me a
> pointer on where to look for the culprit of the problem :-) ]
>
>
> Hi,
>
> while working on the beginnings of a wireless driver connected via SPI [1],
> the s3c64xx-spi-driver produced strange problems while doing MODE_3  (CPOL |
> CPHA) transfers: [2]
>
> [write] spi cur_bpw: 8:  0x00 0x00 0x04 0x00
> [read]  spi cur_bpw: 8:  0x00 0x00 0x00 0x00
> [read]  spi cur_bpw: 8:  0x00 0x00 0x00 0x00
> (chip_id = 0x0000, chip_rev = 0x00)
> mapped channel 24 to 0
> mapped channel 23 to 1
> [write] spi cur_bpw: 8:  0x00 0x00 0x04 0x00
> [read]  spi cur_bpw: 8:  0x00 0x00 0x00 0x00
> [read]  spi cur_bpw: 8:  0x00 0x00 0x00 0x00
> CIR: 0
> [write] spi cur_bpw: 8:  0x00 0x00 0x04 0x00
> [read]  spi cur_bpw: 8:  0x00 0x00 0x00 0x00
> mt592x_spi spi0.0: I/O Error: rx-1 tx-0 res:rx-f tx-p len-4
> CIR: 0
> [write] spi cur_bpw: 8:  0x00 0x00 0x04 0x00
> mt592x_spi spi0.0: I/O Error: rx-0 tx-1 res:rx-p tx-f len-4
> CIR: 0
> [write] spi cur_bpw: 8:  0x00 0x00 0x04 0x00
> mt592x_spi spi0.0: I/O Error: rx-0 tx-1 res:rx-p tx-f len-4
> CIR: 0
> [write] spi cur_bpw: 8:  0x00 0x00 0x04 0x00
> mt592x_spi spi0.0: I/O Error: rx-0 tx-1 res:rx-p tx-f len-4
> CIR: 0
>
> where the expected result would be:
>
> [write] spi cur_bpw: 8:  0x00 0x00 0x04 0x00
> [read]  spi cur_bpw: 8:  0x00 0x00 0x00 0x00
> [read]  spi cur_bpw: 8:  0x21 0x59 0x91 0x00
>
> The pattern of either empty results or read errors also varies with each
> invocation, i.e. sometimes all fail or all result in wrong values and so on.
>
>
> In contrast when doing this with the spi-gpio driver, everything works as
> expected and I get the expected results.
>
> Also the device-family I'm working on contains a variant with a Marvell 8686
> wlan chip [= the rest of the system is the same]. Using the spi-s3c64xx with
> the libertas driver (MODE_0) works as expected.
>
>
> As I'm not sure where I should look for errors in the driver, I would be glad
> to get pointers in the right direction.
>
You might want to play around tuning the 'fb_delay' and maybe signal
strength too.

-j



More information about the linux-arm-kernel mailing list