[beagleboard] SPI frustration

Hi All,

I have been trying to get my SPI for C4 beagleboard for a while without much
success. I have googled and read the successful stories on how to make it work.
But I still can't see my spi port under /dev nor /sys/bus/spi/devices.

I have tried to follow this webpage to modify u-boot to expose the SPI:

http://elinux.org/BeagleBoardPinMux#U-Boot

I downloaded the latest and greatest u-boot:

git clone git://gitorious.org/beagleboard-validation/u-boot.git

Then I edited file u-boot/board/ti/beagle/beagle.h under BEAGLE_MUX() section

diff beagle.h.old beagle.h.new
210,213c210,213
< /*Wireless LAN */\
< MUX_VAL(CP(MMC2_CLK), (IEN | PTU | EN | M4)) /*GPIO_130*/\
< MUX_VAL(CP(MMC2_CMD), (IEN | PTU | EN | M4)) /*GPIO_131*/\
< MUX_VAL(CP(MMC2_DAT0), (IEN | PTU | EN | M4)) /*GPIO_132*/\

You didn't say if you enabled SPIDEV in your kernel compile, nor if
you modified the kernel board init routines to hook up SPIDEV to
SPI3.0/3.1.

When you look in your /dev directory do you see the SPI devices?

Eric

Hi Eric,

I did turn on CONFIG_SPIDEV as a module. But I didn't do the kernel
board init routines to hook up SPIDEV to SPI3.0/3.1. Let me study that
and try again.

Currently, there is no spi device under /dev

Thanks,

Everett

They will show up when registering the SPI-dev in the board file :slight_smile:

Good luck
  Søren

E.g. like this:

http://gitorious.org/beagleboard-validation/linux/commit/be152079b26269a25c792b8f31b3abb8fa7a6c69

I went through this exact exercise a few months back. After getting past
the quirky pinmux configuration (the CLK pin must have its input
enabled), things were quite straightforward. I documented my attempt at
elinux[1]. Hope this helps!

- Ben

[1] http://elinux.org/BeagleBoard/SPI

Attached are patches to the 2.6.32.11-x13 kernel by RCN available here: https://code.launchpad.net/~beagleboard-kernel/+junk/2.6-stable (rev. 66) to pinmux all the McSPI controllers (eg: 3.0, 3.1, and 4.0), the UART2 pins, and various GPIOs to the expansion header. You use them by simply saving them to the patches/ directory in the 2.6-stable folder of the repo, then running the patch.sh file (attached) that patches the kernel during its build.

The patch for omap2_mcspi is to shutup a warning message (no bad effects on my end but YMMV). The patch.sh file (may be out of date for newer revisions, seems like RCN’s committing quite a lot of changes to the bazaar repo), but it contains the function “custom-patches” that will patch the kernel as necessary, so you can use RCN’s build_deb and build_kernel scripts to build your kernel.

Hope this helps. Special thanks to RCN and emeb for the SPI help.
– @

beagle-enable-spi-uart2-and-gpios-muxc.diff (2.41 KB)

beagle-enable-spi-uart2-and-gpios-muxh.diff (710 Bytes)

beagle-enable-spi-uart2-and-gpios-omap3beagle.diff (2.57 KB)

beagle-enable-spi-uart2-and-gpios-omap2_mcspi.diff (550 Bytes)

patch.sh (5.43 KB)

Thanks a lot for the great help. :slight_smile:

I will try these fixes today. Currently I am using 2.6.33.3 vanilla kernel
because that the xenomai patch only works for vanilla kernel. Does
that make a difference for SPI?

Everett

Hi Everett,

I was just about to try the xenomai, and found out that the patch
doesn't exist for .32 kernel.
I'm bit nervous to use vanilla kernel as there are huge number of
patches for beagleboard in angstrom. Did you have some problems with
vanilla kernel 33 ?

Regards,
Maksym.

Yes. There are some problems. The goodnews is xenomai works fine. But
DVI video doesn't work. I can't tell if my USB keyboard or mouse still
work. But console
still works.

Xenomai has no patch for 2.6.32. But it has patch for 2.6.33 and some other
version of kernels.

Good luck,

Everett