public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] cfi_flash: reverse geometry for M29W800DT parts
@ 2011-04-10 20:06 Mike Frysinger
  2011-04-11  0:01 ` Marek Vasut
  2011-04-21 13:54 ` Stefan Roese
  0 siblings, 2 replies; 3+ messages in thread
From: Mike Frysinger @ 2011-04-10 20:06 UTC (permalink / raw)
  To: u-boot

The M29W800DT parts also report their geometry with the sector layout
reversed.  So add that ID to the flash_fixup_stm function.

Otherwise, we get:
bfin> flinfo

Bank # 1: CFI conformant FLASH (16 x 16)  Size: 1 MB in 19 Sectors
  AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x22D7
  Erase timeout: 8192 ms, write timeout: 1 ms

  Sector Start Addresses:
  20000000        20004000        20006000        20008000        20010000
  20020000        20030000        20040000        20050000        20060000
  20070000        20080000        20090000        200A0000        200B0000
  200C0000        200D0000        200E0000        200F0000

Reported-by: Jianxi Fu <fujianxi@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/mtd/cfi_flash.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 0909fe7..69f12d3 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -1852,9 +1852,10 @@ static void flash_fixup_stm(flash_info_t *info, struct cfi_qry *qry)
 	if (qry->num_erase_regions > 1) {
 		/* reverse geometry if top boot part */
 		if (info->cfi_version < 0x3131) {
-			/* CFI < 1.1, guess by device id (M29W320{DT,ET} only) */
-			if (info->device_id == 0x22CA ||
-			    info->device_id == 0x2256) {
+			/* CFI < 1.1, guess by device id */
+			if (info->device_id == 0x22CA || /* M29W320DT */
+			    info->device_id == 0x2256 || /* M29W320ET */
+			    info->device_id == 0x22D7) { /* M29W800DT */
 				cfi_reverse_geometry(qry);
 			}
 		}
-- 
1.7.5.rc1

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

* [U-Boot] [PATCH] cfi_flash: reverse geometry for M29W800DT parts
  2011-04-10 20:06 [U-Boot] [PATCH] cfi_flash: reverse geometry for M29W800DT parts Mike Frysinger
@ 2011-04-11  0:01 ` Marek Vasut
  2011-04-21 13:54 ` Stefan Roese
  1 sibling, 0 replies; 3+ messages in thread
From: Marek Vasut @ 2011-04-11  0:01 UTC (permalink / raw)
  To: u-boot

On Sunday 10 April 2011 22:06:29 Mike Frysinger wrote:
> The M29W800DT parts also report their geometry with the sector layout
> reversed.  So add that ID to the flash_fixup_stm function.

Maybe rework the stuff below into some table or it'll be a mess soon?

Cheers

> 
> Otherwise, we get:
> bfin> flinfo
> 
> Bank # 1: CFI conformant FLASH (16 x 16)  Size: 1 MB in 19 Sectors
>   AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x22D7
>   Erase timeout: 8192 ms, write timeout: 1 ms
> 
>   Sector Start Addresses:
>   20000000        20004000        20006000        20008000        20010000
>   20020000        20030000        20040000        20050000        20060000
>   20070000        20080000        20090000        200A0000        200B0000
>   200C0000        200D0000        200E0000        200F0000
> 
> Reported-by: Jianxi Fu <fujianxi@gmail.com>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>  drivers/mtd/cfi_flash.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
> index 0909fe7..69f12d3 100644
> --- a/drivers/mtd/cfi_flash.c
> +++ b/drivers/mtd/cfi_flash.c
> @@ -1852,9 +1852,10 @@ static void flash_fixup_stm(flash_info_t *info,
> struct cfi_qry *qry) if (qry->num_erase_regions > 1) {
>  		/* reverse geometry if top boot part */
>  		if (info->cfi_version < 0x3131) {
> -			/* CFI < 1.1, guess by device id (M29W320{DT,ET} only) */
> -			if (info->device_id == 0x22CA ||
> -			    info->device_id == 0x2256) {
> +			/* CFI < 1.1, guess by device id */
> +			if (info->device_id == 0x22CA || /* M29W320DT */
> +			    info->device_id == 0x2256 || /* M29W320ET */
> +			    info->device_id == 0x22D7) { /* M29W800DT */
>  				cfi_reverse_geometry(qry);
>  			}
>  		}

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

* [U-Boot] [PATCH] cfi_flash: reverse geometry for M29W800DT parts
  2011-04-10 20:06 [U-Boot] [PATCH] cfi_flash: reverse geometry for M29W800DT parts Mike Frysinger
  2011-04-11  0:01 ` Marek Vasut
@ 2011-04-21 13:54 ` Stefan Roese
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Roese @ 2011-04-21 13:54 UTC (permalink / raw)
  To: u-boot

On Sunday 10 April 2011 22:06:29 Mike Frysinger wrote:
> The M29W800DT parts also report their geometry with the sector layout
> reversed.  So add that ID to the flash_fixup_stm function.
> 
> Otherwise, we get:
> bfin> flinfo
> 
> Bank # 1: CFI conformant FLASH (16 x 16)  Size: 1 MB in 19 Sectors
>   AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x22D7
>   Erase timeout: 8192 ms, write timeout: 1 ms
> 
>   Sector Start Addresses:
>   20000000        20004000        20006000        20008000        20010000
>   20020000        20030000        20040000        20050000        20060000
>   20070000        20080000        20090000        200A0000        200B0000
>   200C0000        200D0000        200E0000        200F0000

Applied to u-boot-cfi-flash/master. Thanks.
 
Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

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

end of thread, other threads:[~2011-04-21 13:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-10 20:06 [U-Boot] [PATCH] cfi_flash: reverse geometry for M29W800DT parts Mike Frysinger
2011-04-11  0:01 ` Marek Vasut
2011-04-21 13:54 ` Stefan Roese

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