[U-Boot-Users] SPI support in U-boot

Vladimir Gurevich vag at paulidav.org
Mon Jan 23 03:50:42 CET 2006


It looks like the basic SPI I/O function, spi_xfer() has two different 
prototypes in U-boot.

   1. in common/soft_spi.c, include/spi.h and cpu/nio/spi.c  it is
      declared as

       int spi_xfer(spi_chipsel_type chipsel, int bitlen, uchar *dout,
      uchar *din)

   2. in SPI drivers for MPC CPUs (cpu/mpc{8xx, 8260, 5xxx}/spi.c) it is
      declared as

       ssize_t spi_xfer (size_t count)

The code for "sspi" command (do_spi()) definitely uses the first 
prototype. Subsequently it doesn't work on the above mentioned CPUs 
(unless you use software SPI implementation).

On the other hand, the code for the "eeprom" command, which is another 
way to access an SPI EEPROM uses functions spi_read() and spi_write, 
which are implemented only in cpu/mpc{8xx, 8260, 5xxx}/spi.c. However, 
these functions are very basic. Fore example they do not allow you to 
control SPI chip select.

Can someone tell me what is going on. Is it that MPC drivers became 
outdated and should be modified? How do other people use them then? Or I 
am simply missing something?


More information about the U-Boot mailing list