mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] cfi_flash.c: correct calculation of region erasesize and offset for multiple (size_ratio > 1) chips in parallel
@ 2014-02-03 22:27 Cristiano De Alti
  2014-02-04  7:25 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Cristiano De Alti @ 2014-02-03 22:27 UTC (permalink / raw)
  To: barebox; +Cc: Cristiano De Alti

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] cfi_flash.c: correct calculation of region erasesize and offset for multiple (size_ratio > 1) chips in parallel
  2014-02-03 22:27 [PATCH] cfi_flash.c: correct calculation of region erasesize and offset for multiple (size_ratio > 1) chips in parallel Cristiano De Alti
@ 2014-02-04  7:25 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2014-02-04  7:25 UTC (permalink / raw)
  To: Cristiano De Alti; +Cc: barebox

On Mon, Feb 03, 2014 at 11:27:52PM +0100, Cristiano De Alti wrote:
> Signed-off-by: Cristiano De Alti <cristiano_dealti@hotmail.com>

Applied, thanks.

Sascha

> ---
>  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
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-04  7:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-03 22:27 [PATCH] cfi_flash.c: correct calculation of region erasesize and offset for multiple (size_ratio > 1) chips in parallel Cristiano De Alti
2014-02-04  7:25 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox