I am reading only 0x00 in ECSPI RXDATA register.
I am using iMX6 with BSP 4.1.0. Kernel version 3.0.35.
I am using spidev4.2 as master and mode =0.
I can see that SCK and MOSI are sending out correct data.
I can also see correct data in MISO line.
But the RXDATA register always reads 0. I put a printk in spi_imx_buf_rx_##type in spi_imx.c file.
#define MXC_SPI_BUF_RX(type) \
static void spi_imx_buf_rx_##type(struct spi_imx_data *spi_imx) \
{ \
unsigned int val = readl(spi_imx->base + MXC_CSPIRXDATA); \
printk(KERN_INFO"%s: %s: %d: rxdata = %u\n", __FILE__, __func__, __LINE__, val); \ \
if (spi_imx->rx_buf) { \
*(type *)spi_imx->rx_buf = val; \
spi_imx->rx_buf += sizeof(type); \
} \
}
Val always prints 0.
I am not able to figure out why.
I am send two bytes. 1st is command and 2nd byte is dummy(0x00). On sending the second byte I can see the correct response on MISO line but it doesn’t reflect in RXDATA register.
I am doing 16 bits-per-word burst transfer. Since one command-response sequence takes 2 bytes.
I did multiple 16bpw transfer. But still I read only 0x00 in RXDATA register.
Request some help for me.
Thanks!