public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Victor Librado <vlibrado@bioingenieria.es>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] u-boot on nadflash for at91sam9260ek
Date: Thu, 07 Jun 2007 18:10:25 +0200	[thread overview]
Message-ID: <46682DF1.8030002@bioingenieria.es> (raw)


Hello Michel and all,

Thank you very much for your comments. By now I have the following on my 
at91sam9260ek work with nandflash:

1) In linux. Linux version 2.6.19 with maxim patches. Kernel 
configuration: at91-nand support but not CONFIG_MTD_NAND_ECC_SMC 
defined. So my Linux system is not performing ECC. In at91-nand.c is stated:

                    nand_chip->ecc.mode = NAND_ECC_SOFT;    /* enable ECC */

So the Linux version (when configured) I assume is not using the HW ECC 
at91sam9260 processor provides. It has a c file nand_ecc.c with an 
algorithm to do it by soft. This is provide in linux 2.6.21 at91 patches?
All in all, nandwrite and flash_eraseall commands work properly.

2)In u-boot. I redefined the block of the nandflash for environment 
variables :

#ifdef CFG_ENV_IS_IN_NAND
#define CFG_ENV_OFFSET  0x80000         /* environment starts here  */
#define CFG_ENV_SIZE    0x20000         /* 1 sector = 128kB */
 #endif


Now saveenv works properly! I think it was previously a bad block in my 
nandflash?

I have a doubt, if I define the soft ECC (both linux, u-boot), the OOB 
section of each page of the SAMSUNG nandflash the board has (64 bytes), 
how will it be filled? Because the nandflash datasheet states that in a 
block the first byte of the OOB section in the 1st o 2nd pages must be 
FFh or it is a bad block. So it could be that ECC data (the 4 byte hw or 
software ECC) were written in this first byte of the OOB and mark the 
block as invalid for this nandflash....... (so every write will generate 
a bad bloack?)

In u-boot the eccmode:

nand->eccmode = NAND_ECC_HW12_2048; /* NAND_ECC_SOFT;*/

What part of the OOB writes?

I'm getting really confused... any help will be welcomed.

Can ECC disabled in nandflash u-boot with some compilation option?

Best regards,

V?ctor.

/////////////////////////

Hi Victor

We have the same problem.  The u-boot 1.1.5 code from Atmel does not
correctly support the ECC correction coding in the OOB (out of bounds)
area of the nandflash when writing.  I have tried playing around with
the available settings to no avail.  When you do saveenv the data is
correctly written to nand flash but the oob area is filled with a 12
byte ECC code which makes the 5th byte in the OOB something other than
FF and thus marks the sector as bad.  The hw ECC controller of the
AT91SAM9260 is hard coded to generate a  4 byte ECC in the first 4
bytes of the OOB.  This is the ECC used by SAMBA (external pc
programming tool) and the linux at91-nand driver.  I have not found
any support for this in the Atmel u-boot code (yet).

If anyone has fixed AT91SAM9260 hw ECC support in u-boot please send
us a copy of your changes.  Even a sw ECC that generates a correct 4
byte code would be useful.

U-boot on at91sam9260 can however read from nand (i think it ignores
ECC by default) so its possible to boot an image that you have written
to nand, its just not possible to write to nand from within u-boot.  I
use either samba or linux (flash_eraseall and nandwrite) to write data
to the nandflash and fw_setenv and fw_printenv (compiled from u-boot
tools dir) to modify u-boot environment variables during development

Atmel has a port of u-boot 1.2 available on www.at91.com.  I have not
been successful it getting that version to run yet. Does anyone know
if it includes support for nandflash writes from u-boot?

Michel

 

 

 

Victor Librado Sancho
Departamento I+D
------------------------------------------------------------------------

             reply	other threads:[~2007-06-07 16:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-07 16:10 Victor Librado [this message]
2007-06-08  9:36 ` [U-Boot-Users] u-boot on nadflash for at91sam9260ek Stefan Roese
  -- strict thread matches above, loose matches on Subject: below --
2007-06-07 10:20 Michel Benoit
2007-06-06 17:32 Victor Librado
2007-06-06 19:48 ` Stefan Roese
2007-06-06 16:33 Victor Librado
2007-06-06 17:01 ` Marco Cavallini
2007-06-06 22:57 ` Chris Sharman
2007-06-07  9:55   ` Victor Librado

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=46682DF1.8030002@bioingenieria.es \
    --to=vlibrado@bioingenieria.es \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox