Intel compatible flash device issue
Hi,
I have encountered a problem using M28W160CT flash chip as LINUX character device. This chips is compatible with INTEL standard command set.
Since the chip is locked after power-up, there is required to unlock some blocks before write operation. Of course, this can be done from any application using MEMUNLOCK command.
Once the MEMUNLOCK command is executed (without any error) the flash chip remains in the "command" state.
This state after MEMUNLOCK blocks any read access to data stored in the flash.
Reviewing the cfi_cmdset_0001.c file I have found that single block (un)lock algorithm (do_xxlock_oneblock) is different from these described in the following documents:
- STM M28W160CT datasheet (figure 22)
<http://www.st.com/stonline/books/pdf/docs/7358.pdf>
- Intel 28F160C3 datasheet (figure 20) <ftp://download.intel.com/design/flcomp/datashts/29064518.pdf>
It seems that there should be issued the reset command (0xff) just after lock (0x01)/unlock (0xd0) command.
Any comments, ideas ?
Thanks in advance,
MarekSk
Quoted 22 lines · MarekSk
Hi,
I have encountered a problem using M28W160CT flash chip as LINUX character device. This chips is compatible with INTEL standard command set.Since the chip is locked after power-up, there is required to unlock some blocks before write operation. Of course, this can be done from any application using MEMUNLOCK command.
Once the MEMUNLOCK command is executed (without any error) the flash chip remains in the "command" state.
This state after MEMUNLOCK blocks any read access to data stored in the flash.Reviewing the
cfi_cmdset_0001.cfile I have found that single block (un)lock algorithm (do_xxlock_oneblock) is different from these described in the following documents:
- STM M28W160CT datasheet (figure 22)
<http://www.st.com/stonline/books/pdf/docs/7358.pdf>
- Intel 28F160C3 datasheet (figure 20) <ftp://download.intel.com/design/flcomp/datashts/29064518.pdf>
Quoted 3 lines
It seems that there should be issued the reset command (
0xff) just after lock (0x01)/unlock (0xd0) command.
---CUT---
The above mentioned chips work with CFI command set #3. Therefore, I have prepared the patch for un/lock commands from the set #3 to one who is interested in it.
MarekSk
drivers/mtd/chips/cfi_cmdset_0001.c +0 -3
@@ -1876,19 +1876,16 @@ }static char im_name_1[]="cfi_cmdset_0001" ; -static char im_name_3[]="cfi_cmdset_0003" ;int __init cfi_intelext_init (void ) {inter_module_register (im_name_1,THIS_MODULE , &cfi_cmdset_0001); -inter_module_register (im_name_3,THIS_MODULE , &cfi_cmdset_0001);return 0 ; } static void __exit cfi_intelext_exit(void) {inter_module_unregister (im_name_1); -inter_module_unregister (im_name_3); }module_init (cfi_intelext_init);
drivers/mtd/chips/cfi_cmdset_0003.c +1898 -0
1,898 lines not on this page · raw message
drivers/mtd/chips/gen_probe.c +3 -1
@@ -293,6 +293,7 @@extern cfi_cmdset_fn_t cfi_cmdset_0001;extern cfi_cmdset_fn_t cfi_cmdset_0002; +extern cfi_cmdset_fn_t cfi_cmdset_0003;extern cfi_cmdset_fn_t cfi_cmdset_0020; static inline struct mtd_info *cfi_cmdset_unknown(struct map_info *map,
@@ -340,8 +341,9 @@*/ #ifdef CONFIG_MTD_CFI_INTELEXT case 0x0001 : +return cfi_cmdset_0001 (map, primary);case 0x0003 : -return cfi_cmdset_0001 (map, primary); +return cfi_cmdset_0003 (map, primary);#endif #ifdef CONFIG_MTD_CFI_AMDSTD case 0x0002 :