Commit a60d408a authored by Stefan Tauner's avatar Stefan Tauner
Browse files

Add support for Sanyo LE25FW106


Also, add spi_disable_blockprotect_bp1_srwd().

Originally written and tested by The Raven <originalraven@hotmail.com>.

Corresponding to flashrom svn r1818.
Signed-off-by: default avatarStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: default avatarStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
parent 2a10e70c
...@@ -73,6 +73,7 @@ int spi_prettyprint_status_register_bp3_srwd(struct flashctx *flash); ...@@ -73,6 +73,7 @@ int spi_prettyprint_status_register_bp3_srwd(struct flashctx *flash);
int spi_prettyprint_status_register_bp4_srwd(struct flashctx *flash); int spi_prettyprint_status_register_bp4_srwd(struct flashctx *flash);
int spi_prettyprint_status_register_bp2_bpl(struct flashctx *flash); int spi_prettyprint_status_register_bp2_bpl(struct flashctx *flash);
int spi_disable_blockprotect(struct flashctx *flash); int spi_disable_blockprotect(struct flashctx *flash);
int spi_disable_blockprotect_bp1_srwd(struct flashctx *flash);
int spi_disable_blockprotect_bp2_srwd(struct flashctx *flash); int spi_disable_blockprotect_bp2_srwd(struct flashctx *flash);
int spi_disable_blockprotect_bp3_srwd(struct flashctx *flash); int spi_disable_blockprotect_bp3_srwd(struct flashctx *flash);
int spi_disable_blockprotect_bp4_srwd(struct flashctx *flash); int spi_disable_blockprotect_bp4_srwd(struct flashctx *flash);
......
...@@ -9151,6 +9151,37 @@ const struct flashchip flashchips[] = { ...@@ -9151,6 +9151,37 @@ const struct flashchip flashchips[] = {
.voltage = {3000, 3600}, .voltage = {3000, 3600},
}, },
{
.vendor = "Sanyo",
.name = "LE25FW106",
.bustype = BUS_SPI,
.manufacture_id = SANYO_ID,
.model_id = SANYO_LE25FW106,
.total_size = 128,
.page_size = 256,
.feature_bits = FEATURE_WRSR_WREN,
.tested = TEST_OK_PREW,
.probe = probe_spi_res2,
.probe_timing = TIMING_ZERO,
.block_erasers = {
{
.eraseblocks = { {2 * 1024, 64} },
.block_erase = spi_block_erase_d7,
}, {
.eraseblocks = { {32 * 1024, 4} },
.block_erase = spi_block_erase_d8,
}, {
.eraseblocks = { {128 * 1024, 1} },
.block_erase = spi_block_erase_c7,
}
},
.printlock = spi_prettyprint_status_register_bp1_srwd, /* FIXME: Add ERSER error flag. */
.unlock = spi_disable_blockprotect_bp1_srwd,
.write = spi_chip_write_256,
.read = spi_chip_read,
.voltage = {2700, 3600},
},
{ {
.vendor = "Sanyo", .vendor = "Sanyo",
.name = "LE25FW406A", .name = "LE25FW406A",
......
...@@ -537,6 +537,7 @@ ...@@ -537,6 +537,7 @@
#define SANYO_ID 0x62 /* Sanyo */ #define SANYO_ID 0x62 /* Sanyo */
#define SANYO_LE25FW203A 0x1600 #define SANYO_LE25FW203A 0x1600
#define SANYO_LE25FW403A 0x1100 #define SANYO_LE25FW403A 0x1100
#define SANYO_LE25FW106 0x15
#define SANYO_LE25FW406 0x07 /* RES2 */ #define SANYO_LE25FW406 0x07 /* RES2 */
#define SANYO_LE25FW418A 0x10 /* RES2 and some weird 1 byte RDID variant */ #define SANYO_LE25FW418A 0x10 /* RES2 and some weird 1 byte RDID variant */
#define SANYO_LE25FW406A 0x1A /* RES2, no datasheet */ #define SANYO_LE25FW406A 0x1A /* RES2, no datasheet */
......
...@@ -196,6 +196,13 @@ int spi_disable_blockprotect(struct flashctx *flash) ...@@ -196,6 +196,13 @@ int spi_disable_blockprotect(struct flashctx *flash)
return spi_disable_blockprotect_generic(flash, 0x3C, 0, 0, 0xFF); return spi_disable_blockprotect_generic(flash, 0x3C, 0, 0, 0xFF);
} }
/* A common block protection disable that tries to unset the status register bits masked by 0x0C (BP0-1) and
* protected/locked by bit #7. Useful when bits 4-5 may be non-0). */
int spi_disable_blockprotect_bp1_srwd(struct flashctx *flash)
{
return spi_disable_blockprotect_generic(flash, 0x0C, 1 << 7, 0, 0xFF);
}
/* A common block protection disable that tries to unset the status register bits masked by 0x1C (BP0-2) and /* A common block protection disable that tries to unset the status register bits masked by 0x1C (BP0-2) and
* protected/locked by bit #7. Useful when bit #5 is neither a protection bit nor reserved (and hence possibly * protected/locked by bit #7. Useful when bit #5 is neither a protection bit nor reserved (and hence possibly
* non-0). */ * non-0). */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment