From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v6 2/8] lpc32xx: mtd: nand: add MLC NAND controller
Date: Thu, 19 Mar 2015 16:39:42 -0500 [thread overview]
Message-ID: <1426801182.27998.170.camel@freescale.com> (raw)
In-Reply-To: <1426669491-13878-3-git-send-email-albert.aribaud@3adev.fr>
On Wed, 2015-03-18 at 10:04 +0100, Albert ARIBAUD (3ADEV) wrote:
> +int nand_spl_load_image(uint32_t offs, unsigned int size, void *dst)
> +{
> + int block_good;
bool?
> + struct lpc32xx_oob oob;
> + unsigned int page, left;
> +
> + /* if starting mid-block consider block good */
> + block_good = 1;
> +
> + for (page = offs / BYTES_PER_PAGE,
> + left = DIV_ROUND_UP(size, BYTES_PER_PAGE);
> + left && (page < PAGES_PER_CHIP_MAX); page++) {
> + /* read inband and oob page data anyway */
> + int res = read_single_page(dst, page, &oob);
> + /* return error if a good block's page was not readable */
> + if ((res < 0) && block_good)
> + return -1;
Why even try to read it if it's been marked bad?
> + /* if first page in a block, update 'block good' status */
The non-SPL driver appears to be checking the last two pages in the
block, not the first page.
> + if ((page % PAGES_PER_BLOCK) == 0) {
> + /* assume block is good */
> + block_good = 1;
> + /* if page could not be read, assume block is bad */
> + if (res < 0)
> + block_good = 0;
No. A block is to be skipped if and only if it has a bad block marker.
ECC errors should not be silently ignored just because they happen on
the first page of a block. If the writer of this data didn't skip the
block, then skipping it when reading will result in unusable data
regardless of the underlying ECC problem.
-Scott
next prev parent reply other threads:[~2015-03-19 21:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-18 9:04 [U-Boot] [PATCH v6 0/8] Extend LPC32xx functionality and add LPC32xx-based work_92015 board Albert ARIBAUD
2015-03-18 9:04 ` [U-Boot] [PATCH v6 1/8] lpc32xx: add Ethernet support Albert ARIBAUD
2015-03-18 9:04 ` [U-Boot] [PATCH v6 2/8] lpc32xx: mtd: nand: add MLC NAND controller Albert ARIBAUD
2015-03-18 9:04 ` [U-Boot] [PATCH v6 3/8] lpc32xx: i2c: add LPC32xx I2C interface support Albert ARIBAUD
2015-03-18 9:04 ` [U-Boot] [PATCH v6 4/8] lpc32xx: add GPIO support Albert ARIBAUD
2015-03-18 9:04 ` [U-Boot] [PATCH v6 5/8] lpc32xx: add LPC32xx SSP support (SPI mode) Albert ARIBAUD
2015-03-18 9:04 ` [U-Boot] [PATCH v6 6/8] dtt: add ds620 support Albert ARIBAUD
2015-03-18 9:04 ` [U-Boot] [PATCH v6 7/8] lpc32xx: add lpc32xx-spl.bin boot image target Albert ARIBAUD
2015-03-18 9:04 ` [U-Boot] [PATCH v6 8/8] lpc32xx: add support for board work_92105 Albert ARIBAUD
2015-03-30 6:30 ` [U-Boot] [PATCH v6 5/8] lpc32xx: add LPC32xx SSP support (SPI mode) Jagan Teki
2015-03-19 21:39 ` Scott Wood [this message]
2015-03-20 9:35 ` [U-Boot] [PATCH v6 2/8] lpc32xx: mtd: nand: add MLC NAND controller Albert ARIBAUD
2015-03-20 22:41 ` Scott Wood
2015-03-23 8:45 ` Albert ARIBAUD
2015-03-24 1:20 ` Scott Wood
2015-03-24 14:12 ` Albert ARIBAUD
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=1426801182.27998.170.camel@freescale.com \
--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