mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Cristiano De Alti <cristiano_dealti@hotmail.com>
To: barebox@lists.infradead.org
Cc: Cristiano De Alti <cristiano_dealti@hotmail.com>
Subject: [PATCH] cfi_flash.c: correct calculation of region erasesize and offset for multiple (size_ratio > 1) chips in parallel
Date: Mon, 3 Feb 2014 23:27:52 +0100	[thread overview]
Message-ID: <BLU0-SMTP17431D5E93FD5424E6A8C41F7AB0@phx.gbl> (raw)

Signed-off-by: Cristiano De Alti <cristiano_dealti@hotmail.com>
---
 drivers/mtd/nor/cfi_flash.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nor/cfi_flash.c b/drivers/mtd/nor/cfi_flash.c
index 71dd3c8..514eab5 100644
--- a/drivers/mtd/nor/cfi_flash.c
+++ b/drivers/mtd/nor/cfi_flash.c
@@ -404,9 +404,9 @@ static ulong flash_get_size (struct flash_info *info)
 				erase_region_count, erase_region_size);
 
 			region->offset = cur_offset;
-			region->erasesize = erase_region_size;
+			region->erasesize = erase_region_size * size_ratio;
 			region->numblocks = erase_region_count;
-			cur_offset += erase_region_size * erase_region_count;
+			cur_offset += erase_region_size * size_ratio * erase_region_count;
 
 			/* increase the space malloced for the sector start addresses */
 			info->start = xrealloc(info->start, sizeof(ulong) * (erase_region_count + sect_cnt));
-- 
1.7.10.4


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

             reply	other threads:[~2014-02-03 22:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-03 22:27 Cristiano De Alti [this message]
2014-02-04  7:25 ` 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=BLU0-SMTP17431D5E93FD5424E6A8C41F7AB0@phx.gbl \
    --to=cristiano_dealti@hotmail.com \
    --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