public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] nand: Fix nand_erase_opts() offset check
Date: Mon, 5 Nov 2012 21:16:15 +0100 (CET)	[thread overview]
Message-ID: <832918479.587458.1352146575747.JavaMail.root@advansee.com> (raw)
In-Reply-To: <1708288193.587453.1352146546966.JavaMail.root@advansee.com>

NAND Flash is erased by blocks, not by pages.

Signed-off-by: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
---
 .../drivers/mtd/nand/nand_util.c                                   |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git u-boot-nand-flash-9c60e75.orig/drivers/mtd/nand/nand_util.c u-boot-nand-flash-9c60e75/drivers/mtd/nand/nand_util.c
index 3f11103..2855683 100644
--- u-boot-nand-flash-9c60e75.orig/drivers/mtd/nand/nand_util.c
+++ u-boot-nand-flash-9c60e75/drivers/mtd/nand/nand_util.c
@@ -80,8 +80,8 @@ int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts)
 	struct mtd_oob_ops oob_opts;
 	struct nand_chip *chip = meminfo->priv;
 
-	if ((opts->offset & (meminfo->writesize - 1)) != 0) {
-		printf("Attempt to erase non page-aligned data\n");
+	if ((opts->offset & (meminfo->erasesize - 1)) != 0) {
+		printf("Attempt to erase non block-aligned data\n");
 		return -1;
 	}
 

  reply	other threads:[~2012-11-05 20:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-05 20:15 [U-Boot] [PATCH 1/3] nand: Clean up nand_util Benoît Thébaudeau
2012-11-05 20:16 ` Benoît Thébaudeau [this message]
2012-11-16  0:23   ` [U-Boot] [U-Boot,2/3] nand: Fix nand_erase_opts() offset check Scott Wood
2012-11-19 20:40     ` Benoît Thébaudeau
2012-11-19 20:51       ` Scott Wood
2012-11-05 20:16 ` [U-Boot] [PATCH 3/3] nand: Add torture feature Benoît Thébaudeau
2012-11-06  0:03   ` Scott Wood
2012-11-16 19:20   ` [U-Boot] [PATCH v2] " Benoît Thébaudeau
2012-11-16 23:54     ` Scott Wood
2012-11-16  0:22 ` [U-Boot] [U-Boot,1/3] nand: Clean up nand_util Scott Wood
2012-11-16  0:29   ` Scott Wood
2012-11-16  7:20     ` Andreas Bießmann
2012-11-19 20:54       ` Tom Rini

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=832918479.587458.1352146575747.JavaMail.root@advansee.com \
    --to=benoit.thebaudeau@advansee.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