mpc5200b configure nand driver via dts

Wolfgang Grandegger wg at grandegger.com
Tue Jan 13 02:59:21 EST 2009


Grant Likely wrote:
> On Mon, Jan 12, 2009 at 2:07 AM,  <florian.belser at freenet.de> wrote:
>> hello,
>>
>> I have some problems with an mpc5200b based board. It's nearly compatible to
>> the lite5200b board.
>> I connected an samsung k9k8g08u0a nand flash via the lpb bus. This works
>> fine with an self written nand driver.
>> Now I try to use the standard nand driver from linux and configure it via
>> the dts file. But this doesn't work and I get
>> the following output:
>>
>>   nand at 1,0 {  //cs1
>>    compatible = "samsung, k9k8g08u08", "cfi-flash";
>                                           ^^^^^^^^^
> 
> NAND Flash is not a CFI flash device.  The cfi-flash driver won't work with it.
> 
>> Now my questions are:
>>  Is there any error in the dts configuration?
>>  Is it principle posible to configure a nand flash via the dts file (in
>> combination with mpc5200b)?
> 
> It is possible to *describe* the NAND flash via the dts file.  The dts
> file doesn't configure anything.  It just describes the hardware
> layout so that you can write or bind the appropriate driver to the
> device.  I don't know if a device tree binding has been defined for
> NAND flash yet.

I find 3 MTD NAND drivers with OF bindings in linux-2.6/drivers/mtd/nand

  $ grep -l of_device *.c
  fsl_elbc_nand.c
  fsl_upm.c
  pasemi_nand.c

The bindings for the FSL UPM are described in
http://lxr.linux.no/linux+v2.6.28/Documentation/powerpc/dts-bindings/fsl/upm-nand.txt.
Something similar is needed for his board (NAND connected to lpb) as well.

>>  I read in some forums that the nand flash must be activated in the u-boot
>> before it can be configured via dts.
> 
> You definitely need to set up the CS line for the NAND before using it
> in Linux.  Typically this is done in U-Boot, but in a pinch it can be
> done in the platform support code (arch/powerpc/platforms/52xx/*)

Yep, and also the R/B pin should be handled somehow, preferably using
the OF GPIO interface.

Wolfgang.



More information about the Linuxppc-dev mailing list