NOR: add FIXMEs for writing ones
authorDavid Brownell <dbrownell@users.sourceforge.net>
Sat, 9 Jan 2010 00:47:58 +0000 (16:47 -0800)
committerDavid Brownell <dbrownell@users.sourceforge.net>
Sat, 9 Jan 2010 00:47:58 +0000 (16:47 -0800)
It can invalidate ECC codes, and in general is not guaranteed
to work.  (However on some chips it _appears_ to behave.)  Just
don't do it; don't write in those cases.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
TODO
src/flash/nor/core.c

diff --git a/TODO b/TODO
index 8fed264bccdbb1fe80a068bbc4d7664503b840ca..73e4aa7bb42468c72d85702181de202e7e72cf40 100644 (file)
--- a/TODO
+++ b/TODO
@@ -209,6 +209,12 @@ https://lists.berlios.de/pipermail/openocd-development/2009-October/011506.html
   - ocl
   - str9xpec
 
   - ocl
   - str9xpec
 
+- Don't expect writing all-ones to be a safe way to write without
+  changing bit values.  Minimally it loses on flash modules with
+  internal ECC, where it may change the ECC.
+  - NOR flash_write_unlock() does that between sectors
+  - there may be other cases too
+
 @subsection thelistflashcfi CFI
 
 - finish implementing bus width/chip width handling (suggested by NC)
 @subsection thelistflashcfi CFI
 
 - finish implementing bus width/chip width handling (suggested by NC)
index 01088f3c14e5bbc6387e12580618cabe3d8a89a3..7e783d425c6eb119782f149303c5d7e1ca456808 100644 (file)
@@ -449,9 +449,12 @@ int flash_write_unlock(struct target *target, struct image *image,
                                break;
                        }
 
                                break;
                        }
 
-                       /* REVISIT This needlessly touches sectors BETWEEN the
+                       /* FIXME This needlessly touches sectors BETWEEN the
                         * sections it's writing.  Without auto erase, it just
                         * sections it's writing.  Without auto erase, it just
-                        * writes ones; unlikely to destroy data.
+                        * writes ones.  That WILL INVALIDATE data in cases
+                        * like Stellaris Tempest chips, corrupting internal
+                        * ECC codes; and at least FreeScale suggests issues
+                        * with that approach (in HC11 documentation).
                         *
                         * With auto erase enabled, data in those sectors will
                         * be needlessly destroyed; and some of the limited
                         *
                         * With auto erase enabled, data in those sectors will
                         * be needlessly destroyed; and some of the limited

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)