From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 07/12 v2] ARM: OMAP3: Add memory and syslib common files, add NAND support
Date: Tue, 7 Oct 2008 12:30:16 -0500 [thread overview]
Message-ID: <20081007173016.GB3438@loki.buserror.net> (raw)
In-Reply-To: <48EB4717.7080904@gmail.com>
On Tue, Oct 07, 2008 at 06:25:11AM -0500, Nishanth Menon wrote:
> Dirk Behme said the following on 10/07/2008 04:42 AM:
> > It doesn't differ ;)
> >
> > So I removed this and tried to use default nand_read_buf16() instead:
> >
> > nand->read_buf = nand_read_buf16;
> >
> > in board_nand_init(). But this doesn't compile as nand_read_buf16() is
> > static in nand_base.c. How do I use it in OMAP3 NAND driver? Marked it
> > as FIXME in patch.
> Probably does not need an explicit initialization, mtd nand_scan should
> populate that.
Correct, NULL methods will be filled in with defaults if applicable.
> >>> +/*
> >>> + * omap_calculate_ecc - Generate non-inverted ECC bytes.
> >>> + *
> >>> + * Using noninverted ECC can be considered ugly since writing a blank
> >>> + * page ie. padding will clear the ECC bytes. This is no problem as
> >>> + * long nobody is trying to write data on the seemingly unused page.
> >>> + * Reading an erased page will produce an ECC mismatch between
> >>> + * generated and read ECC bytes that has to be dealt with separately.
> >>
> >>
> >> Is this a hardware limitation? If so, say so in the comment. If not,
> >> why do it this way?
> >
> > Don't know.
> >
> > All: Any help?
> The issue is simple: assume we read a page of 0xFF's(fresh erased), IF
> using H/w ECC engine within GPMC, the result of read will be 0x0 while
> the ECC offsets of the spare area will be 0xFF which will result in an
> ECC mismatch.
Right, I'd just like to see an explicit statement that this is the only way
to do HW ECC that the hardware supports (following verification of that
fact, of course), along with a pointer to where in the code the ECC error
when reading an empty page is dealt with.
> >>> + .eccbytes = 12,
> >>> + .eccpos = {
> >>> + 2, 3, 4, 5,
> >>> + 6, 7, 8, 9,
> >>> + 10, 11, 12, 13},
> >>> + .oobfree = { {20, 50} } /* don't care */
> >>
> >>
> >> Bytes 64-69 of a 64-byte OOB are free?
> >> What don't we care about?
> > +static struct nand_ecclayout hw_nand_oob_64 = {
> >
> > Don't know (or understand?).
> >
> > All: Any help?
> I do not get it either.. ECCPOS is in offset bytes, and oobfree should
> be {.offset=20,.length=44} /*I always hated struct initialization done
> as above..*/, but then,
Why not offset 14, length 50?
> > We need to be able to switch ECC at runtime cause some images have to
> > be written to NAND with HW ECC and some with SW ECC. This depends on
> > what user (reader) of these parts expect.
> >
> > OMAP3 has a boot ROM which is able to read a second level loader
> > (called x-loader) from NAND and start/execute it. This 2nd level
> > loader has to be written by U-Boot using HW ECC as ROM code does HW
> > ECC to read the image. All other parts, e.g. Linux kernel, use SW ECC
> > as default. For this we have to use SW ECC to write images, then.
> >
> > Therefore we add an additional user command in cmd_nand.c to switch
> > ECC depending on what user wants to write.
> why not use h/w ecc which rom code understands in kernel and u-boot. H/w
> ecc will be faster in comparison to doing s/w ecc and there is good
> support in MTD to do it, then there would be no reason for s/w ecc IMHO..
Agreed.
-Scott
next prev parent reply other threads:[~2008-10-07 17:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-03 10:40 [U-Boot] [PATCH 07/12 v2] ARM: OMAP3: Add memory and syslib common files, add NAND support dirk.behme at googlemail.com
2008-10-03 16:52 ` Scott Wood
2008-10-03 17:08 ` Dirk Behme
2008-10-07 9:42 ` Dirk Behme
2008-10-07 11:25 ` Nishanth Menon
2008-10-07 17:30 ` Scott Wood [this message]
2008-10-07 17:45 ` Menon, Nishanth
2008-10-07 17:47 ` Scott Wood
2008-10-07 17:56 ` Dirk Behme
2008-10-07 20:47 ` Dirk Behme
2008-10-07 17:26 ` Scott Wood
2008-10-07 17:55 ` Dirk Behme
2008-10-07 17:59 ` Scott Wood
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=20081007173016.GB3438@loki.buserror.net \
--to=scottwood@freescale.com \
--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