* omap2-mcspi, invalid SPI data received
@ 2016-08-18 11:47 Jonatan Magnusson
0 siblings, 0 replies; only message in thread
From: Jonatan Magnusson @ 2016-08-18 11:47 UTC (permalink / raw)
To: broonie, linux-spi, linux-kernel, samuel.ortiz, juha.yrjola
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-08-18 11:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-18 11:47 omap2-mcspi, invalid SPI data received Jonatan Magnusson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).