summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Nelson <audiohacked@gmail.com>2009-12-23 12:02:55 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-12-23 12:02:55 +0000
commit8918729891ac6b74a20b150ac34f91d40117a474 (patch)
treef022d6ac9d569fefb9242626dcc0b5c3dc40ec05
parent6c5f7338b7a96183d21cb644bb502d827ff07c42 (diff)
downloadast2050-flashrom-8918729891ac6b74a20b150ac34f91d40117a474.zip
ast2050-flashrom-8918729891ac6b74a20b150ac34f91d40117a474.tar.gz
Convert the following chips to use struct eraseblock
AT25DF021, AT25DF041A, AT25DF081, AT25DF161, AT25DF321, AT25DF321A, AT25DF641, AT25F512B, AT25FS010, AT25FS040, AT26DF041, AT26DF081A, AT26DF161, AT26DF161A, AT26F004, AT29C512, AT29C010A, AT29C020, AT29C040A, AT49BV512, AT49F002(N), AT49F002(N)T A possible future patch would to add spi_block_erase_d7 to spi.c as an alternate to spi_block_erase_20. Only some SPI chips support d7. Corresponding to flashrom svn r817. Signed-off-by: Sean Nelson <audiohacked@gmail.com> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
-rw-r--r--flashchips.c392
1 files changed, 365 insertions, 27 deletions
diff --git a/flashchips.c b/flashchips.c
index 786d53a..d5bb853 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -298,7 +298,26 @@ struct flashchip flashchips[] = {
.tested = TEST_UNTESTED,
.probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO,
- .erase = spi_chip_erase_60_c7,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 64} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 8} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 4} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {256 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {256 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
.write = spi_chip_write_256,
.read = spi_chip_read,
},
@@ -314,7 +333,26 @@ struct flashchip flashchips[] = {
.tested = TEST_UNTESTED,
.probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO,
- .erase = spi_chip_erase_60_c7,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 128} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 16} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 8} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {512 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {512 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
.write = spi_chip_write_256,
.read = spi_chip_read,
},
@@ -330,7 +368,26 @@ struct flashchip flashchips[] = {
.tested = TEST_UNTESTED,
.probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO,
- .erase = spi_chip_erase_60_c7,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 256} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 32} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 16} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {1024 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {1024 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
.write = spi_chip_write_256,
.read = spi_chip_read,
},
@@ -346,7 +403,26 @@ struct flashchip flashchips[] = {
.tested = TEST_UNTESTED,
.probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO,
- .erase = spi_chip_erase_60_c7,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 512} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 64} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 32} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {2 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {2 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
.write = spi_chip_write_256,
.read = spi_chip_read,
},
@@ -359,10 +435,29 @@ struct flashchip flashchips[] = {
.model_id = AT_25DF321,
.total_size = 4096,
.page_size = 256,
- .tested = TEST_OK_PREW,
+ .tested = TEST_OK_PRW,
.probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO,
- .erase = spi_chip_erase_60_c7,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 1024} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 128} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 64} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {4 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {4 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
.write = spi_chip_write_256,
.read = spi_chip_read,
},
@@ -378,7 +473,26 @@ struct flashchip flashchips[] = {
.tested = TEST_UNTESTED,
.probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO,
- .erase = spi_chip_erase_60_c7,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 1024} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 128} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 64} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {4 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {4 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
.write = spi_chip_write_256,
.read = spi_chip_read,
},
@@ -394,7 +508,26 @@ struct flashchip flashchips[] = {
.tested = TEST_UNTESTED,
.probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO,
- .erase = spi_chip_erase_60_c7,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 2048} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 256} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 128} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {8 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {8 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
.write = spi_chip_write_256,
.read = spi_chip_read,
},
@@ -410,7 +543,26 @@ struct flashchip flashchips[] = {
.tested = TEST_UNTESTED,
.probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO,
- .erase = spi_chip_erase_60_c7,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 16} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 2} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {32 * 1024, 2} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {64 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {64 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
.write = spi_chip_write_256,
.read = spi_chip_read,
},
@@ -426,7 +578,26 @@ struct flashchip flashchips[] = {
.tested = TEST_UNTESTED,
.probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO,
- .erase = spi_chip_erase_60_c7,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 32} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 4} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {32 * 1024, 4} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {128 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {128 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
.write = spi_chip_write_256,
.read = spi_chip_read,
},
@@ -442,7 +613,26 @@ struct flashchip flashchips[] = {
.tested = TEST_UNTESTED,
.probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO,
- .erase = spi_chip_erase_60_c7,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 128} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {64 * 1024, 8} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 8} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {512 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {512 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
.write = spi_chip_write_256,
.read = spi_chip_read,
},
@@ -459,6 +649,13 @@ struct flashchip flashchips[] = {
.probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO,
.erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 128} },
+ .block_erase = spi_block_erase_20,
+ }
+ },
.write = NULL /* Incompatible Page write */,
.read = spi_chip_read,
},
@@ -474,7 +671,26 @@ struct flashchip flashchips[] = {
.tested = TEST_UNTESTED,
.probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO,
- .erase = spi_chip_erase_60_c7,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 256} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 32} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 16} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {1024 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {1024 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
.write = spi_chip_write_256,
.read = spi_chip_read,
},
@@ -490,7 +706,26 @@ struct flashchip flashchips[] = {
.tested = TEST_UNTESTED,
.probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO,
- .erase = spi_chip_erase_60_c7,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 512} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 64} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 32} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {2 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {2 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
.write = spi_chip_write_256,
.read = spi_chip_read,
},
@@ -506,7 +741,26 @@ struct flashchip flashchips[] = {
.tested = TEST_UNTESTED,
.probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO,
- .erase = spi_chip_erase_60_c7,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 512} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 64} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 32} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {2 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {2 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
.write = spi_chip_write_256,
.read = spi_chip_read,
},
@@ -539,7 +793,26 @@ struct flashchip flashchips[] = {
.tested = TEST_UNTESTED,
.probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO,
- .erase = spi_chip_erase_60_c7,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 128} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 16} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 8} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {512 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {512 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
.write = NULL /* Incompatible Page write */,
.read = spi_chip_read,
},
@@ -552,10 +825,17 @@ struct flashchip flashchips[] = {
.model_id = AT_29C512,
.total_size = 64,
.page_size = 128,
- .tested = TEST_OK_PREW,
+ .tested = TEST_OK_PRW,
.probe = probe_jedec,
.probe_timing = 10000, /* 10mS, Enter=Exec */
- .erase = erase_chip_jedec,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {64 * 1024, 1} },
+ .block_erase = erase_chip_block_jedec,
+ }
+ },
.write = write_jedec,
.read = read_memmapped,
@@ -569,10 +849,17 @@ struct flashchip flashchips[] = {
.model_id = AT_29C010A,
.total_size = 128,
.page_size = 128,
- .tested = TEST_OK_PRE,
+ .tested = TEST_OK_PR,
.probe = probe_jedec,
.probe_timing = 10000, /* 10mS, Enter=Exec */
- .erase = erase_chip_jedec,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {128 * 1024, 1} },
+ .block_erase = erase_chip_block_jedec,
+ }
+ },
.write = write_jedec, /* FIXME */
.read = read_memmapped,
},
@@ -585,10 +872,17 @@ struct flashchip flashchips[] = {
.model_id = AT_29C020,
.total_size = 256,
.page_size = 256,
- .tested = TEST_OK_PREW,
+ .tested = TEST_OK_PRW,
.probe = probe_jedec,
.probe_timing = 10000, /* 10ms */
- .erase = erase_chip_jedec,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {256 * 1024, 1} },
+ .block_erase = erase_chip_block_jedec,
+ }
+ },
.write = write_jedec,
.read = read_memmapped,
},
@@ -604,7 +898,14 @@ struct flashchip flashchips[] = {
.tested = TEST_UNTESTED,
.probe = probe_jedec,
.probe_timing = 10000, /* 10 ms */
- .erase = erase_chip_jedec,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {512 * 1024, 1} },
+ .block_erase = erase_chip_block_jedec,
+ }
+ },
.write = write_jedec,
.read = read_memmapped,
},
@@ -761,10 +1062,17 @@ struct flashchip flashchips[] = {
.model_id = AT_49BV512,
.total_size = 64,
.page_size = 64,
- .tested = TEST_OK_PREW,
+ .tested = TEST_OK_PRW,
.probe = probe_jedec,
.probe_timing = TIMING_ZERO, /* Datasheet has no timing info specified */
- .erase = erase_chip_jedec,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {64 * 1024, 1} },
+ .block_erase = erase_chip_block_jedec,
+ }
+ },
.write = write_49f002,
.read = read_memmapped,
},
@@ -780,7 +1088,22 @@ struct flashchip flashchips[] = {
.tested = TEST_UNTESTED,
.probe = probe_jedec,
.probe_timing = TIMING_ZERO, /* Datasheet has no timing info specified */
- .erase = erase_chip_jedec,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = {
+ {16 * 1024, 1},
+ {8 * 1024, 2},
+ {96 * 1024, 1},
+ {128 * 1024, 1},
+ },
+ .block_erase = erase_sector_jedec,
+ }, {
+ .eraseblocks = { {256 * 1024, 1} },
+ .block_erase = erase_chip_block_jedec,
+ }
+ },
.write = write_49f002,
.read = read_memmapped,
},
@@ -793,10 +1116,25 @@ struct flashchip flashchips[] = {
.model_id = AT_49F002NT,
.total_size = 256,
.page_size = 256,
- .tested = TEST_OK_PREW,
+ .tested = TEST_OK_PRW,
.probe = probe_jedec,
.probe_timing = TIMING_ZERO, /* Datasheet has no timing info specified */
- .erase = erase_chip_jedec,
+ .erase = NULL,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = {
+ {128 * 1024, 1},
+ {96 * 1024, 1},
+ {8 * 1024, 2},
+ {16 * 1024, 1},
+ },
+ .block_erase = erase_sector_jedec,
+ }, {
+ .eraseblocks = { {256 * 1024, 1} },
+ .block_erase = erase_chip_block_jedec,
+ }
+ },
.write = write_49f002,
.read = read_memmapped,
},
OpenPOWER on IntegriCloud