Mark Fujitsu MBM29F400BC write as broken (implicit eraseblock layout in
write).
Use full-chip write function on Fujitsu MBM29F400TC and ST M29F400BT.
Add support for ST M29F400BB.

Signed-off-by: Carl-Daniel Hailfinger <[email protected]>

Index: flashrom-m29f400bt_fixup/flashchips.c
===================================================================
--- flashrom-m29f400bt_fixup/flashchips.c       (Revision 1082)
+++ flashrom-m29f400bt_fixup/flashchips.c       (Arbeitskopie)
@@ -2382,7 +2382,7 @@
                .total_size     = 512,
                .page_size      = 64 * 1024,
                .feature_bits   = FEATURE_ADDR_SHIFTED | FEATURE_EITHER_RESET,
-               .tested         = TEST_UNTESTED,
+               .tested         = TEST_BAD_WRITE, /* Implicit eraseblock layout 
in write_m29f400bt is broken. */
                .probe          = probe_m29f400bt,
                .probe_timing   = TIMING_IGNORED, /* routine don't use 
probe_timing (m29f400bt.c) */
                .block_erasers  =
@@ -2400,7 +2400,7 @@
                                .block_erase = block_erase_chip_m29f400bt,
                        },
                },
-               .write          = write_coreboot_m29f400bt,
+               .write          = NULL,
                .read           = read_memmapped,
        },
 
@@ -2431,7 +2431,7 @@
                                .block_erase = block_erase_chip_m29f400bt,
                        },
                },
-               .write          = write_coreboot_m29f400bt,
+               .write          = write_m29f400bt,
                .read           = read_memmapped,
        },
 
@@ -5278,7 +5278,7 @@
                .feature_bits   = FEATURE_ADDR_2AA | FEATURE_EITHER_RESET,
                .tested         = TEST_UNTESTED,
                .probe          = probe_jedec,
-               .probe_timing   = TIMING_IGNORED, /* routine don't use 
probe_timing (am29f040b.c) */
+               .probe_timing   = TIMING_IGNORED, /* routine doesn't use 
probe_timing (am29f040b.c) */
                .block_erasers  =
                {
                        {
@@ -5296,6 +5296,37 @@
        {
                /* FIXME: this has WORD/BYTE sequences; 2AA for word, 555 for 
byte */
                .vendor         = "ST",
+               .name           = "M29F400BB",
+               .bustype        = CHIP_BUSTYPE_PARALLEL,
+               .manufacture_id = ST_ID,
+               .model_id       = ST_M29F400BB,
+               .total_size     = 512,
+               .page_size      = 64 * 1024,
+               .feature_bits   = FEATURE_ADDR_SHIFTED | FEATURE_EITHER_RESET,
+               .tested         = TEST_BAD_WRITE, /* Implicit eraseblock layout 
in write_m29f400bt is broken. */
+               .probe          = probe_m29f400bt,
+               .probe_timing   = TIMING_IGNORED, /* routine doesn't use 
probe_timing (m29f400bt.c) */
+               .block_erasers  =
+               {
+                       {
+                               .eraseblocks = {
+                                       {16 * 1024, 1},
+                                       {8 * 1024, 2},
+                                       {32 * 1024, 1},
+                                       {64 * 1024, 7},
+                               },
+                               .block_erase = block_erase_m29f400bt,
+                       }, {
+                               .eraseblocks = { {512 * 1024, 1} },
+                               .block_erase = block_erase_chip_m29f400bt,
+                       }
+               },
+               .write          = NULL,
+               .read           = read_memmapped,
+       },
+       {
+               /* FIXME: this has WORD/BYTE sequences; 2AA for word, 555 for 
byte */
+               .vendor         = "ST",
                .name           = "M29F400BT",
                .bustype        = CHIP_BUSTYPE_PARALLEL,
                .manufacture_id = ST_ID,
@@ -5321,7 +5352,7 @@
                                .block_erase = block_erase_chip_m29f400bt,
                        }
                },
-               .write          = write_coreboot_m29f400bt,
+               .write          = write_m29f400bt,
                .read           = read_memmapped,
        },
 
Index: flashrom-m29f400bt_fixup/chipdrivers.h
===================================================================
--- flashrom-m29f400bt_fixup/chipdrivers.h      (Revision 1082)
+++ flashrom-m29f400bt_fixup/chipdrivers.h      (Arbeitskopie)
@@ -87,7 +87,6 @@
 int block_erase_m29f400bt(struct flashchip *flash, unsigned int start, 
unsigned int len);
 int block_erase_chip_m29f400bt(struct flashchip *flash, unsigned int start, 
unsigned int len);
 int write_m29f400bt(struct flashchip *flash, uint8_t *buf);
-int write_coreboot_m29f400bt(struct flashchip *flash, uint8_t *buf);
 void protect_m29f400bt(chipaddr bios);
 void write_page_m29f400bt(chipaddr bios, uint8_t *src,
                          chipaddr dst, int page_size);
Index: flashrom-m29f400bt_fixup/m29f400bt.c
===================================================================
--- flashrom-m29f400bt_fixup/m29f400bt.c        (Revision 1082)
+++ flashrom-m29f400bt_fixup/m29f400bt.c        (Arbeitskopie)
@@ -204,56 +204,3 @@
 
        return 0;
 }
-
-int write_coreboot_m29f400bt(struct flashchip *flash, uint8_t *buf)
-{
-       chipaddr bios = flash->virtual_memory;
-
-       msg_cinfo("Programming page:\n ");
-       /*********************************
-       *Pages for M29F400BT:
-       * 16    0x7c000         0x7ffff         TOP
-       *  8    0x7a000         0x7bfff
-       *  8    0x78000         0x79fff
-       * 32    0x70000         0x77fff
-       * 64    0x60000         0x6ffff
-       * 64    0x50000         0x5ffff
-       * 64    0x40000         0x4ffff
-       *---------------------------------
-       * 64    0x30000         0x3ffff
-       * 64    0x20000         0x2ffff
-       * 64    0x10000         0x1ffff
-       * 64    0x00000         0x0ffff         BOTTOM
-       *********************************/
-       msg_cinfo("%04d at address: 0x%08x\n", 7, 0x00000);
-       if (block_erase_m29f400bt(flash, 0x00000, 64 * 1024)) {
-               msg_cerr("ERASE FAILED!\n");
-               return -1;
-       }
-       write_page_m29f400bt(bios, buf + 0x00000, bios + 0x00000, 64 * 1024);
-
-       msg_cinfo("%04d at address: 0x%08x\n", 7, 0x10000);
-       if (block_erase_m29f400bt(flash, 0x10000, 64 * 1024)) {
-               msg_cerr("ERASE FAILED!\n");
-               return -1;
-       }
-       write_page_m29f400bt(bios, buf + 0x10000, bios + 0x10000, 64 * 1024);
-
-       msg_cinfo("%04d at address: 0x%08x\n", 7, 0x20000);
-       if (block_erase_m29f400bt(flash, 0x20000, 64 * 1024)) {
-               msg_cerr("ERASE FAILED!\n");
-               return -1;
-       }
-       write_page_m29f400bt(bios, buf + 0x20000, bios + 0x20000, 64 * 1024);
-
-       msg_cinfo("%04d at address: 0x%08x\n", 7, 0x30000);
-       if (block_erase_m29f400bt(flash, 0x30000, 64 * 1024)) {
-               msg_cerr("ERASE FAILED!\n");
-               return -1;
-       }
-       write_page_m29f400bt(bios, buf + 0x30000, bios + 0x30000, 64 * 1024);
-
-       msg_cinfo("\n");
-
-       return 0;
-}


-- 
http://www.hailfinger.org/


_______________________________________________
flashrom mailing list
[email protected]
http://www.flashrom.org/mailman/listinfo/flashrom

Reply via email to