[U-Boot-Users] Problem in writing downloaded image to NAND device

Stefan Roese sr at denx.de
Wed Nov 28 12:00:24 CET 2007


On Wednesday 28 November 2007, Dharmosoth Seetharam wrote:
> I have one doubt in NAND write/read PATH.
>
> > >  nand_write() --> nand_write_ecc() -->
> > >  nand_write_page() --> nand_write_buf() -->
> > >
> > >
> > >  in nand_write_buf() :
> > >
> > >  for (i=0; i<len; i++) {
> > >       writeb(buf[i], this->IO_ADDR_W);
> > >
> > > << writeb is defined as
> > >    (*(volatile unsigned char *)(a) = (v)) >>
>
> How can be "n" (where n=len) characters are
> going to written this->IO_ADDR_W.
>
>
> As per the above fro loop, I am getting confuse
> that is - for each character from buf ( ie. buf[i])
> the dest. address will be the same. So, there will be
> a overwriting to the same dest. address in NAND.
>
> Is there any logic behind this stmt ??

Yes. This is the way is supposed to work. NAND FLASH chips don't have a "flat 
address" model like NOR chips do. They don't have address signals at all. You 
have to write the address using the data signals before writing the data 
itself. This is done in conjunction with some control signals. So the data 
signals are in reality multiplexed address/data pins.

> Please suggest me the right way to understand the
> NAND write PATH from U-Boot code.

I suggest you take a look at a NAND chip data sheet to understand how NAND 
chips are used.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================




More information about the U-Boot mailing list