Converted chips to block_erasers:
W_25X10
W_25X20
W_25X40
W_25X80
W_25X16
W_25X32
W_25X64
W_29C011
W_29C020C
W_29C040P
W_29EE011
W_39V040A
W_39V040B
W_39V040C
W_39V040FA
W_39V080A
W_49F002U
W_49V002A
W_49V002FA
W_39V080FA
W_39V080FA_DM

Signed-off-by: Sean Nelson <[email protected]>
diff --git a/flashchips.c b/flashchips.c
index 8e90d2a..e2a5951 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -4511,15 +4511,34 @@ struct flashchip flashchips[] = {
                .manufacture_id = WINBOND_NEX_ID,
                .model_id       = W_25X10,
                .total_size     = 128,
                .page_size      = 256,
                .tested         = TEST_UNTESTED,
                .probe          = probe_spi_rdid,
                .probe_timing   = TIMING_ZERO,
-               .erase          = spi_chip_erase_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 = { {64 * 1024, 2} },
+                               .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,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W25x20",
@@ -4527,47 +4546,104 @@ struct flashchip flashchips[] = {
                .manufacture_id = WINBOND_NEX_ID,
                .model_id       = W_25X20,
                .total_size     = 256,
                .page_size      = 256,
                .tested         = TEST_UNTESTED,
                .probe          = probe_spi_rdid,
                .probe_timing   = TIMING_ZERO,
-               .erase          = spi_chip_erase_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,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W25x40",
                .bustype        = CHIP_BUSTYPE_SPI,
                .manufacture_id = WINBOND_NEX_ID,
                .model_id       = W_25X40,
                .total_size     = 512,
                .page_size      = 256,
-               .tested         = TEST_OK_PREW,
+               .tested         = TEST_OK_PRW,
                .probe          = probe_spi_rdid,
                .probe_timing   = TIMING_ZERO,
-               .erase          = spi_chip_erase_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,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W25x80",
                .bustype        = CHIP_BUSTYPE_SPI,
                .manufacture_id = WINBOND_NEX_ID,
                .model_id       = W_25X80,
                .total_size     = 1024,
                .page_size      = 256,
-               .tested         = TEST_OK_PREW,
+               .tested         = TEST_OK_PRW,
                .probe          = probe_spi_rdid,
                .probe_timing   = TIMING_ZERO,
-               .erase          = spi_chip_erase_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,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W25x16",
@@ -4575,15 +4651,34 @@ struct flashchip flashchips[] = {
                .manufacture_id = WINBOND_NEX_ID,
                .model_id       = W_25X16,
                .total_size     = 2048,
                .page_size      = 256,
                .tested         = TEST_OK_PR,
                .probe          = probe_spi_rdid,
                .probe_timing   = TIMING_ZERO,
-               .erase          = spi_chip_erase_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,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W25x32",
@@ -4591,15 +4686,34 @@ struct flashchip flashchips[] = {
                .manufacture_id = WINBOND_NEX_ID,
                .model_id       = W_25X32,
                .total_size     = 4096,
                .page_size      = 256,
                .tested         = TEST_OK_PROBE,
                .probe          = probe_spi_rdid,
                .probe_timing   = TIMING_ZERO,
-               .erase          = spi_chip_erase_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,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W25x64",
@@ -4607,191 +4721,321 @@ struct flashchip flashchips[] = {
                .manufacture_id = WINBOND_NEX_ID,
                .model_id       = W_25X64,
                .total_size     = 8192,
                .page_size      = 256,
                .tested         = TEST_UNTESTED,
                .probe          = probe_spi_rdid,
                .probe_timing   = TIMING_ZERO,
-               .erase          = spi_chip_erase_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,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W29C011",
                .bustype        = CHIP_BUSTYPE_PARALLEL,
                .manufacture_id = WINBOND_ID,
                .model_id       = W_29C011,
                .total_size     = 128,
                .page_size      = 128,
-               .tested         = TEST_OK_PREW,
+               .tested         = TEST_OK_PRW,
                .probe          = probe_jedec,
                .probe_timing   = 10,           /* used datasheet for the 
W29C011A */
-               .erase          = erase_chip_jedec,
+               .erase          = NULL,
+               .block_erasers  =
+               {
+                       {
+                               .eraseblocks = { {128 * 1024, 1} },
+                               .block_erase = erase_chip_block_jedec,
+                       }
+               },
                .write          = write_jedec,
                .read           = read_memmapped,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W29C020C",
                .bustype        = CHIP_BUSTYPE_PARALLEL,
                .manufacture_id = WINBOND_ID,
                .model_id       = W_29C020C,
                .total_size     = 256,
                .page_size      = 128,
-               .tested         = TEST_OK_PREW,
+               .tested         = TEST_OK_PRW,
                .probe          = probe_jedec,
                .probe_timing   = 10, 
-               .erase          = erase_chip_jedec,
+               .erase          = NULL,
+               .block_erasers  =
+               {
+                       {
+                               .eraseblocks = { {256 * 1024, 1} },
+                               .block_erase = erase_chip_block_jedec,
+                       }
+               },
                .write          = write_jedec,
                .read           = read_memmapped,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W29C040P",
                .bustype        = CHIP_BUSTYPE_PARALLEL,
                .manufacture_id = WINBOND_ID,
                .model_id       = W_29C040P,
                .total_size     = 512,
                .page_size      = 256,
-               .tested         = TEST_OK_PREW,
+               .tested         = TEST_OK_PRW,
                .probe          = probe_jedec,
                .probe_timing   = 10, 
-               .erase          = erase_chip_jedec,
+               .erase          = NULL,
+               .block_erasers  =
+               {
+                       {
+                               .eraseblocks = { {512 * 1024, 1} },
+                               .block_erase = erase_chip_block_jedec,
+                       }
+               },
                .write          = write_jedec,
                .read           = read_memmapped,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W29EE011",
                .bustype        = CHIP_BUSTYPE_PARALLEL,
                .manufacture_id = WINBOND_ID,
                .model_id       = W_29C011,
                .total_size     = 128,
                .page_size      = 128,
-               .tested         = TEST_OK_PREW,
+               .tested         = TEST_OK_PRW,
                .probe          = probe_w29ee011,
                .probe_timing   = TIMING_IGNORED, /* routine don't use 
probe_timing (w29ee011.c) */
-               .erase          = erase_chip_jedec,
+               .erase          = NULL,
+               .block_erasers  =
+               {
+                       {
+                               .eraseblocks = { {128 * 1024, 1} },
+                               .block_erase = erase_chip_block_jedec,
+                       }
+               },
                .write          = write_jedec,
                .read           = read_memmapped,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W39V040A",
                .bustype        = CHIP_BUSTYPE_LPC,
                .manufacture_id = WINBOND_ID,
                .model_id       = W_39V040A,
                .total_size     = 512,
                .page_size      = 64 * 1024,
-               .tested         = TEST_OK_PREW,
+               .tested         = TEST_OK_PRW,
                .probe          = probe_jedec,
                .probe_timing   = 10, 
-               .erase          = erase_chip_jedec,
+               .erase          = NULL,
+               .block_erasers  =
+               {
+                       {
+                               .eraseblocks = { {64 * 1024, 8} },
+                               .block_erase = erase_sector_jedec,
+                       }, {
+                               .eraseblocks = { {512 * 1024, 1} },
+                               .block_erase = erase_chip_block_jedec,
+                       }
+               },
                .write          = write_49f002,
                .read           = read_memmapped,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W39V040B",
                .bustype        = CHIP_BUSTYPE_LPC,
                .manufacture_id = WINBOND_ID,
                .model_id       = W_39V040B,
                .total_size     = 512,
                .page_size      = 64 * 1024,
-               .tested         = TEST_OK_PR | TEST_BAD_ERASE | TEST_BAD_WRITE,
+               .tested         = TEST_OK_PR | TEST_BAD_WRITE,
                .probe          = probe_jedec,
                .probe_timing   = 10, 
-               .erase          = erase_chip_jedec,
+               .erase          = NULL,
+               .block_erasers  =
+               {
+                       {
+                               .eraseblocks = { {64 * 1024, 8} },
+                               .block_erase = erase_sector_jedec,
+                       }, {
+                               .eraseblocks = { {512 * 1024, 1} },
+                               .block_erase = erase_chip_block_jedec,
+                       }
+               },
                .write          = write_49f002,
                .read           = read_memmapped,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W39V040C",
                .bustype        = CHIP_BUSTYPE_LPC,
                .manufacture_id = WINBOND_ID,
                .model_id       = W_39V040C,
                .total_size     = 512,
                .page_size      = 64 * 1024,
-               .tested         = TEST_OK_PREW,
+               .tested         = TEST_OK_PRW,
                .probe          = probe_w39v040c,
                .probe_timing   = TIMING_FIXME,
-               .erase          = erase_w39v040c,
+               .erase          = NULL, /* Was erase_w39v040c */
+               .block_erasers  =
+               {
+                       {
+                               .eraseblocks = { {64 * 1024, 8} },
+                               .block_erase = erase_sector_jedec,
+                       }, {
+                               .eraseblocks = { {512 * 1024, 1} },
+                               .block_erase = erase_chip_block_jedec,
+                       }
+               },
                .write          = write_w39v040c,
                .read           = read_memmapped,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W39V040FA",
                .bustype        = CHIP_BUSTYPE_FWH,
                .manufacture_id = WINBOND_ID,
                .model_id       = W_39V040FA,
                .total_size     = 512,
                .page_size      = 64 * 1024,
-               .tested         = TEST_OK_PREW,
+               .tested         = TEST_OK_PRW,
                .probe          = probe_jedec,
                .probe_timing   = 10, 
-               .erase          = erase_chip_jedec,
+               .erase          = NULL,
+               .block_erasers  =
+               {
+                       {
+                               .eraseblocks = { {4 * 1024, 128} },
+                               .block_erase = erase_block_jedec,
+                       }, {
+                               .eraseblocks = { {64 * 1024, 8} },
+                               .block_erase = erase_sector_jedec,
+                       }, {
+                               .eraseblocks = { {512 * 1024, 1} },
+                               .block_erase = erase_chip_block_jedec,
+                       }
+               },
                .write          = write_49f002,
                .read           = read_memmapped,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W39V080A",
                .bustype        = CHIP_BUSTYPE_LPC,
                .manufacture_id = WINBOND_ID,
                .model_id       = W_39V080A,
                .total_size     = 1024,
                .page_size      = 64 * 1024,
-               .tested         = TEST_OK_PREW,
+               .tested         = TEST_OK_PRW,
                .probe          = probe_jedec,
                .probe_timing   = 10, 
-               .erase          = erase_chip_jedec,
+               .erase          = NULL,
+               .block_erasers  =
+               {
+                       {
+                               .eraseblocks = { {64 * 1024, 16} },
+                               .block_erase = erase_sector_jedec,
+                       }, {
+                               .eraseblocks = { {1024 * 1024, 1} },
+                               .block_erase = erase_chip_block_jedec,
+                       }
+               },
                .write          = write_49f002,
                .read           = read_memmapped,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W49F002U",
                .bustype        = CHIP_BUSTYPE_PARALLEL,
                .manufacture_id = WINBOND_ID,
                .model_id       = W_49F002U,
                .total_size     = 256,
                .page_size      = 128,
-               .tested         = TEST_OK_PREW,
+               .tested         = TEST_OK_PRW,
                .probe          = probe_jedec,
                .probe_timing   = 10,
-               .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,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W49V002A",
                .bustype        = CHIP_BUSTYPE_LPC,
                .manufacture_id = WINBOND_ID,
                .model_id       = W_49V002A,
                .total_size     = 256,
                .page_size      = 128,
-               .tested         = TEST_OK_PREW,
+               .tested         = TEST_OK_PRW,
                .probe          = probe_jedec,
                .probe_timing   = 10, 
-               .erase          = erase_chip_jedec,
+               .erase          = NULL,
+               .block_erasers  =
+               {
+                       {
+                               .eraseblocks = {
+                                       {64 * 1024, 3},
+                                       {32 * 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,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W49V002FA",
@@ -4799,32 +5043,57 @@ struct flashchip flashchips[] = {
                .manufacture_id = WINBOND_ID,
                .model_id       = W_49V002FA,
                .total_size     = 256,
                .page_size      = 128,
                .tested         = TEST_UNTESTED,
                .probe          = probe_jedec,
                .probe_timing   = 10,
-               .erase          = erase_chip_jedec,
+               .erase          = NULL,
+               .block_erasers  =
+               {
+                       {
+                               .eraseblocks = {
+                                       {64 * 1024, 3},
+                                       {32 * 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,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W39V080FA",
                .bustype        = CHIP_BUSTYPE_FWH,
                .manufacture_id = WINBOND_ID,
                .model_id       = W_39V080FA,
                .total_size     = 1024,
                .page_size      = 64 * 1024,
                .feature_bits   = FEATURE_REGISTERMAP,
-               .tested         = TEST_OK_PREW,
+               .tested         = TEST_OK_PRW,
                .probe          = probe_jedec,
                .probe_timing   = TIMING_FIXME,
-               .erase          = erase_winbond_fwhub,
+               .erase          = NULL, /* Was erase_winbond_fwhub */
+               .block_erasers  =
+               {
+                       {
+                               .eraseblocks = { {64 * 1024, 16}, },
+                               .block_erase = erase_sector_jedec,
+                       }, {
+                               .eraseblocks = { {1024 * 1024, 1} },
+                               .block_erase = erase_chip_block_jedec,
+                       }
+               },
                .write          = write_winbond_fwhub,
                .read           = read_memmapped,
        },
 
        {
                .vendor         = "Winbond",
                .name           = "W39V080FA (dual mode)",
@@ -4833,15 +5102,25 @@ struct flashchip flashchips[] = {
                .model_id       = W_39V080FA_DM,
                .total_size     = 512,
                .page_size      = 64 * 1024,
                .feature_bits   = FEATURE_REGISTERMAP,
                .tested         = TEST_UNTESTED,
                .probe          = probe_jedec,
                .probe_timing   = TIMING_FIXME,
-               .erase          = erase_winbond_fwhub,
+               .erase          = NULL, /* Was erase_winbond_fwhub */
+               .block_erasers  =
+               {
+                       {
+                               .eraseblocks = { {64 * 1024, 8}, },
+                               .block_erase = erase_sector_jedec,
+                       }, {
+                               .eraseblocks = { {512 * 1024, 1} },
+                               .block_erase = erase_chip_block_jedec,
+                       }
+               },
                .write          = write_winbond_fwhub,
                .read           = read_memmapped,
        },
 
        {
                .vendor         = "Atmel",
                .name           = "unknown Atmel SPI chip",
_______________________________________________
flashrom mailing list
[email protected]
http://www.flashrom.org/mailman/listinfo/flashrom

Reply via email to