Just a quick heads-up to anyone who is attempting to get the Numonyx
M29W128GH/L working with openocd.  It appears the chip has an
unfortunate errata where sending a 0xFF command to it puts it off in
the weeds and fails to accept new commands until a 0xF0 is sent to put
it back into read mode.  See the data sheet link below for more
detail.

http://www.numonyx.com/Documents/Datasheets/M29W128G.pdf
Page. 32: "The device doesn’t tolerate FFh as a valid command, and
once FFh is issued to the device, the M29W128G will enter unexpected
state. Adding a F0h command systematically after FFh command is
necessary."

It appears that someone else ran into this with the kernel mtd driver
a while back.
http://lists.infradead.org/pipermail/linux-mtd/2008-July/022252.html

----------------------------

... A quick patch to fix the problem.  Based on the fact that the
comment above calls out 2.6.8-rc2 as the version where the bug
appeared and it looks like linux 2.6.30.3 -
drivers/mtd/chips/cfi_util.c - cfi_qry_mode_off() still writes a 0xF0
and then a 0xFF, I would guess that there aren't many of these chips
floating around out there.  I don't think that it is necessary or
advisable to check in this change.  I just wanted it to be available
when someone does a google search.

pk

Index: flash/cfi.c
===================================================================
--- flash/cfi.c (revision 2713)
+++ flash/cfi.c (working copy)
@@ -2172,6 +2172,13 @@
                unlock2 = 0x2aaa;
        }

+       /* switch back to read array mode */
+       cfi_command(bank, 0xf0, command);
+       if ((retval = target_write_memory(target, flash_address(bank,
0, 0x00), bank->bus_width, 1, command)) != ERROR_OK)
+       {
+               return retval;
+       }
+
        /* switch to read identifier codes mode ("AUTOSELECT") */
        cfi_command(bank, 0xaa, command);
        if ((retval = target_write_memory(target, flash_address(bank,
0, unlock1), bank->bus_width, 1, command)) != ERROR_OK)
@@ -2227,6 +2234,12 @@
        {
                return retval;
        }
+       /* switch back to read array mode */
+       cfi_command(bank, 0xf0, command);
+       if ((retval = target_write_memory(target, flash_address(bank,
0, 0x00), bank->bus_width, 1, command)) != ERROR_OK)
+       {
+               return retval;
+       }

        /* check device/manufacturer ID for known non-CFI flashes. */
        cfi_fixup_non_cfi(bank);
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to