SPI beagle

Hi...I managed to go through all the step to activate mcspi4 on my BB

however when I run spidev.c I only get FF

is it normal?? how could I set the beagle board to become a slave so I
could test it with other devices?

Saul Andrade

In my experiments it's normal to get FF back from spidev.c when
talking to an unconnected SPI port. The MUX configuration sets SOMI to
pullup, so unless you've got a device driving that pin it will always
read '1'. Try shorting SOMI to SIMO and you'll get back the data
that's being sent out (look in the source to see what that is).

Setting the port to be a slave is another matter entirely - I've not
tried to do that and I'm not certain it's supported. Why do you want
to operate it as a slave?

Eric

Have you seen this[1]?

There is one very tricky gotcha in configuring the pinmux. Namely, you
must enable the clock pin as an input. If you fail to do this, you will
end up reading out zeros. Seeing as you are seeing ones, it seems like
you might have done this. As was previously mentioned, shorting SIMO to
SOMI is a good way to test whether things are working.

There were patches[2] sent out to the SPI list about a year ago
incorporating support for slave mode into the omap2-mcspi
driver. Unfortunately, it seems like these were never picked up.
You can definitely try applying them yourself though. If you do end up
testing them, it probably wouldn't be a bad idea pinging the list to see
if someone would be willing to merge them. I'm not sure why they didn't
make it, but they would be nice to have. Good luck!

- Ben

[1] http://elinux.org/BeagleBoard/SPI
[2] id:50566.10.24.255.18.1266490134.squirrel@dbdmail.itg.ti.com
    id:9542.10.24.255.17.1265192488.squirrel@dbdmail.itg.ti.com

Thank you very much people, turns out I was using some bad wires to
short-circuit the pins, it is really working.

I'll soon make a post to help people who are struggling like I did to
get this thing working.

My doubt now is..in order for me to read data from a device through
spi, should I simply connect it the beagle and keep the data
comming..sorry i got a bit confuse over the roles of master/slave

it would sure be handy to have these patches applied, I'll check
them.

thanks again,m

Saul Andrade

the id:9542.10.24.255.17.1265192488.squirrel@dbdmail.itg.ti.com was
gone...I found the other one

IMHO your efforts will likely be better spent working on the existing
elinux wiki article. If there is something I missed in the article,
please add it. That way everything will be in one place for future
users.

- Ben

It's probably worth noting that the latest unstable Angstrom build (u-
boot 2010.03 & kernel linux-omap-psp-2.6.32-r78) includes patches to
enable McSPI4.0 when my FPGA board is detected via I2C ID PROM. It
shouldn't be too hard to force that in u-boot for other hardware, and
you can enable the kernel drivers by adding the kernel command
'buddy=beaglefpga'

Eric