lkml.org 
[lkml]   [2016]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectomap2-mcspi, invalid SPI data received
Date

Hi,

I have this problem that originally started when I tried to use an ENC28J60 device on a Beaglebone (Beaglebone Green Wireless). I noted that while reading one register on the device (EREVID) the value was 0x3C. That register holds the hardware revision and should not be higher than 6 or possibly 7. So I started investigating the code and to make a long story short I ended up writing this silly loop that continuously reads and prints out EREVID:

for(;;) {
printk(KERN_ALERT "REV: 0x%02x\n", nolock_regb_read(priv, EREVID));
}

It reports 0x3C every time so it’s not completely random. If I force the pin to 0V i get 0x00 instead, and 0xFF if I force the pin to 3.3V. That should mean that the hardware config and pinmux is correct, since otherwise it would not change anything if I manipulate the pin.

With this loop active I could investigate what happens with a scope and to my surprise both the sent byte and the received byte are what to be expected: 0x12 and 0x06. But somehow the SPI driver still reads 0x3C instead of 0x06.

Here’s two screenshots from the scope: https://dl.dropboxusercontent.com/u/176615/erevid.png

The first shows clock and mosi, the second clock and miso.

I’ve tried to track the error and got as far as drivers/spi/spi-omap2-mcspi.c, function omap2_mcspi_txrx_pio. Around line 715, readl_relaxed returns 0x3C.

Any ideas?


Best regards,
Jonatan Magnusson

\
 
 \ /
  Last update: 2016-09-17 09:57    [W:0.052 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site