This patch is for i.MX6 ESPI controller slave mode (SPI timing mode 0 and 3) support.
Hardware prepare:
Connect two i.MX6 Sabresd boards, remove U14 SPI nor device, connect two boards like:
MISO --- MISO
MOSI --- MOSI
SS --- SS
CLK --- CLK
GND --- GND
Software prepare:
1>Apply patch spi_slave_2013_10_12.patch on 3.0.35_4.1.0 Linux BSP release.
Note two board all need choose CONFIG_IMX6_SDP_MISCSPI, CONFIG_SPI_SPIDEV of kernel
Symbol: IMX6_SDP_MISCSPI [=y]
Location:
| -> Device Drivers
| -> Misc devices (MISC_DEVICES [=y])
Symbol: SPI_SPIDEV [=y]
Location:
| -> Device Drivers
| -> SPI support (SPI [=y])
Spi master board choose CONFIG_SPI_IMX_VER_2_3
Symbol: SPI_IMX_VER_2_3 [=y]
Location:
| -> Device Drivers
| -> SPI support (SPI [=y])
| -> Choose IMX SPI work mode (<choice> [=y])
Spi slave board choose CONFIG_SPI_IMX_VER_2_3_SLAVE.
Symbol: SPI_IMX_VER_2_3_SLAVE [=y]
Location:
| -> Device Drivers
| -> SPI support (SPI [=y])
| -> Choose IMX SPI work mode (<choice> [=y])
2>Compile test application mxc_spi_test1.c to generate mxc_spi_test.
3> Test steps :
- First spi slave board input cmd mxc-spi-test –D 0 –b 32 –L 32
- Then spi master board input cmd mxc-spi-test –D 0 –b 32 –L 32
This tool will write its buffer ( the content is same in two side ) to the other board through SPI bus , then read data from the other board , and compare with its write buffer.