public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
* STRATA v2 buffered programming fix
@ 2009-10-16  8:34 Edgar Grimberg
  2009-10-16 14:50 ` Bart Veer
  0 siblings, 1 reply; 5+ messages in thread
From: Edgar Grimberg @ 2009-10-16  8:34 UTC (permalink / raw)
  To: ecos-patches

[-- Attachment #1: Type: text/plain, Size: 310 bytes --]

Hi,

The attached patch makes the STRATA buffered programming algorithm
write the word count to the flash.
Also, it fixes a compilation issue in the diagnostics output.

Regards,
Edgar

-- 
Edgar Grimberg
System Developer
Zylin AS
ZY1000 JTAG Debugger http://www.zylin.com/zy1000.html
Phone: (+47) 51 63 25 00

[-- Attachment #2: strata_v2_patch.txt --]
[-- Type: text/plain, Size: 1698 bytes --]

Index: current/src/strata_aux.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/stratav2/current/src/strata_aux.c,v
retrieving revision 1.2
diff -u -r1.2 strata_aux.c
--- current/src/strata_aux.c	29 Jan 2009 17:48:27 -0000	1.2
+++ current/src/strata_aux.c	16 Oct 2009 08:27:26 -0000
@@ -234,7 +234,7 @@
     int             result  = CYG_FLASH_ERR_OK;
     int             retries;
 
-    sf_diag("addr %08x fc %d\n",addr, first_call);
+    sf_diag("addr %08x \n",addr);
     // Start the erase operation
     addr[0] = STRATA_COMMAND_CLEAR_STATUS;
     addr[0] = STRATA_COMMAND_ERASE;
@@ -350,7 +350,7 @@
     } while ((--retries > 0) && ((status & STRATA_STATUS_SR7) != STRATA_STATUS_SR7));
     
     // Now issue the count, data, and confirm the operation
-    addr[0]   = STRATA_SWAP(STRATA_PARALLEL((count - 1)));
+    addr[0]   = STRATA_SWAP(STRATA_PARALLEL(count));
     for( i = 0 ; i < count ; i++ )    
     {
         STRATA_TYPE val = STRATA_NEXT_DATUM(buf);
Index: current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/stratav2/current/ChangeLog,v
retrieving revision 1.7
diff -u -r1.7 ChangeLog
--- current/ChangeLog	21 Apr 2009 15:40:08 -0000	1.7
+++ current/ChangeLog	16 Oct 2009 08:27:26 -0000
@@ -1,3 +1,9 @@
+2009-10-16  Edgar Grimberg  <edgar.grimberg@zylin.com>
+
+	* src/strata_aux.c: Modified the word count to be written on the 
+	flash to match the number of words. 
+	Fixed the diagnostic output. 
+
 2009-04-21  Bart Veer  <bartv@ecoscentric.com>
 
 	* src/strata.c: Added set of parentheses around macro parameters

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

* Re: STRATA v2 buffered programming fix
  2009-10-16  8:34 STRATA v2 buffered programming fix Edgar Grimberg
@ 2009-10-16 14:50 ` Bart Veer
  2009-10-16 15:09   ` Edgar Grimberg
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Veer @ 2009-10-16 14:50 UTC (permalink / raw)
  To: Edgar Grimberg; +Cc: ecos-patches

>>>>> "Edgar" == Edgar Grimberg <edgar.grimberg@zylin.com> writes:

    Edgar> The attached patch makes the STRATA buffered programming
    Edgar> algorithm write the word count to the flash. Also, it fixes
    Edgar> a compilation issue in the diagnostics output.

@@ -350,7 +350,7 @@
     } while ((--retries > 0) && ((status & STRATA_STATUS_SR7) != STRATA_STATUS_SR7));
     
     // Now issue the count, data, and confirm the operation
-    addr[0]   = STRATA_SWAP(STRATA_PARALLEL((count - 1)));
+    addr[0]   = STRATA_SWAP(STRATA_PARALLEL(count));
     for( i = 0 ; i < count ; i++ )    
     {
         STRATA_TYPE val = STRATA_NEXT_DATUM(buf);

Are you sure about this? A quick look at a Strata datasheet (28F640K3)
shows the following:

  "Next, a word count (actual word count - 1) is written to the device
  at the buffer address. This tells the device how many data words
  will be written to the write buffer, up to the maximum size of the
  write buffer. The valid range of values for word count is 0x00 to
  0x1F."

So the (count - 1) in the current code looks right to me.  

Bart

-- 
Bart Veer                                   eCos Configuration Architect
eCosCentric Limited    The eCos experts      http://www.ecoscentric.com/
Barnwell House, Barnwell Drive, Cambridge, UK.      Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.

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

* Re: STRATA v2 buffered programming fix
  2009-10-16 14:50 ` Bart Veer
@ 2009-10-16 15:09   ` Edgar Grimberg
  2009-10-16 17:01     ` Kurt Siedenburg
  0 siblings, 1 reply; 5+ messages in thread
From: Edgar Grimberg @ 2009-10-16 15:09 UTC (permalink / raw)
  To: Bart Veer; +Cc: ecos-patches

>
> Are you sure about this? A quick look at a Strata datasheet (28F640K3)
> shows the following:

You are right. My documentation was not that clear. As a word of
warning for the searchers, the Numonyx StrataFlash Embedded Memory (P30)
downloadable from
http://www.numonyx.com/en-US/MemoryProducts/NOR/Pages/P30P33Documents.aspx
has this information on Figure 36: Buffer Program Flowchart:

Data = N-1 = Word Count
N = 0 corresponds to count = 1

Thanks for pointing it out.

Edgar



>
>  "Next, a word count (actual word count - 1) is written to the device
>  at the buffer address. This tells the device how many data words
>  will be written to the write buffer, up to the maximum size of the
>  write buffer. The valid range of values for word count is 0x00 to
>  0x1F."
>
> So the (count - 1) in the current code looks right to me.
>
> Bart
>
> --
> Bart Veer                                   eCos Configuration Architect
> eCosCentric Limited    The eCos experts      http://www.ecoscentric.com/
> Barnwell House, Barnwell Drive, Cambridge, UK.      Tel: +44 1223 245571
> Registered in England and Wales: Reg No 4422071.
>



-- 
Edgar Grimberg
System Developer
Zylin AS
ZY1000 JTAG Debugger http://www.zylin.com/zy1000.html
Phone: (+47) 51 63 25 00

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

* RE: STRATA v2 buffered programming fix
  2009-10-16 15:09   ` Edgar Grimberg
@ 2009-10-16 17:01     ` Kurt Siedenburg
  2009-10-19 11:05       ` Edgar Grimberg
  0 siblings, 1 reply; 5+ messages in thread
From: Kurt Siedenburg @ 2009-10-16 17:01 UTC (permalink / raw)
  To: Edgar Grimberg, Bart Veer; +Cc: ecos-patches

Edgar,
  a while ago I got Nymonyx 65nm P30 chips as a replacement for older
Strata chips.  One problem I encountered is an incompatibility to its
predecessors:  The buffer size for programmed operations has increased
to 512 words (that's not yet incompatible).  However you can only use
the full buffer size if it is naturally aligned.

The datasheet reads

"The maximum buffer size would be 256-word if the misaligned address
range is crossing a 512-word boundary during programming."

Maybe this is the source of your troubles.
It definitly took me a while to find this piece of information.

I had suggested a patch for this issue a while back (Mar 5/6 2009) on
this list.
I didn't check/follow up on it to see if it ever made it to the
repository.

I recall vaguely that someone else contributed another patch in this
area sometime later.
Maybe that patch addresses the issue above as well.

Best,
  Kurt

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

* Re: STRATA v2 buffered programming fix
  2009-10-16 17:01     ` Kurt Siedenburg
@ 2009-10-19 11:05       ` Edgar Grimberg
  0 siblings, 0 replies; 5+ messages in thread
From: Edgar Grimberg @ 2009-10-19 11:05 UTC (permalink / raw)
  To: Kurt Siedenburg; +Cc: Bart Veer, ecos-patches

Hi Kurt,


On Fri, Oct 16, 2009 at 7:01 PM, Kurt Siedenburg
<kurt.siedenburg@vicom.com> wrote:
> Edgar,
>  a while ago I got Nymonyx 65nm P30 chips as a replacement for older
> Strata chips.

Thanks for the info. I've got the old Intel branded flash chip. The
cause of my problems was actually a cache issue. I've got a bit
confused because I got errors from different sources and I was trying
to silence them down.
Now I'm testing the flash driver by using the uncached addresses and
things look fine.
The annoying part of the problem is the CPU. It cannot just disable
all caches, it cannot invalidate all cache lines, so I need to find a
nice solution for this. I'll be reading some other HALs to see how
this was solved.

Regards,
Edgar



>  One problem I encountered is an incompatibility to its
> predecessors:  The buffer size for programmed operations has increased
> to 512 words (that's not yet incompatible).  However you can only use
> the full buffer size if it is naturally aligned.
>
> The datasheet reads
>
> "The maximum buffer size would be 256-word if the misaligned address
> range is crossing a 512-word boundary during programming."
>
> Maybe this is the source of your troubles.
> It definitly took me a while to find this piece of information.
>
> I had suggested a patch for this issue a while back (Mar 5/6 2009) on
> this list.
> I didn't check/follow up on it to see if it ever made it to the
> repository.
>
> I recall vaguely that someone else contributed another patch in this
> area sometime later.
> Maybe that patch addresses the issue above as well.
>
> Best,
>  Kurt
>
>



-- 
Edgar Grimberg
System Developer
Zylin AS
ZY1000 JTAG Debugger http://www.zylin.com/zy1000.html
Phone: (+47) 51 63 25 00

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

end of thread, other threads:[~2009-10-19 11:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-16  8:34 STRATA v2 buffered programming fix Edgar Grimberg
2009-10-16 14:50 ` Bart Veer
2009-10-16 15:09   ` Edgar Grimberg
2009-10-16 17:01     ` Kurt Siedenburg
2009-10-19 11:05       ` Edgar Grimberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).