Hi All,
I am working on AM3517 custom board. I want to configure the SPI interface 1 and 2. For the same i did the follwoing chnages in the uboot and kernel. But i didn't see any pulses from MCSPI1_SIMO and MCSPI2_SIMO signals when i execute the following command from console
echo "SPI TEST" >/dev/spidev1.0
echo "ASHOK" >/dev/spidev2.0
Can any one verify my changes below and let me know if i missed any thing.?
Changes made in uboot
board/adlink/sm3517/sm3517.h
MUX_VAL(CP(MCSPI1_CLK), (IEN | PTU | DIS | M0)) /*MCSPI1_CLK */\
MUX_VAL(CP(MCSPI1_SIMO), (IEN | PTU | DIS | M0)) /*MCSPI1_SIMO */\
MUX_VAL(CP(MCSPI1_SOMI), (IEN | PTU | EN | M0)) /*MCSPI1_SOMI*/\
MUX_VAL(CP(MCSPI1_CS0), (IEN | PTU | EN | M0)) /*MCSPI1_CS0 */\
MUX_VAL(CP(MCSPI1_CS1), (IEN | PTD | EN | M4)) /*GPIO_175*/\
MUX_VAL(CP(MCSPI1_CS2), (IEN | PTU | DIS | M4)) /*GPIO_176*/\
/* - LAN_INTR*/\
MUX_VAL(CP(MCSPI1_CS3), (IEN | PTD | EN | M0)) \
\
MUX_VAL(CP(MCSPI2_CLK), (IEN | PTU | DIS | M0)) /*MCSPI2_CLK*/\
MUX_VAL(CP(MCSPI2_SIMO), (IEN | PTU | DIS | M0)) /*MCSPI2_SIMO*/\
MUX_VAL(CP(MCSPI2_SOMI), (IEN | PTU | EN | M0)) /*MCSPI2_SOMI*/\
MUX_VAL(CP(MCSPI2_CS0), (IEN | PTU | EN | M0)) /*MCSPI2_CS0*/\
MUX_VAL(CP(MCSPI2_CS1), (IEN | PTU | EN | M0)) /*MCSPI2_CS1*/\
Below is the PIN used for SPI interface as per my schematic
SPI
SPI interface - AM3517 Pin names
SPI1_CS0_3V - GPIO_174/MMC2_DAT7/MCSPI1_CS0
SPI1_CLK_3V - GPIO_171/MMC2_DAT4/MCSPI1_CLK
SPI1_SOMI_3V - GPIO_173/MMC2_DAT6/MCSPI1_SOMI
SPI1_SIMO_3V - GPIO_172/MMC2_DAT5/MCSPI1_SIMO
SPI0
SPI interface - AM3517 Pin names
SPI2_CLK_3V - GPIO_178/HSUSB2_DATA7/HSUSB2_TLL_DATA7/MCSPI2_CLK
SPI2_SOMI_3V - GPIO_180/HSUSB2_DATA5/HSUSB2_TLL_DATA5/GPT10_PWM_EVT/MCSPI2_SOMI
SPI2_SIMO_3V - GPIO_179/HSUSB2_DATA4/HSUSB2_TLL_DATA4/GPT9_PWM_EVT/MCSPI2_SIMO
SPI2_CS0_3V - GPIO_181/HSUSB2_DATA6/HSUSB2_TLL_DATA6/GPT11_PWM_EVT/MCSPI2_CS0
SPI2_CS1_3V - GPIO_182/MM_FSUSB_TXEN_N/HSUSB2_DATA3/HSUSB2_TLL_DATA3/GPT8_PWM_EVT/MCSPI2_CS1
Code changes in the Kernel
1. .config file
CONFIG_SPI=y
CONFIG_SPI_DEBUG=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_OMAP24XX=y
CONFIG_SPI_SPIDEV=y
2. Board file (arch/arm/mach-omap2/board-am3517evm.c)
static struct spi_board_info tcw_spi_board_info[] = {
{
.modalias = "spidev",
.max_speed_hz = 48000000, //48 Mbps
.bus_num = 1,
.chip_select = 0,
.mode = SPI_MODE_1 | SPI_CS_HIGH,
},
{
.modalias = "spidev",
.max_speed_hz = 48000000, //48 Mbps
.bus_num = 2,
.chip_select = 0,
/* .mode = SPI_MODE_3, */
.mode = SPI_MODE_1 | SPI_CS_HIGH,
},
};
static void __init am3517_evm_init(void)
{
................
................
spi_register_board_info(tcw_spi_board_info,
ARRAY_SIZE(tcw_spi_board_info));
}