Author: stefanct
Date: Wed Jun  4 18:17:03 2014
New Revision: 1818
URL: http://flashrom.org/trac/flashrom/changeset/1818

Log:
Add support for Sanyo LE25FW106.

Also, add spi_disable_blockprotect_bp1_srwd().

Originally written and tested by The Raven <[email protected]>.

Signed-off-by: Stefan Tauner <[email protected]>
Acked-by: Stefan Tauner <[email protected]>

Modified:
   trunk/chipdrivers.h
   trunk/flashchips.c
   trunk/flashchips.h
   trunk/spi25_statusreg.c

Modified: trunk/chipdrivers.h
==============================================================================
--- trunk/chipdrivers.h Mon Jun  2 02:46:02 2014        (r1817)
+++ trunk/chipdrivers.h Wed Jun  4 18:17:03 2014        (r1818)
@@ -73,6 +73,7 @@
 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);

Modified: trunk/flashchips.c
==============================================================================
--- trunk/flashchips.c  Mon Jun  2 02:46:02 2014        (r1817)
+++ trunk/flashchips.c  Wed Jun  4 18:17:03 2014        (r1818)
@@ -9153,6 +9153,37 @@
 
        {
                .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",
                .bustype        = BUS_SPI,
                .manufacture_id = SANYO_ID,

Modified: trunk/flashchips.h
==============================================================================
--- trunk/flashchips.h  Mon Jun  2 02:46:02 2014        (r1817)
+++ trunk/flashchips.h  Wed Jun  4 18:17:03 2014        (r1818)
@@ -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 */

Modified: trunk/spi25_statusreg.c
==============================================================================
--- trunk/spi25_statusreg.c     Mon Jun  2 02:46:02 2014        (r1817)
+++ trunk/spi25_statusreg.c     Wed Jun  4 18:17:03 2014        (r1818)
@@ -196,6 +196,13 @@
        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). */

_______________________________________________
flashrom mailing list
[email protected]
http://www.flashrom.org/mailman/listinfo/flashrom

Reply via email to