[U-Boot] SPI - cs validity

Hebbar, Gururaja gururaja.hebbar at ti.com
Wed Apr 6 10:05:43 CEST 2011


Hi,

On Wed, Apr 06, 2011 at 11:22:13, Ran Shalit wrote:
> Hello,
> 
> I am trying to understand the logic behind the implementation of SPI interface, and came across a validity routine (for different baords it is about the same):
> 
> for Atmel and Davinci for example:
> 
> int spi_cs_is_valid(unsigned int bus, unsigned int cs) {  return bus == 0 && cs == 0; }
> 
> Althout atmel and davinci can have more then one spi port, it seems that they will fail in configuration if bus is different then 0.
> I wander if any one can solve this issue for me.
> 

It seems that currently both atmel & davinci boards supports only 1 spi instance at a time. 

In order to support different spi instances,
In case of atmel declare SPIx_BASE as required & set CONFIG_DEFAULT_SPI_BUS to required bus
In case of davinci set CONFIG_SYS_SPI_BASE to base address of required spi instance

Also, spi_cs_is_valid() function needs to be updated to support different spi instances. spi_cs_is_valid() function is board dependednt.

Hope this helps. 

Regards, 
Gururaja


More information about the U-Boot mailing list