[U-Boot-Users] Hard SPI driver for 834x

Ben Warren bwarren at qstreams.com
Mon Jun 12 16:51:35 CEST 2006


Wolfgang and others,

I've developed a hard SPI driver for the MPC834x CPU that I'd like to
submit, but have a few questions first.  Some background information:

Unlike most QUICC-based CPUs before it, the 834x chips has a dedicated
SPI controller, instead of using an xCC port and associated DPRAM
buffers.  There are 32-bit transmit and receive registers that are
double-buffered and shifted out/in the MOSI/MISO pins.  Other chips in
the PowerQUICC II Pro family, such as the 832x and 836x, appear to have
a CPM and thus probably work much like the 82xx.

Going through the U-boot code, I found two quite different SPI
implementations, in addition to a spattering of board-specific code:
CONFIG_SPI is very EEPROM-specific, while CONFIG_SOFT_SPI is nice and
generic, but is of course bit-banged.  My application uses hard SPI, but
I want to use U-boot as a hardware debug platform so generic is good.

I propose adding CONFIG_HARD_SPI, which does nothing other than #ifdef
compile the hard driver.  I will then re-use the data structures and
commands from CONFIG_SOFT_SPI.

My questions:
1.  The /cpu directory has 'mpc83xx', while in fact there are at least
two groups of chips in this family that have quite different
peripherals.  Should I put my code here and use #ifdef CONFIG_MPC8349,
or start an 'mpc834x' branch?

2.  Where is the appropriate place to call 'spi_init()'?  In my patch,
I've placed it in /lib_ppc/board.c along with 'i2c_init()'.  Should it
instead go in board code?

3.  Should I put changes to README in the same patch, or would you
prefer a different one?  Patch size should be < 15kB, so size isn't
really an issue.

4.  More embarassingly, is there a trick to getting new files to show up
when calling 'git diff' on the u-boot tree?  I've tried 'git-add',
committing and various permutations and whatever I do, my new file
doesn't show up in the patch.  I've tried using 'diff --git', but my
version of diff (2.8.1) doesn't seem to support git.

regards,
Ben






More information about the U-Boot mailing list