Skip to contentSkip to conversation

cpu/mpc8xx/spi.c broken?

U-Boot-Users David Jander 2 participants 2 messages Jun 2, 2004

lore
Share & tools
lore
#1 lore raw
In reply to David Jander
Quoted 3 lines · In message <[email protected]> you wrote:

cpu/mpc8xx/spi.c looks relatively generic to me (otherwise it is at the wrong place anyway IMHO), so what about fixing it?

Yeah, what about it? Please go on and submit a patch.

Best regards,

Wolfgang Denk

Signature · 6 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
"Obviously, a major malfunction has occurred."
              -- Steve Nesbitt, voice of Mission Control, January 28,
                 1986, as the shuttle Challenger exploded within view
                 of the grandstands.
#0 lore raw

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,

Signature · 2 lines
David Jander
Protonic Holland.