Hi,
After much effort, here is what I did on Ubuntu :
Board : Beagleboard xM rev C
SPI : SPI-4
Distro : Angstrom Linux Demo image
1. Install the GCC - ARM Cross Compiler on Ubuntu
$sudo apt-get install gcc-arm-linux-gnueabi
2. Download the Angstrom kernel sources from and checkout the
"beagleboardXM" branch from
http://gitorious.org/angstrom/angstrom-linux
$git clone git://gitorious.org/angstrom/angstrom-linux.git
$git checkout beagleboardXM
$git checkout -b spi
The commit id that I am using : 0ae46ae93c0e0d98f96d1b58bc0590b5fc484393
2. Alternatively download the tar.gz from
http://gitorious.org/angstrom/angstrom-linux/commits/beagleboardXM on
the right hand column there is a "Download beagleboardXM as tar.gz" if
you dont want to use git in the previous step.
3. You need to do the pin multiplexing in either u-boot or the kernel
sources. I have not changed the u-boot at all. I am making all the
changes in the kernel sources. Even though the kernel is 2.6.32 you
need to apply the following patch by hand
http://elinux.org/BeagleBoard/SPI/Patch-2.6.37 (by manually adding the lines)
NOTE : Make sure that the CLOCK is set as INPUT as in the above patch,
otherwise it wont work. It is not set correctly in the
http://elinux.org/BeagleBoard/SPI/Patch-2.6.32 patch.
This will set the correct pin multiplexing mode and also register the
SPI buses with the kernel. Once you do this and also make sure to
enable the User mode SPI drivers in the kernel (as shown below)
4. Compile the kernel
$make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- mrproper
$make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- omap3_beagle_defconfig
$make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig
Here you need to make sure that the SPI options are enabled and
compiled directly into kernel and NOT as module
Device Drivers > SPI Support > Debug support for SPI drivers
Device Drivers > SPI Support > McSPI driver for OMAP24xx/OMAP34xx
Device Drivers > SPI Support > User mode SPI device driver support
Now. compile the kernel
$make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage
5. Compile the SPI test program available in kernel sources at
Documentation/spi/spidev_test.c
$arm-linux-gnueabi-gcc Documentation/spi/spidev_test.c -o spitest
6. Short the SPI-4 SIMO and SOMI pins on the board so that whatever
data is sent the same is received back. These details are available in
the ref. manual of beagle board
http://beagleboard.org/static/BBxMSRM_latest.pdf
- Page no. 107 - Figure 51. Main Expansion Header Processor Connections
- Page no. 108 - Table 22. Expansion Connector Signals. In this the
EXPANSION PIN NUMBER (first column) available on the EXPANSION PORT on
board (28 pins) shown in above figure which are connected the
Processor PIN (second column) and the corresponding SPI in column
labeled "1"
In short you need to SHORT the PIN NO. 12 and 18 for SPI-4
This is done so that when you run the test program of step 5 you will
get the same data that you sent on input pins.
7. Copy the uImage generated in the Step 4 and the "spitest" generated
in the Step 5 to the beagleboard. Now boot the board and you will get
the following files.
/dev/spidev3.0
/dev/spidev3.1
/dev/spidev4.0
Now run the test program and you will see the same input as output.
$spitest -D /dev/spidev4.0
Ref links : http://elinux.org/BeagleBoard/SPI
This is just a quick guide, I will write a more detailed one shortly.
Regards.