[U-Boot-Users] 440EPX is not booting from 1Gb/128MB NAND flash

Stefan Roese sr at denx.de
Tue Feb 12 06:12:46 CET 2008


Hi Nikhil,

On Tuesday 12 February 2008, Nikhil Gautam wrote:
> After looking at nand_command_lp( ), I added following piece of code
> everytime I send address to NAND flash.
>
> #ifdef CFG_NAND_4_ADDR_CYCLE
>     /* Begin command latch cycle */
>     this->hwcontrol(mtd, NAND_CTL_SETCLE);
>     /* Write out the start read command */
>     this->write_byte(mtd, NAND_CMD_READSTART);
>     /* End command latch cycle */
>     this->hwcontrol(mtd, NAND_CTL_CLRCLE);
> #endif /* CFG_NAND_4_ADDR_CYCLE */
>
> This change along with the change in nand_spl padding and change in
> board configuration file defines, I got the 440EPx to boot from the
> 1Gb NAND flash.

Great.

We definitely need another config option than CFG_NAND_4_ADDR_CYCLE to select 
the 2k page NAND booting option. Thinking about it, we already have this 
option:

CFG_NAND_PAGE_SIZE

This is set to 512 for small page devices and set to 2k for large page 
devices. So the code can be "selected" via this #if statement:

#if (CFG_NAND_PAGE_SIZE > 512)

Since the difference between both nand_command() functions is quite big, I 
suggest to implement a 2nd version of this large page nand_command() 
function. Like this:

#if (CFG_NAND_PAGE_SIZE > 512)
/*
 * NAND command for large page NAND devices (2k)
 */
static int nand_command(struct mtd_info *mtd, int block, int page,
			int offs, u8 cmd)
{
	...
}
#else
/*
 * NAND command for small page NAND devices (512)
 */
static int nand_command(struct mtd_info *mtd, int block, int page,
			int offs, u8 cmd)
{
	...
}
#endif

Another questions: Is the bad page detection now working correctly?

Please provide a proper patch with the 2k NAND booting support. Take a look at 
this links for guidance:

http://www.denx.de/wiki/Training/ContributingCode
http://www.denx.de/wiki/UBoot/Patches
http://www.denx.de/wiki/UBoot/CodingStyle

Hope this helps.

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