[flashrom] [PATCH 5a/10] 4BA: W25Q256.V declaration update to work via direct funcs

Boris Baykov dev at borisbaykov.com
Sun Jan 11 00:22:38 CET 2015


This patch doesn't work with W25Q256.V chip. DON'T try to use it!
It's here just to show how new direct-4ba functions can be used
to define new chips in the flashchips array.

Patched files
-------------
flashchips.c 
+ modified definition of Winbond W25Q256BV/W25Q256FV chips


Signed-off-by: Boris Baykov <dev at borisbaykov.com>, Russia, Jan 2014
---
diff -U 5 -N ./flashrom/flashchips.c ./flashrom-1868-4ba-5a/flashchips.c
--- ./flashrom/flashchips.c     2015-01-11 02:03:38.000000000 +0300
+++ ./flashrom-1868-4ba-5a/flashchips.c 2015-01-10 19:17:40.000000000 +0300
@@ -13329,32 +13329,33 @@
                .total_size     = 32768,
                .page_size      = 256,
                /* supports SFDP */
                /* OTP: 1024B total, 256B reserved; read 0x48; write 0x42, erase 0x44, read ID 0x4B */
                /* FOUR_BYTE_ADDR: supports 4-bytes addressing mode */
-               .feature_bits   = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_4BA_SUPPORT | FEATURE_4BA_DIRECT_READ,
+               .feature_bits   = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_4BA_SUPPORT | FEATURE_4BA_DIRECT_READ
+                                       | FEATURE_4BA_DIRECT_WRITE | FEATURE_4BA_ALL_ERASERS_DIRECT,
                .four_bytes_addr_funcs = 
                {
-                       .enter_4ba = spi_enter_4ba_b7_we, /* enter 4-bytes addressing mode by CMD B7 + WREN */
-                       .read_nbyte = spi_nbyte_read_4ba_direct, /* read directly from any mode, no need to enter 4ba */
-                       .program_byte = spi_byte_program_4ba, /* write from 4-bytes addressing mode */
-                       .program_nbyte = spi_nbyte_program_4ba /* write from 4-bytes addressing mode */
+                       .enter_4ba = NULL, /* no need to enter 4-bytes addressing mode */
+                       .read_nbyte = spi_nbyte_read_4ba_direct, /* read from any mode, no need to enter 4ba */
+                       .program_byte = spi_byte_program_4ba_direct, /* write from any mode, no need to enter 4ba */
+                       .program_nbyte = spi_nbyte_program_4ba_direct /* write from any mode, no need to enter 4ba */
                },
                .tested         = TEST_OK_PREW,
                .probe          = probe_spi_rdid,
                .probe_timing   = TIMING_ZERO,
                .block_erasers  =
                {
                        {
                                .eraseblocks = { {4 * 1024, 8192} },
-                               .block_erase = spi_block_erase_20_4ba, /* erases 4k from 4-bytes addressing mode */
+                               .block_erase = spi_block_erase_21_4ba_direct, /* erases 4k from any mode */
                        }, {
                                .eraseblocks = { {32 * 1024, 1024} },
-                               .block_erase = spi_block_erase_52_4ba, /* erases 32k from 4-bytes addressing mode */
+                               .block_erase = spi_block_erase_5c_4ba_direct, /* erases 32k from any mode */
                        }, {
                                .eraseblocks = { {64 * 1024, 512} },
-                               .block_erase = spi_block_erase_d8_4ba, /* erases 64k from 4-bytes addressing mode */
+                               .block_erase = spi_block_erase_dc_4ba_direct, /* erases 64k from any mode */
                        }, {
                                .eraseblocks = { {32 * 1024 * 1024, 1} },
                                .block_erase = spi_block_erase_60,
                        }, {
                                .eraseblocks = { {32 * 1024 * 1024, 1} },
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flashrom-r1868-4ba-part-5a.patch.tar.bz2
Type: application/octet-stream
Size: 1240 bytes
Desc: not available
URL: <http://www.flashrom.org/pipermail/flashrom/attachments/20150111/997a8f57/attachment.obj>


More information about the flashrom mailing list