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: [EMAIL PROTECTED]
=====================================================================

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Reply via email to