All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] 440EPX is not booting from 1Gb/128MB NAND flash
Date: Tue, 12 Feb 2008 06:12:46 +0100	[thread overview]
Message-ID: <200802120612.46861.sr@denx.de> (raw)
In-Reply-To: <e9eeaac20802111716y3b33fa39g4a02aed1167f52e9@mail.gmail.com>

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
=====================================================================

  reply	other threads:[~2008-02-12  5:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-07  0:36 440EPX is not booting from 1Gb/128MB NAND flash Nikhil Gautam
2008-02-07  0:38 ` [U-Boot-Users] " Nikhil Gautam
2008-02-07  5:24   ` Stefan Roese
2008-02-07 23:46     ` Nikhil Gautam
2008-02-08  4:50       ` Stefan Roese
2008-02-08 22:57         ` Nikhil Gautam
2008-02-09  5:51           ` Stefan Roese
2008-02-11 14:43           ` Nikhil Gautam
2008-02-11 16:26             ` Stefan Roese
2008-02-12  1:16               ` Nikhil Gautam
2008-02-12  5:12                 ` Stefan Roese [this message]
2008-02-12  6:02                   ` Wolfgang Denk
2008-02-12  6:11                     ` Stefan Roese
2008-02-12 22:31                       ` Wolfgang Denk
2008-02-13 23:16                         ` Nikhil Gautam
2008-02-14  5:36                           ` Stefan Roese

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200802120612.46861.sr@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.