public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: dirk.behme at googlemail.com <dirk.behme@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH-OMAP3] OMAP3: Fix broken NAND ECC HW switch
Date: Tue, 11 Nov 2008 16:00:37 +0100	[thread overview]
Message-ID: <49199e1e.0f975e0a.3942.ffff903a@mx.google.com> (raw)

Fix broken NAND ECC HW switch and invert logic of if(!hardware) for easier
reading.

---
 drivers/mtd/nand/omap_gpmc.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

Index: u-boot-arm/drivers/mtd/nand/omap_gpmc.c
===================================================================
--- u-boot-arm.orig/drivers/mtd/nand/omap_gpmc.c
+++ u-boot-arm/drivers/mtd/nand/omap_gpmc.c
@@ -255,12 +255,17 @@ void omap_nand_switch_ecc(int32_t hardwa
 	nand->options = NAND_NO_PADDING | NAND_CACHEPRG | NAND_NO_AUTOINCR |
 			NAND_NO_AUTOINCR;
 
+	/* Reset ecc interface */
+	nand->ecc.read_page = NULL;
+	nand->ecc.write_page = NULL;
+	nand->ecc.read_oob = NULL;
+	nand->ecc.write_oob = NULL;
+	nand->ecc.hwctl = NULL;
+	nand->ecc.correct = NULL;
+	nand->ecc.calculate = NULL;
+
 	/* Setup the ecc configurations again */
-	if (!hardware) {
-		nand->ecc.mode = NAND_ECC_SOFT;
-		/* Use mtd default settings */
-		nand->ecc.layout = NULL;
-	} else {
+	if (hardware) {
 		nand->ecc.mode = NAND_ECC_HW;
 		nand->ecc.layout = &hw_nand_oob;
 		nand->ecc.size = 512;
@@ -269,6 +274,12 @@ void omap_nand_switch_ecc(int32_t hardwa
 		nand->ecc.correct = omap_correct_data;
 		nand->ecc.calculate = omap_calculate_ecc;
 		omap_hwecc_init(nand);
+		printf("HW ECC selected\n");
+	} else {
+		nand->ecc.mode = NAND_ECC_SOFT;
+		/* Use mtd default settings */
+		nand->ecc.layout = NULL;
+		printf("SW ECC selected\n");
 	}
 
 	/* Update NAND handling after ECC mode switch */

             reply	other threads:[~2008-11-11 15:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-11 15:00 dirk.behme at googlemail.com [this message]
2008-11-11 15:53 ` [U-Boot] [PATCH-OMAP3] OMAP3: Fix broken NAND ECC HW switch Jean-Christophe PLAGNIOL-VILLARD
2008-11-11 21:04 ` Scott Wood
  -- strict thread matches above, loose matches on Subject: below --
2008-11-11 16:03 dirk.behme at googlemail.com
2008-11-14 17:11 ` Jean-Christophe PLAGNIOL-VILLARD

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=49199e1e.0f975e0a.3942.ffff903a@mx.google.com \
    --to=dirk.behme@googlemail.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