Thanks for your response. I was going through the code and understanding the things. Can you please help me with the following:
1. As CONFIG_SPI_SLAVE is added in kernel from kernel version V4.13-rc1 (v4.13-rc1) and I am using the older kernel version V4.1.15 - do I need to add any patch in the kernel (to support the slave mode in the kernel). In case we do have to add patch - can you please share the patch.
2. Can you please help me with the device tree node sample, for making Linux side controller ( ecspi ) as the slave
3. Also, once the Linux side controller is the slave, how can an userspace application get an idea, when the data is being received and how to find the amount of data being received - I mean master can send any random amount of data ( I believe MXC_INT_RR is received and mx51_ecspi_rx_available will be called in the driver for every 32 bits data received - is my understanding correct )