[PATCH] cfi_flash.c: correct calculation of region erasesize and offset for multiple (size_ratio > 1) chips in parallel
Cristiano De Alti
cristiano_dealti at hotmail.com
Mon Feb 3 17:27:52 EST 2014
Signed-off-by: Cristiano De Alti <cristiano_dealti at 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
More information about the barebox
mailing list