VAR-SOM-AM33 SPI

From Variscite Wiki

SPI interface

  • The VAR-SOM-AM33 supports SPI interface over am335x SPI-1 bus.
  • To enable the SPI bus, the developer should apply the following HW modifications on the VAR-AM33CustomBoard Rev1.2:

1) Remove resistors R9 and R10 (from CustomBoard carrier).
2) Remove U21 component (from CustomBoard carrier).

  • Download the kernel out-of-tree, and update the DTS:
$ gedit arch/arm/boot/dts/var-som-am33.dts

and update the following lines(change #if 0 to #if 1) - From:

&spi1 {
	status = "okay";

#if 0	/* NOTE: In order to use SPI on VAR-SOM-AM33 CustomBoard -

To

&spi1 {
	status = "okay";

#if 1	/* NOTE: In order to use SPI on VAR-SOM-AM33 CustomBoard -
  • Rebuild the var-som-am33.dtb and replace it.
  • Then, to test, build the SPI test application for ARM (and copy it to the target rootfs):
$ cd Documentation/spi/
$ make spidev_test
$ sudo cp spidev_test /media/rootfs/sbin
  • Start the var-som-am33 board and run the test (SPI-Rx and SPI-Tx lines should be shorted for this test), as follows:
root@varsomam33:~# spidev_test -D /dev/spidev1.0
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)

FF FF FF FF FF FF
40 00 00 00 00 95
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
DE AD BE EF BA AD
F0 0D
root@varsomam33:~#

Please see a more detailed explanation on the AM335x SPI interface on http://processors.wiki.ti.com/index.php/Linux_Core_SPI_User%27s_Guide