From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Wed, 28 Nov 2007 12:00:24 +0100 Subject: [U-Boot-Users] Problem in writing downloaded image to NAND device In-Reply-To: <794354.44331.qm@web94811.mail.in2.yahoo.com> References: <794354.44331.qm@web94811.mail.in2.yahoo.com> Message-ID: <200711281200.25153.sr@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > > 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 =====================================================================