diff --git a/chipdrivers.h b/chipdrivers.h index ee86f83fd33b7e6dd011cec64207b0eb81b4e623..03d922d48bf99258590831d70eaa74041ca9cf84 100644 --- a/chipdrivers.h +++ b/chipdrivers.h @@ -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_bp2_bpl(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_bp3_srwd(struct flashctx *flash); int spi_disable_blockprotect_bp4_srwd(struct flashctx *flash); diff --git a/flashchips.c b/flashchips.c index 1bb6f279bfef2d99ef128ca44bc2ace9d05c69c3..0c3bb68026a997f57a6d2281313ec6591ccb45b1 100644 --- a/flashchips.c +++ b/flashchips.c @@ -9151,6 +9151,37 @@ const struct flashchip flashchips[] = { .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", .name = "LE25FW406A", diff --git a/flashchips.h b/flashchips.h index eef681b3a129b178c9dded945f0c65c84a1a5c35..fb17981a12fa69a6b74f4d33dfd01b3889d9e21c 100644 --- a/flashchips.h +++ b/flashchips.h @@ -537,6 +537,7 @@ #define SANYO_ID 0x62 /* Sanyo */ #define SANYO_LE25FW203A 0x1600 #define SANYO_LE25FW403A 0x1100 +#define SANYO_LE25FW106 0x15 #define SANYO_LE25FW406 0x07 /* RES2 */ #define SANYO_LE25FW418A 0x10 /* RES2 and some weird 1 byte RDID variant */ #define SANYO_LE25FW406A 0x1A /* RES2, no datasheet */ diff --git a/spi25_statusreg.c b/spi25_statusreg.c index 793290a66f73a6a5a04c26f7b3731649ce41bd3a..69b2126e449ec9ee71dd70a46741a6fe1d04ee66 100644 --- a/spi25_statusreg.c +++ b/spi25_statusreg.c @@ -196,6 +196,13 @@ int spi_disable_blockprotect(struct flashctx *flash) 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 * protected/locked by bit #7. Useful when bit #5 is neither a protection bit nor reserved (and hence possibly * non-0). */