[U-Boot-Users] cpu/mpc8xx/spi.c broken?
David Jander
david.jander at protonic.nl
Wed Jun 2 22:16:42 CEST 2004
Hi all,
I just wanted to try to make the spi driver for the MPC8xx work and use it
together with the DS1306 RTC driver, when I came across the following
inconsistency:
The driver in cpu/mpc8xx/spi.c declares this function:
ssize_t spi_xfer (size_t count)
... and the RTC driver includes include/spi.h, where this is declared:
int spi_xfer(spi_chipsel_type chipsel, int bitlen, uchar *dout, uchar *din);
What's the point? Since cpu/mpc8xx/spi.c doesn't include spi.h, the
compilation will go all right, but it will (silently) never work!
Note: if the function in cpu/mpc8xx/spi.c is not supposed to be visible from
outside, then it should be declared static IMHO.
It looks like spi.h declares a prototype about how spi is supposed to work in
the rest of u-boot, but what about this cpu/mpc8xx/spi.c thing?
Any advice on how to get this mess fixed?
I'd like to see a common interface to SPI within u-boot, so you can either use
a hardware driver, a software (bitbang-) driver or implement your own backend
in board-support space.
cpu/mpc8xx/spi.c looks relatively generic to me (otherwise it is at the wrong
place anyway IMHO), so what about fixing it?
Greetings,
--
David Jander
Protonic Holland.
More information about the U-Boot
mailing list