public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] NAND issues
@ 2009-02-13 17:39 Derek Ou
  2009-02-13 20:37 ` Scott Wood
  0 siblings, 1 reply; 8+ messages in thread
From: Derek Ou @ 2009-02-13 17:39 UTC (permalink / raw)
  To: u-boot

I have a few issues/questions regarding the NAND commands in the latest 
git main tree.
1) The nand_util.c does not have WATCHDOG_RESET() in the 
nand_read_skip_bad() and nand_write_skip_bad() while the original 
nand_write_opts() and nand_read_opts() do.  Is there a special reason 
this is removed?  It's likely that watchdog will fail when trying to 
read/write large files from NAND.

2) "nand write.jffs2" used to allow writing non page-aligned data.  So 
we can have scripts like "tftp 0x22000000 u-boot.bin" and "nand 
write.jffs2 0x22000000 0x20000 $(filesize)" to automate downloading 
files to NAND.  Now, "nand write(.jffs2)" and nand_write_skip_bad() 
rejects non page-aligned write.  I think we have to either pad the 
binary file to page-aligned or re-write nand_write_skip_bad().  Is there 
another way/parameter to write non page-aligned data?

3) In common/cmd_nand.c, nand_load_image() starting at at line 492 call 
nand_read() at line 514 and line 547.  Does it mean that 
nand_load_image() will read NAND bad blocks?  Should they be 
nand_read_skip_bad() instead?  Especially, line 546 has this comment     
/* FIXME: skip bad blocks */

Thanks,
Derek

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] NAND issues
  2009-02-13 17:39 Derek Ou
@ 2009-02-13 20:37 ` Scott Wood
  0 siblings, 0 replies; 8+ messages in thread
From: Scott Wood @ 2009-02-13 20:37 UTC (permalink / raw)
  To: u-boot

On Fri, Feb 13, 2009 at 10:39:34AM -0700, Derek Ou wrote:
> 1) The nand_util.c does not have WATCHDOG_RESET() in the 
> nand_read_skip_bad() and nand_write_skip_bad() while the original 
> nand_write_opts() and nand_read_opts() do.  Is there a special reason 
> this is removed?  It's likely that watchdog will fail when trying to 
> read/write large files from NAND.

That's just an oversight -- patch welcome.

> 2) "nand write.jffs2" used to allow writing non page-aligned data.  So 
> we can have scripts like "tftp 0x22000000 u-boot.bin" and "nand 
> write.jffs2 0x22000000 0x20000 $(filesize)" to automate downloading 
> files to NAND.  Now, "nand write(.jffs2)" and nand_write_skip_bad() 
> rejects non page-aligned write.  I think we have to either pad the 
> binary file to page-aligned or re-write nand_write_skip_bad().  Is there 
> another way/parameter to write non page-aligned data?

You can't write non-page-aligned data and still generate a proper ECC. 
However, the nand command should do the padding itself.  Again, patch
welcome. :-)

> 3) In common/cmd_nand.c, nand_load_image() starting at at line 492 call 
> nand_read() at line 514 and line 547.  Does it mean that 
> nand_load_image() will read NAND bad blocks?  Should they be 
> nand_read_skip_bad() instead?  Especially, line 546 has this comment     
> /* FIXME: skip bad blocks */

Yes, it should be nand_read_skip_bad().

-Scott

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] NAND issues
@ 2009-08-12  5:30 alfred steele
  2009-08-12 19:44 ` Scott Wood
  0 siblings, 1 reply; 8+ messages in thread
From: alfred steele @ 2009-08-12  5:30 UTC (permalink / raw)
  To: u-boot

Hi All,

I have been using the "nand erase.e" command with favourable results
till now. I was enticed by the "CONFIG_JFFS2_NAND" option in the
platform config. When i turn this config option on and use the "NAND.
write.jffs2 ", and use the resulting image, i get  abnormal results
including a kernel crash.  What is the difference between a "nand
write.jffs2" and the traditional nand write.e" command? I haven't been
able to dig up on any relevant documention.
I haven't grepped through the "common" source for the NAND subsystem.

Are the commands any different , which of the commands is deprecated?
i was guessing "nand write.e" understands bad blocks whereas nand
write.jffs2" understands bad blocks as well as jffs2  internals like
cleanmarker etc.
Which one should i be using?

Thanks,
Alfred

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] NAND issues
  2009-08-12  5:30 [U-Boot] NAND issues alfred steele
@ 2009-08-12 19:44 ` Scott Wood
       [not found]   ` <528f13590908121811m5d23b0cewcc7ac572a6870c51@mail.gmail.com>
  0 siblings, 1 reply; 8+ messages in thread
From: Scott Wood @ 2009-08-12 19:44 UTC (permalink / raw)
  To: u-boot

On Wed, Aug 12, 2009 at 12:30:02AM -0500, alfred steele wrote:
> I have been using the "nand erase.e" command with favourable results
> till now. I was enticed by the "CONFIG_JFFS2_NAND" option in the
> platform config. When i turn this config option on and use the "NAND.
> write.jffs2 ", and use the resulting image, i get  abnormal results
> including a kernel crash.  What is the difference between a "nand
> write.jffs2" and the traditional nand write.e" command? I haven't been
> able to dig up on any relevant documention.
> I haven't grepped through the "common" source for the NAND subsystem.

Assuming you're talking about a recent version of u-boot, there is no
difference in any of the "nand write" suffixes.  They are maintained for
compatibility only.  They used to indicate that bad blocks should be
skipped, but we do that by default now.

> Are the commands any different , which of the commands is deprecated?
> i was guessing "nand write.e" understands bad blocks whereas nand
> write.jffs2" understands bad blocks as well as jffs2  internals like
> cleanmarker etc.

No, if you want cleanmarkers written you can use "nand erase clean".

> Which one should i be using?

Just "nand write", unless you have an old u-boot (more than a year or
so).

-Scott

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] NAND issues
       [not found]   ` <528f13590908121811m5d23b0cewcc7ac572a6870c51@mail.gmail.com>
@ 2009-08-13  1:21     ` alfred steele
  2009-08-13 15:11       ` Scott Wood
  0 siblings, 1 reply; 8+ messages in thread
From: alfred steele @ 2009-08-13  1:21 UTC (permalink / raw)
  To: u-boot

Just realised that i dis reply instead of "reply all".
> We have been using 2009.1 based version.. We have been using "nand
> read.e/write.e". Is that fine? After skimming through the u-boot code,
> it seems though.
> Please confirm.
Apart from this, what does the "CONFIG_JFFS2_NAND" do?
Thanks, Alfred.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] NAND issues
  2009-08-13  1:21     ` alfred steele
@ 2009-08-13 15:11       ` Scott Wood
  2009-08-13 22:58         ` alfred steele
  0 siblings, 1 reply; 8+ messages in thread
From: Scott Wood @ 2009-08-13 15:11 UTC (permalink / raw)
  To: u-boot

alfred steele wrote:
> Just realised that i dis reply instead of "reply all".
>> We have been using 2009.1 based version.. We have been using "nand
>> read.e/write.e". Is that fine? After skimming through the u-boot code,
>> it seems though.
>> Please confirm.
> Apart from this, what does the "CONFIG_JFFS2_NAND" do?

That controls whether the "jffs2" command supports NAND.

-Scott

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] NAND issues
  2009-08-13 15:11       ` Scott Wood
@ 2009-08-13 22:58         ` alfred steele
  2009-08-14 15:37           ` Scott Wood
  0 siblings, 1 reply; 8+ messages in thread
From: alfred steele @ 2009-08-13 22:58 UTC (permalink / raw)
  To: u-boot

> That controls whether the "jffs2" command supports NAND.
Iis it a MUST HAVE if you are using a jffs2 root filesystem? I mean do
i have to turn on "CONFIG_JFFS2_NAND" if i have a jff2 rootfs.
Are there any other configuration flags i need to turn on for JFFS2 support?
Thanks,
Alfred.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] NAND issues
  2009-08-13 22:58         ` alfred steele
@ 2009-08-14 15:37           ` Scott Wood
  0 siblings, 0 replies; 8+ messages in thread
From: Scott Wood @ 2009-08-14 15:37 UTC (permalink / raw)
  To: u-boot

On Thu, Aug 13, 2009 at 05:58:57PM -0500, alfred steele wrote:
> > That controls whether the "jffs2" command supports NAND.
> Iis it a MUST HAVE if you are using a jffs2 root filesystem? I mean do
> i have to turn on "CONFIG_JFFS2_NAND" if i have a jff2 rootfs.
> Are there any other configuration flags i need to turn on for JFFS2 support?

If you are only programming the flash from U-Boot, but are not loading
anything using the U-Boot "jffs2" command ("nand read" is OK), no.

If you're using the "jffs2" command, then presumably it is required.

-Scott

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-08-14 15:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-12  5:30 [U-Boot] NAND issues alfred steele
2009-08-12 19:44 ` Scott Wood
     [not found]   ` <528f13590908121811m5d23b0cewcc7ac572a6870c51@mail.gmail.com>
2009-08-13  1:21     ` alfred steele
2009-08-13 15:11       ` Scott Wood
2009-08-13 22:58         ` alfred steele
2009-08-14 15:37           ` Scott Wood
  -- strict thread matches above, loose matches on Subject: below --
2009-02-13 17:39 Derek Ou
2009-02-13 20:37 ` Scott Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox