mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Paul Fertser <fercerpav@gmail.com>
To: barebox@lists.infradead.org
Cc: Franck JULLIEN <elec4fun@gmail.com>
Subject: [PATCH 2/2] m25p80: use proper erasesize for SECT_4K devices
Date: Thu, 15 Sep 2011 15:31:45 +0400	[thread overview]
Message-ID: <3e59cfc265c6623c3a5c6013991ed667111fc1df.1316086518.git.fercerpav@gmail.com> (raw)
In-Reply-To: <560194a56016e7562eb1e50f68a58ff6f6e069a7.1316086518.git.fercerpav@gmail.com>

This fixes a bug that causes only the first 4K out of every 64K to be
erased on SECT_4K devices.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
---
 drivers/nor/m25p80.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/nor/m25p80.c b/drivers/nor/m25p80.c
index 6f650a5..31193cf 100644
--- a/drivers/nor/m25p80.c
+++ b/drivers/nor/m25p80.c
@@ -760,7 +760,10 @@ static int m25p_probe(struct device_d *dev)
 	flash->name = (char *)id->name;
 	flash->info = info;
 	flash->size = info->sector_size * info->n_sectors;
-	flash->erasesize = info->sector_size;
+	if (info->flags & SECT_4K)
+		flash->erasesize = 4096;
+	else
+		flash->erasesize = info->sector_size;
 	flash->cdev.size = info->sector_size * info->n_sectors;
 	flash->cdev.dev = dev;
 	flash->cdev.ops = &m25p80_ops;
-- 
1.7.2.3


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

  reply	other threads:[~2011-09-15 11:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-15 11:27 [PATCH 1/2] m25p80: add additional sanity checks for erasure Paul Fertser
2011-09-15 11:31 ` Paul Fertser [this message]
2011-09-20 19:31 ` Sascha Hauer
2011-09-20 20:29   ` Paul Fertser
2011-09-29 10:28     ` Sascha Hauer

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=3e59cfc265c6623c3a5c6013991ed667111fc1df.1316086518.git.fercerpav@gmail.com \
    --to=fercerpav@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=elec4fun@gmail.com \
    /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