summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-07-16 22:07:20 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-07-16 22:07:20 +0000
commit420cf6f633f7697a8a709326c47b3cf0e6ea229d (patch)
tree5bab2b53c558ffa2400ba9708659c2b9e049168a
parent29a1c66a23bc8685f456d548361b735bf36dcf2b (diff)
downloadflashrom-420cf6f633f7697a8a709326c47b3cf0e6ea229d.tar.gz
flashrom-420cf6f633f7697a8a709326c47b3cf0e6ea229d.tar.bz2
flashrom-420cf6f633f7697a8a709326c47b3cf0e6ea229d.zip
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. Corresponding to flashrom svn r1083. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
-rw-r--r--chipdrivers.h1
-rw-r--r--flashchips.c41
-rw-r--r--m29f400bt.c53
3 files changed, 36 insertions, 59 deletions
diff --git a/chipdrivers.h b/chipdrivers.h
index 3a9c61161..9e7af2dc7 100644
--- a/chipdrivers.h
+++ b/chipdrivers.h
@@ -87,7 +87,6 @@ int erase_m29f400bt(struct flashchip *flash);
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);
diff --git a/flashchips.c b/flashchips.c
index 354bd95c9..4c4305a53 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -2382,7 +2382,7 @@ struct flashchip flashchips[] = {
.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 @@ struct flashchip flashchips[] = {
.block_erase = block_erase_chip_m29f400bt,
},
},
- .write = write_coreboot_m29f400bt,
+ .write = NULL,
.read = read_memmapped,
},
@@ -2431,7 +2431,7 @@ struct flashchip flashchips[] = {
.block_erase = block_erase_chip_m29f400bt,
},
},
- .write = write_coreboot_m29f400bt,
+ .write = write_m29f400bt,
.read = read_memmapped,
},
@@ -5278,7 +5278,7 @@ struct flashchip flashchips[] = {
.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 @@ struct flashchip flashchips[] = {
{
/* 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 @@ struct flashchip flashchips[] = {
.block_erase = block_erase_chip_m29f400bt,
}
},
- .write = write_coreboot_m29f400bt,
+ .write = write_m29f400bt,
.read = read_memmapped,
},
diff --git a/m29f400bt.c b/m29f400bt.c
index c8ed5d876..2a770ba7b 100644
--- a/m29f400bt.c
+++ b/m29f400bt.c
@@ -204,56 +204,3 @@ int write_m29f400bt(struct flashchip *flash, uint8_t *buf)
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;
-}