From a60d408a78be0e0d34dda616977489a307cb98b6 Mon Sep 17 00:00:00 2001 From: Stefan Tauner Date: Wed, 4 Jun 2014 16:17:03 +0000 Subject: Add support for Sanyo LE25FW106 Also, add spi_disable_blockprotect_bp1_srwd(). Originally written and tested by The Raven . Corresponding to flashrom svn r1818. Signed-off-by: Stefan Tauner Acked-by: Stefan Tauner --- chipdrivers.h | 1 + flashchips.c | 31 +++++++++++++++++++++++++++++++ flashchips.h | 1 + spi25_statusreg.c | 7 +++++++ 4 files changed, 40 insertions(+) diff --git a/chipdrivers.h b/chipdrivers.h index ee86f83fd..03d922d48 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 1bb6f279b..0c3bb6802 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 eef681b3a..fb17981a1 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 793290a66..69b2126e4 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). */ -- cgit v1.2.3