public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] CFI: Add geometry reversal for STMicro M29W320ET
@ 2009-01-13 17:31 Richard Retanubun
  2009-01-13 22:15 ` Mike Frysinger
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Retanubun @ 2009-01-13 17:31 UTC (permalink / raw)
  To: u-boot

Added flash_fixup_stm to fix geometry reversal on
STMicro M29W320ET flash chip.

Signed-off-by: Richard Retanubun <RichardRetanubun@RuggedCom.com>
---

Added flash_fixup_stm to fix geometry reversal on STMicro M29W320ET flash chip.

Modeled after flash_fixup_amd. this patch handles the geometry reversal 
or erase sectors that exist for ST Micro (now Numonyx) M29W320ET flash. 
Since I cannot test all STM's chips, the detection is implemented as 
narrow as possible for now.

Any feedback is appreciated.

 drivers/mtd/cfi_flash.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index e8afe99..7ece71c 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -1795,6 +1795,20 @@ static void flash_fixup_atmel(flash_info_t *info, struct cfi_qry *qry)
 		cfi_reverse_geometry(qry);
 }
 
+static void flash_fixup_stm(flash_info_t *info, struct cfi_qry *qry)
+{
+	/* check if flash geometry needs reversal */
+	if (qry->num_erase_regions > 1) {
+		/* reverse geometry if top boot part */
+		if (info->cfi_version < 0x3131) {
+			/* CFI < 1.1, guess by device id (only M29W320ET now) */
+			if (info->device_id == 0x2256) {
+				cfi_reverse_geometry(qry);
+			}
+		}
+	}
+}
+
 /*
  * The following code cannot be run from FLASH!
  *
@@ -1868,6 +1882,9 @@ ulong flash_get_size (ulong base, int banknum)
 		case 0x001f:
 			flash_fixup_atmel(info, &qry);
 			break;
+		case 0x0020:
+			flash_fixup_stm(info, &qry);
+			break;
 		}
 
 		debug ("manufacturer is %d\n", info->vendor);
-- 
1.5.6.5

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

* [U-Boot] [PATCH] CFI: Add geometry reversal for STMicro M29W320ET
  2009-01-13 17:31 [U-Boot] [PATCH] CFI: Add geometry reversal for STMicro M29W320ET Richard Retanubun
@ 2009-01-13 22:15 ` Mike Frysinger
  2009-01-14 11:55   ` Stefan Roese
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2009-01-13 22:15 UTC (permalink / raw)
  To: u-boot

On Tuesday 13 January 2009 12:31:46 Richard Retanubun wrote:
> Added flash_fixup_stm to fix geometry reversal on
> STMicro M29W320ET flash chip.
>
> Signed-off-by: Richard Retanubun <RichardRetanubun@RuggedCom.com>
> ---
>
> Added flash_fixup_stm to fix geometry reversal on STMicro M29W320ET flash
> chip.
>
> Modeled after flash_fixup_amd. this patch handles the geometry reversal
> or erase sectors that exist for ST Micro (now Numonyx) M29W320ET flash.
> Since I cannot test all STM's chips, the detection is implemented as
> narrow as possible for now.

this comment should be above the --- and in the changelog imo
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090113/40b8702b/attachment.pgp 

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

* [U-Boot] [PATCH] CFI: Add geometry reversal for STMicro M29W320ET
  2009-01-13 22:15 ` Mike Frysinger
@ 2009-01-14 11:55   ` Stefan Roese
  2009-01-14 13:44     ` [U-Boot] [PATCH V2] " Richard Retanubun
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Roese @ 2009-01-14 11:55 UTC (permalink / raw)
  To: u-boot

On Tuesday 13 January 2009, Mike Frysinger wrote:
> On Tuesday 13 January 2009 12:31:46 Richard Retanubun wrote:
> > Added flash_fixup_stm to fix geometry reversal on
> > STMicro M29W320ET flash chip.
> >
> > Signed-off-by: Richard Retanubun <RichardRetanubun@RuggedCom.com>
> > ---
> >
> > Added flash_fixup_stm to fix geometry reversal on STMicro M29W320ET flash
> > chip.
> >
> > Modeled after flash_fixup_amd. this patch handles the geometry reversal
> > or erase sectors that exist for ST Micro (now Numonyx) M29W320ET flash.
> > Since I cannot test all STM's chips, the detection is implemented as
> > narrow as possible for now.
>
> this comment should be above the --- and in the changelog imo

ACK. Richard, please resend with this additional description in the main 
commit text.

Thanks.

Best regards,
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] 5+ messages in thread

* [U-Boot] [PATCH V2] CFI: Add geometry reversal for STMicro M29W320ET
  2009-01-14 11:55   ` Stefan Roese
@ 2009-01-14 13:44     ` Richard Retanubun
  2009-01-26 10:00       ` Stefan Roese
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Retanubun @ 2009-01-14 13:44 UTC (permalink / raw)
  To: u-boot

Added flash_fixup_stm to fix geometry reversal on STMicro M29W320ET flash chip.

Modeled after flash_fixup_amd, this patch handles the geometry reversal 
or erase sectors that exist for ST Micro (now Numonyx) M29W320ET flash. 
Since I cannot test all STM's chips, the detection is implemented as 
narrow as possible for now.

Signed-off-by: Richard Retanubun <RichardRetanubun@RuggedCom.com>

---

 drivers/mtd/cfi_flash.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index e8afe99..7ece71c 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -1795,6 +1795,20 @@ static void flash_fixup_atmel(flash_info_t *info, struct cfi_qry *qry)
 		cfi_reverse_geometry(qry);
 }
 
+static void flash_fixup_stm(flash_info_t *info, struct cfi_qry *qry)
+{
+	/* check if flash geometry needs reversal */
+	if (qry->num_erase_regions > 1) {
+		/* reverse geometry if top boot part */
+		if (info->cfi_version < 0x3131) {
+			/* CFI < 1.1, guess by device id (only M29W320ET now) */
+			if (info->device_id == 0x2256) {
+				cfi_reverse_geometry(qry);
+			}
+		}
+	}
+}
+
 /*
  * The following code cannot be run from FLASH!
  *
@@ -1868,6 +1882,9 @@ ulong flash_get_size (ulong base, int banknum)
 		case 0x001f:
 			flash_fixup_atmel(info, &qry);
 			break;
+		case 0x0020:
+			flash_fixup_stm(info, &qry);
+			break;
 		}
 
 		debug ("manufacturer is %d\n", info->vendor);
-- 
1.5.6.5

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

* [U-Boot] [PATCH V2] CFI: Add geometry reversal for STMicro M29W320ET
  2009-01-14 13:44     ` [U-Boot] [PATCH V2] " Richard Retanubun
@ 2009-01-26 10:00       ` Stefan Roese
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Roese @ 2009-01-26 10:00 UTC (permalink / raw)
  To: u-boot

On Wednesday 14 January 2009, Richard Retanubun wrote:
> Added flash_fixup_stm to fix geometry reversal on STMicro M29W320ET flash
> chip.
>
> Modeled after flash_fixup_amd, this patch handles the geometry reversal
> or erase sectors that exist for ST Micro (now Numonyx) M29W320ET flash.
> Since I cannot test all STM's chips, the detection is implemented as
> narrow as possible for now.
>
> Signed-off-by: Richard Retanubun <RichardRetanubun@RuggedCom.com>

Applied to u-boot/master. Thanks

Best regards,
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] 5+ messages in thread

end of thread, other threads:[~2009-01-26 10:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-13 17:31 [U-Boot] [PATCH] CFI: Add geometry reversal for STMicro M29W320ET Richard Retanubun
2009-01-13 22:15 ` Mike Frysinger
2009-01-14 11:55   ` Stefan Roese
2009-01-14 13:44     ` [U-Boot] [PATCH V2] " Richard Retanubun
2009-01-26 10:00       ` Stefan Roese

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