[PATCH v5] spi: Add PPC4xx SPI driver

Steven A. Falco sfalco at harris.com
Wed Dec 10 08:48:12 EST 2008


Stefan Roese wrote:
> This adds a SPI driver for the SPI controller found in the IBM/AMCC
> 4xx PowerPC's.
> 
> Signed-off-by: Stefan Roese <sr at denx.de>
> Signed-off-by: Wolfgang Ocker <weo at reccoware.de>
> Acked-by: Josh Boyer <jwboyer at linux.vnet.ibm.com>
> ---

I have a question as to how to use this driver.  of_num_gpios() starts
testing for gpio's at num = 0, and stops at the first invalid one.
However, gpio numbers are apparently allocated dynamically from 255 down,
meaning that there probably is no gpio-0.

For example, on my Sequoia board I have gpiochip176, gpiochip192,
and gpiochip224.  So, of_num_gpios() returns zero, even though there
are 72 gpio's on my board.

This gets back to an earlier discussion about setting the gpio index
of each controller, which was rejected, IIRC.  If we could set the
base gpio of each chip, we could start at zero and use consecutive
numbers.  Failing that, it seems that Stefan's SPI driver needs to
probe the entire 0-255 gpio space.

How is this intended to work?  An example .dts would be greatly
appreciated.

	Steve



More information about the Linuxppc-dev mailing list