mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 5/5] nand omap: handle erased pages correctly in hamming ecc mode
Date: Mon, 11 Apr 2011 16:10:36 +0200	[thread overview]
Message-ID: <1302531036-27906-6-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1302531036-27906-1-git-send-email-s.hauer@pengutronix.de>

do not throw ecc errors on erased pages.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mtd/nand/nand_omap_gpmc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c
index d61f7d9..9d375aa 100644
--- a/drivers/mtd/nand/nand_omap_gpmc.c
+++ b/drivers/mtd/nand/nand_omap_gpmc.c
@@ -377,6 +377,11 @@ static int omap_correct_data(struct mtd_info *mtd, uint8_t *dat,
 
 	switch (oinfo->ecc_mode) {
 	case OMAP_ECC_HAMMING_CODE_HW_ROMCODE:
+		if (read_ecc[0] == 0xff && read_ecc[1] == 0xff &&
+				read_ecc[2] == 0xff && calc_ecc[0] == 0x0 &&
+				calc_ecc[1] == 0x0 && calc_ecc[0] == 0x0)
+			break;
+
 		/* Regenerate the orginal ECC */
 		orig_ecc = gen_true_ecc(read_ecc);
 		new_ecc = gen_true_ecc(calc_ecc);
-- 
1.7.2.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2011-04-11 14:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-11 14:10 omap nand patches Sascha Hauer
2011-04-11 14:10 ` [PATCH 1/5] nand omap: fix hamming romcode ecc code Sascha Hauer
2011-04-11 14:10 ` [PATCH 2/5] nand omap: turn debug messages into dev_dbg Sascha Hauer
2011-04-11 14:10 ` [PATCH 3/5] nand omap: use standard debug functions Sascha Hauer
2011-04-11 14:10 ` [PATCH 4/5] nand omap: use xzalloc instead of calloc Sascha Hauer
2011-04-11 14:10 ` Sascha Hauer [this message]

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=1302531036-27906-6-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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