<div class="gmail_quote">2010/10/12 Carl-Daniel Hailfinger <span dir="ltr"><<a href="mailto:c-d.hailfinger.devel.2006@gmx.net" target="_blank">c-d.hailfinger.devel.2006@gmx.net</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div>On 11.10.2010 15:14, Maciej Pijanka wrote:<br>
> On Mon, 11 Oct 2010, Carl-Daniel Hailfinger wrote:<br>
><br>
><br>
>> Switch all flash chips to partial write.<br>
>> The inner write functions which handle partial write are renamed to the<br>
>> original name of their wrappers. The write wrappers are removed.<br>
>><br>
>> This patch depends on<br>
>> Re: [flashrom] [PATCH] Refactor remaining write wrappers<br>
>> Tests are appreciated.<br>
>><br>
>> Signed-off-by: Carl-Daniel Hailfinger <<a href="mailto:c-d.hailfinger.devel.2006@gmx.net" target="_blank">c-d.hailfinger.devel.2006@gmx.net</a>><br>
>><br>
><br>
><br>
> This patch causes compile time problems in spi code, some functions were renamed<br>
> but *write_1_new() calls in few places remain (spi.c, it87spi.c)<br>
><br>
<br>
</div>Thanks for the report. Those are now fixed.<br>
<div><br>
<br>
> After manual fixing of those test were performed using nic3com and at29c512.<br>
> logs in attachment, everything went ok and image read back is correct.<br>
><br>
<br>
</div>Updated version with fixed compilation and some "interesting" (i.e. hard<br>
to know if they work) SPI changes. Write tests of SPI chips are<br>
appreciated, especially on boards which use the ITE IT87* Super I/O as<br>
flash controller.<br>
<div><br>
Switch all flash chips to partial write.<br>
The inner write functions which handle partial write are renamed to the<br>
original name of their wrappers. The write wrappers are removed.<br>
<br>
This patch depends on<br>
Re: [flashrom] [PATCH] Refactor remaining write wrappers<br>
Tests are appreciated.<br>
<br>
</div>Please review this patch with lots of scrutiny. I don't really feel<br>
comfortable with the IT87* SPI changes nor with the AAI SPI changes,<br>
but they were needed to get the code to work, at least in theory.<br>
<div><br>
Signed-off-by: Carl-Daniel Hailfinger <<a href="mailto:c-d.hailfinger.devel.2006@gmx.net" target="_blank">c-d.hailfinger.devel.2006@gmx.net</a>><br></div></blockquote><div><br>Acked-by: Idwer Vollering <<a href="mailto:vidwer@gmail.com" target="_blank">vidwer@gmail.com</a>><br>

 <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div>
<br>
</div><div><div></div><div>--- flashrom-partial_write_inner_function_cleanup_annotate/82802ab.c    2010-10-10 22:33:45.000000000 +0200<br>
+++ flashrom-partial_write_switchover/82802ab.c 2010-10-11 14:16:48.000000000 +0200<br>
@@ -144,7 +144,8 @@<br>
        return 0;<br>
 }<br>
<br>
-int write_page_82802ab(struct flashchip *flash, uint8_t *src, int start, int len)<br>
+/* chunksize is 1 */<br>
+int write_82802ab(struct flashchip *flash, uint8_t *src, int start, int len)<br>
 {<br>
        int i;<br>
        chipaddr dst = flash->virtual_memory + start;<br>
@@ -160,12 +161,6 @@<br>
        return 0;<br>
 }<br>
<br>
-/* chunksize is 1 */<br>
-int write_82802ab(struct flashchip *flash, uint8_t *buf)<br>
-{<br>
-       return write_page_82802ab(flash, buf, 0, flash->total_size * 1024);<br>
-}<br>
-<br>
 int unlock_28f004s5(struct flashchip *flash)<br>
 {<br>
        chipaddr bios = flash->virtual_memory;<br>
--- flashrom-partial_write_inner_function_cleanup_annotate/chipdrivers.h        2010-10-10 22:25:29.000000000 +0200<br>
+++ flashrom-partial_write_switchover/chipdrivers.h     2010-10-11 14:19:04.000000000 +0200<br>
@@ -39,10 +39,8 @@<br>
 int spi_block_erase_d8(struct flashchip *flash, unsigned int addr, unsigned int blocklen);<br>
 int spi_block_erase_60(struct flashchip *flash, unsigned int addr, unsigned int blocklen);<br>
 int spi_block_erase_c7(struct flashchip *flash, unsigned int addr, unsigned int blocklen);<br>
-int spi_chip_write_1(struct flashchip *flash, uint8_t *buf);<br>
-int spi_chip_write_256(struct flashchip *flash, uint8_t *buf);<br>
-int spi_chip_write_1_new(struct flashchip *flash, uint8_t *buf, int start, int len);<br>
-int spi_chip_write_256_new(struct flashchip *flash, uint8_t *buf, int start, int len);<br>
+int spi_chip_write_1(struct flashchip *flash, uint8_t *buf, int start, int len);<br>
+int spi_chip_write_256(struct flashchip *flash, uint8_t *buf, int start, int len);<br>
 int spi_chip_read(struct flashchip *flash, uint8_t *buf, int start, int len);<br>
 uint8_t spi_read_status_register(void);<br>
 int spi_prettyprint_status_register_at25df(struct flashchip *flash);<br>
@@ -61,16 +59,14 @@<br>
 int spi_nbyte_read(int addr, uint8_t *bytes, int len);<br>
 int spi_read_chunked(struct flashchip *flash, uint8_t *buf, int start, int len, int chunksize);<br>
 int spi_write_chunked(struct flashchip *flash, uint8_t *buf, int start, int len, int chunksize);<br>
-int spi_aai_write_new(struct flashchip *flash, uint8_t *buf, int start, int len);<br>
-int spi_aai_write(struct flashchip *flash, uint8_t *buf);<br>
+int spi_aai_write(struct flashchip *flash, uint8_t *buf, int start, int len);<br>
<br>
 /* 82802ab.c */<br>
 uint8_t wait_82802ab(struct flashchip *flash);<br>
 int probe_82802ab(struct flashchip *flash);<br>
 int erase_block_82802ab(struct flashchip *flash, unsigned int page, unsigned int pagesize);<br>
-int write_82802ab(struct flashchip *flash, uint8_t *buf);<br>
+int write_82802ab(struct flashchip *flash, uint8_t *buf, int start, int len);<br>
 void print_status_82802ab(uint8_t status);<br>
-int write_page_82802ab(struct flashchip *flash, uint8_t *src, int start, int len);<br>
 int unlock_82802ab(struct flashchip *flash);<br>
 int unlock_28f004s5(struct flashchip *flash);<br>
<br>
@@ -81,21 +77,18 @@<br>
 int write_byte_program_jedec(chipaddr bios, uint8_t *src,<br>
                             chipaddr dst);<br>
 int probe_jedec(struct flashchip *flash);<br>
-int write_jedec(struct flashchip *flash, uint8_t *buf);<br>
-int write_jedec_1(struct flashchip *flash, uint8_t *buf);<br>
+int write_jedec(struct flashchip *flash, uint8_t *buf, int start, int len);<br>
+int write_jedec_1(struct flashchip *flash, uint8_t *buf, int start, int len);<br>
 int erase_sector_jedec(struct flashchip *flash, unsigned int page, unsigned int pagesize);<br>
 int erase_block_jedec(struct flashchip *flash, unsigned int page, unsigned int blocksize);<br>
 int erase_chip_block_jedec(struct flashchip *flash, unsigned int page, unsigned int blocksize);<br>
-int write_sector_jedec_common(struct flashchip *flash, uint8_t *src, int start, int len);<br>
-int write_page_write_jedec_common(struct flashchip *flash, uint8_t *src, int start, int page_size);<br>
<br>
 /* m29f400bt.c */<br>
 int probe_m29f400bt(struct flashchip *flash);<br>
 int block_erase_m29f400bt(struct flashchip *flash, unsigned int start, unsigned int len);<br>
 int block_erase_chip_m29f400bt(struct flashchip *flash, unsigned int start, unsigned int len);<br>
-int write_m29f400bt(struct flashchip *flash, uint8_t *buf);<br>
+int write_m29f400bt(struct flashchip *flash, uint8_t *buf, int start, int len);<br>
 void protect_m29f400bt(chipaddr bios);<br>
-int write_page_m29f400bt(struct flashchip *flash, uint8_t *src, int start, int len);<br>
<br>
 /* pm49fl00x.c */<br>
 int unlock_49fl00x(struct flashchip *flash);<br>
@@ -104,8 +97,7 @@<br>
 /* sst28sf040.c */<br>
 int erase_chip_28sf040(struct flashchip *flash, unsigned int addr, unsigned int blocklen);<br>
 int erase_sector_28sf040(struct flashchip *flash, unsigned int address, unsigned int sector_size);<br>
-int write_28sf040(struct flashchip *flash, uint8_t *buf);<br>
-int write_sector_28sf040(struct flashchip *flash, uint8_t *src, int start, int len);<br>
+int write_28sf040(struct flashchip *flash, uint8_t *buf, int start, int len);<br>
 int unprotect_28sf040(struct flashchip *flash);<br>
 int protect_28sf040(struct flashchip *flash);<br>
<br>
--- flashrom-partial_write_inner_function_cleanup_annotate/flash.h      2010-10-10 18:30:10.000000000 +0200<br>
+++ flashrom-partial_write_switchover/flash.h   2010-10-11 14:15:07.000000000 +0200<br>
@@ -135,7 +135,7 @@<br>
<br>
        int (*printlock) (struct flashchip *flash);<br>
        int (*unlock) (struct flashchip *flash);<br>
-       int (*write) (struct flashchip *flash, uint8_t *buf);<br>
+       int (*write) (struct flashchip *flash, uint8_t *buf, int start, int len);<br>
        int (*read) (struct flashchip *flash, uint8_t *buf, int start, int len);<br>
<br>
        /* Some flash devices have an additional register space. */<br>
--- flashrom-partial_write_inner_function_cleanup_annotate/flashrom.c   2010-10-08 23:34:41.000000000 +0200<br>
+++ flashrom-partial_write_switchover/flashrom.c        2010-10-11 14:24:06.000000000 +0200<br>
@@ -1639,7 +1639,7 @@<br>
                        return 1;<br>
                }<br>
                msg_cinfo("Writing flash chip... ");<br>
-               ret = flash->write(flash, buf);<br>
+               ret = flash->write(flash, buf, 0, flash->total_size * 1024);<br>
                if (ret) {<br>
                        msg_cerr("FAILED!\n");<br>
                        emergency_help_message();<br>
</div></div>--- flashrom-partial_write_inner_function_cleanup_annotate/it87spi.c    2010-10-08 23:34:41.000000000 +0200<br>
+++ flashrom-partial_write_switchover/it87spi.c 2010-10-12 00:36:12.000000000 +0200<br>
@@ -305,7 +305,7 @@<br>
        /* FIXME: The command below seems to be redundant or wrong. */<br>
        OUTB(0x06, it8716f_flashport + 1);<br>
        OUTB(((2 + (fast_spi ? 1 : 0)) << 4), it8716f_flashport);<br>
-       for (i = 0; i < 256; i++) {<br>
+       for (i = 0; i < flash->page_size; i++) {<br>
                chip_writeb(buf[i], bios + start + i);<br>
        }<br>
        OUTB(0, it8716f_flashport);<br>
@@ -339,34 +339,36 @@<br>
 {<br>
        /*<br>
         * IT8716F only allows maximum of 512 kb SPI chip size for memory<br>
-        * mapped access.<br>
+        * mapped access. It also can't write more than 1+3+256 bytes at once.<br>
         */<br>
-       if ((programmer == PROGRAMMER_IT87SPI) || (flash->total_size * 1024 > 512 * 1024)) {<br>
-               spi_chip_write_1_new(flash, buf, start, len);<br>
+       if ((programmer == PROGRAMMER_IT87SPI) ||<br>
+           (flash->total_size * 1024 > 512 * 1024) ||<br>
+           (flash->page_size > 256)) {<br>
+               spi_chip_write_1(flash, buf, start, len);<br>
        } else {<br>
                int lenhere;<br>
<br>
-               if (start % 256) {<br>
+               if (start % flash->page_size) {<br>
                        /* start to the end of the page or start + len,<br>
                         * whichever is smaller. Page length is hardcoded to<br>
                         * 256 bytes (IT87 SPI hardware limitation).<br>
                         */<br>
-                       lenhere = min(len, (start | 0xff) - start + 1);<br>
-                       spi_chip_write_1_new(flash, buf, start, lenhere);<br>
+                       lenhere = min(len, flash->page_size - start % flash->page_size);<br>
+                       spi_chip_write_1(flash, buf, start, lenhere);<br>
                        start += lenhere;<br>
                        len -= lenhere;<br>
                        buf += lenhere;<br>
                }<br>
<br>
                /* FIXME: Handle chips which have max writechunk size >1 and <256. */<br>
-               while (len >= 256) {<br>
+               while (len >= flash->page_size) {<br>
                        it8716f_spi_page_program(flash, buf, start);<br>
-                       start += 256;<br>
-                       len -= 256;<br>
-                       buf += 256;<br>
+                       start += flash->page_size;<br>
+                       len -= flash->page_size;<br>
+                       buf += flash->page_size;<br>
                }<br>
                if (len)<br>
-                       spi_chip_write_1_new(flash, buf, start, len);<br>
+                       spi_chip_write_1(flash, buf, start, len);<br>
        }<br>
<br>
        return 0;<br>
<div><div></div><div>--- flashrom-partial_write_inner_function_cleanup_annotate/jedec.c      2010-10-11 14:13:31.000000000 +0200<br>
+++ flashrom-partial_write_switchover/jedec.c   2010-10-11 14:16:16.000000000 +0200<br>
@@ -336,7 +336,8 @@<br>
        return failed;<br>
 }<br>
<br>
-int write_sector_jedec_common(struct flashchip *flash, uint8_t *src, int start, int len)<br>
+/* chunksize is 1 */<br>
+int write_jedec_1(struct flashchip *flash, uint8_t *src, int start, int len)<br>
 {<br>
        int i, failed = 0;<br>
        chipaddr dst = flash->virtual_memory + start;<br>
@@ -398,13 +399,14 @@<br>
        return failed;<br>
 }<br>
<br>
+/* chunksize is page_size */<br>
 /*<br>
  * Write a part of the flash chip.<br>
  * FIXME: Use the chunk code from Michael Karcher instead.<br>
  * This function is a slightly modified copy of spi_write_chunked.<br>
  * Each page is written separately in chunks with a maximum size of chunksize.<br>
  */<br>
-int write_jedec_pages(struct flashchip *flash, uint8_t *buf, int start, int len)<br>
+int write_jedec(struct flashchip *flash, uint8_t *buf, int start, int len)<br>
 {<br>
        int i, starthere, lenhere;<br>
        /* FIXME: page_size is the wrong variable. We need max_writechunk_size<br>
@@ -437,18 +439,6 @@<br>
        return 0;<br>
 }<br>
<br>
-/* chunksize is page_size */<br>
-int write_jedec(struct flashchip *flash, uint8_t *buf)<br>
-{<br>
-       return write_jedec_pages(flash, buf, 0, flash->total_size * 1024);<br>
-}<br>
-<br>
-/* chunksize is 1 */<br>
-int write_jedec_1(struct flashchip *flash, uint8_t * buf)<br>
-{<br>
-       return write_sector_jedec_common(flash, buf, 0, flash->total_size * 1024);<br>
-}<br>
-<br>
 /* erase chip with block_erase() prototype */<br>
 int erase_chip_block_jedec(struct flashchip *flash, unsigned int addr,<br>
                           unsigned int blocksize)<br>
--- flashrom-partial_write_inner_function_cleanup_annotate/m29f400bt.c  2010-10-10 22:33:58.000000000 +0200<br>
+++ flashrom-partial_write_switchover/m29f400bt.c       2010-10-11 14:19:52.000000000 +0200<br>
@@ -27,7 +27,8 @@<br>
    0x555 instead of 0x2AA. Do *not* blindly replace with standard JEDEC<br>
    functions. */<br>
<br>
-int write_page_m29f400bt(struct flashchip *flash, uint8_t *src, int start, int len)<br>
+/* chunksize is 1 */<br>
+int write_m29f400bt(struct flashchip *flash, uint8_t *src, int start, int len)<br>
 {<br>
        int i;<br>
        chipaddr bios = flash->virtual_memory;<br>
@@ -139,9 +140,3 @@<br>
        }<br>
        return erase_m29f400bt(flash);<br>
 }<br>
-<br>
-/* chunksize is 1 */<br>
-int write_m29f400bt(struct flashchip *flash, uint8_t *buf)<br>
-{<br>
-       return write_page_m29f400bt(flash, buf, 0, flash->total_size * 1024);<br>
-}<br>
--- flashrom-partial_write_inner_function_cleanup_annotate/spi25.c      2010-10-08 23:34:42.000000000 +0200<br>
</div></div>+++ flashrom-partial_write_switchover/spi25.c   2010-10-12 00:49:56.000000000 +0200<br>
<div>@@ -1304,7 +1304,7 @@<br>
  * (e.g. due to size constraints in IT87* for over 512 kB)<br>
  */<br>
 /* real chunksize is 1, logical chunksize is 1 */<br>
-int spi_chip_write_1_new(struct flashchip *flash, uint8_t *buf, int start, int len)<br>
+int spi_chip_write_1(struct flashchip *flash, uint8_t *buf, int start, int len)<br>
 {<br>
        int i, result = 0;<br>
<br>
@@ -1319,12 +1319,7 @@<br>
        return 0;<br>
 }<br>
<br>
-int spi_chip_write_1(struct flashchip *flash, uint8_t *buf)<br>
-{<br>
-       return spi_chip_write_1_new(flash, buf, 0, flash->total_size * 1024);<br>
-}<br>
-<br>
-int spi_aai_write_new(struct flashchip *flash, uint8_t *buf, int start, int len)<br>
+int spi_aai_write(struct flashchip *flash, uint8_t *buf, int start, int len)<br>
 {<br>
        uint32_t pos = start;<br>
        int result;<br>
@@ -1363,7 +1358,7 @@<br>
        case SPI_CONTROLLER_WBSIO:<br>
                msg_perr("%s: impossible with this SPI controller,"<br>
                                " degrading to byte program\n", __func__);<br>
-               return spi_chip_write_1_new(flash, buf, start, len);<br>
+               return spi_chip_write_1(flash, buf, start, len);<br>
 #endif<br>
 #endif<br>
        default:<br>
</div>@@ -1373,18 +1368,24 @@<br>
        /* The even start address and even length requirements can be either<br>
         * honored outside this function, or we can call spi_byte_program<br>
         * for the first and/or last byte and use AAI for the rest.<br>
+        * FIXME: Move this to generic code.<br>
         */<br>
        /* The data sheet requires a start address with the low bit cleared. */<br>
        if (start % 2) {<br>
                msg_cerr("%s: start address not even! Please report a bug at "<br>
                         "<a href="mailto:flashrom@flashrom.org" target="_blank">flashrom@flashrom.org</a>\n", __func__);<br>
-               return SPI_GENERIC_ERROR;<br>
+               if (spi_chip_write_1(flash, buf, start, start % 2))<br>
+                       return SPI_GENERIC_ERROR;<br>
+               pos += start % 2;<br>
+               /* Do not return an error for now. */<br>
+               //return SPI_GENERIC_ERROR;<br>
        }<br>
        /* The data sheet requires total AAI write length to be even. */<br>
        if (len % 2) {<br>
                msg_cerr("%s: total write length not even! Please report a "<br>
                         "bug at <a href="mailto:flashrom@flashrom.org" target="_blank">flashrom@flashrom.org</a>\n", __func__);<br>
-               return SPI_GENERIC_ERROR;<br>
+               /* Do not return an error for now. */<br>
+               //return SPI_GENERIC_ERROR;<br>
        }<br>
<br>
<br>
@@ -1403,7 +1404,8 @@<br>
        /* We already wrote 2 bytes in the multicommand step. */<br>
        pos += 2;<br>
<br>
-       while (pos < start + len) {<br>
+       /* Are there at least two more bytes to write? */<br>
+       while (pos < start + len - 1) {<br>
                cmd[1] = buf[pos++];<br>
                cmd[2] = buf[pos++];<br>
                spi_send_command(JEDEC_AAI_WORD_PROGRAM_CONT_OUTSIZE, 0, cmd, NULL);<br>
@@ -1411,13 +1413,17 @@<br>
                        programmer_delay(10);<br>
        }<br>
<br>
-       /* Use WRDI to exit AAI mode. */<br>
+       /* Use WRDI to exit AAI mode. This needs to be done before issuing any<br>
+        * other non-AAI command.<br>
+        */<br>
<div>        spi_write_disable();<br>
-       return 0;<br>
-}<br>
<br>
-int spi_aai_write(struct flashchip *flash, uint8_t *buf)<br>
-{<br>
-       return spi_aai_write_new(flash, buf, 0, flash->total_size * 1024);<br>
-}<br>
</div>+       /* Write remaining byte (if any). */<br>
+       if (pos < start + len) {<br>
+               if (spi_chip_write_1(flash, buf + pos, pos, pos % 2))<br>
+                       return SPI_GENERIC_ERROR;<br>
+               pos += pos % 2;<br>
+       }<br>
<br>
+       return 0;<br>
+}<br>
<div>--- flashrom-partial_write_inner_function_cleanup_annotate/spi.c        2010-10-08 23:34:42.000000000 +0200<br>
</div>+++ flashrom-partial_write_switchover/spi.c     2010-10-11 20:30:50.000000000 +0200<br>
@@ -80,7 +80,7 @@<br>
                .command = wbsio_spi_send_command,<br>
                .multicommand = default_spi_send_multicommand,<br>
                .read = wbsio_spi_read,<br>
-               .write_256 = spi_chip_write_1_new,<br>
+               .write_256 = spi_chip_write_1,<br>
        },<br>
<br>
        { /* SPI_CONTROLLER_MCP6X_BITBANG */<br>
@@ -124,7 +124,7 @@<br>
                .command = dediprog_spi_send_command,<br>
                .multicommand = default_spi_send_multicommand,<br>
                .read = dediprog_spi_read,<br>
-               .write_256 = spi_chip_write_1_new,<br>
+               .write_256 = spi_chip_write_1,<br>
        },<br>
 #endif<br>
<div><div></div><div><br>
@@ -245,7 +245,7 @@<br>
  * .write_256 = spi_chip_write_1<br>
  */<br>
 /* real chunksize is up to 256, logical chunksize is 256 */<br>
-int spi_chip_write_256_new(struct flashchip *flash, uint8_t *buf, int start, int len)<br>
+int spi_chip_write_256(struct flashchip *flash, uint8_t *buf, int start, int len)<br>
 {<br>
        if (!spi_programmer[spi_controller].write_256) {<br>
                msg_perr("%s called, but SPI page write is unsupported on this "<br>
@@ -257,20 +257,6 @@<br>
        return spi_programmer[spi_controller].write_256(flash, buf, start, len);<br>
 }<br>
<br>
-/* Wrapper function until the generic code is converted to partial writes. */<br>
-int spi_chip_write_256(struct flashchip *flash, uint8_t *buf)<br>
-{<br>
-       int ret;<br>
-<br>
-       msg_pinfo("Programming flash... ");<br>
-       ret = spi_chip_write_256_new(flash, buf, 0, flash->total_size * 1024);<br>
-       if (!ret)<br>
-               msg_pinfo("done.\n");<br>
-       else<br>
-               msg_pinfo("\n");<br>
-       return ret;<br>
-}<br>
-<br>
 /*<br>
  * Get the lowest allowed address for read accesses. This often happens to<br>
  * be the lowest allowed address for all commands which take an address.<br>
--- flashrom-partial_write_inner_function_cleanup_annotate/sst28sf040.c 2010-10-10 22:40:48.000000000 +0200<br>
+++ flashrom-partial_write_switchover/sst28sf040.c      2010-10-11 14:20:24.000000000 +0200<br>
@@ -78,7 +78,8 @@<br>
        return 0;<br>
 }<br>
<br>
-int write_sector_28sf040(struct flashchip *flash, uint8_t *src, int start, int len)<br>
+/* chunksize is 1 */<br>
+int write_28sf040(struct flashchip *flash, uint8_t *src, int start, int len)<br>
 {<br>
        int i;<br>
        chipaddr bios = flash->virtual_memory;<br>
@@ -119,12 +120,6 @@<br>
        return 0;<br>
 }<br>
<br>
-/* chunksize is 1 */<br>
-int write_28sf040(struct flashchip *flash, uint8_t *buf)<br>
-{<br>
-       return write_sector_28sf040(flash, buf, 0, flash->total_size * 1024);<br>
-}<br>
-<br>
 int erase_chip_28sf040(struct flashchip *flash, unsigned int addr, unsigned int blocklen)<br>
 {<br>
        if ((addr != 0) || (blocklen != flash->total_size * 1024)) {<br>
<br>
<br>
--<br>
<a href="http://www.hailfinger.org/" target="_blank">http://www.hailfinger.org/</a><br>
<br>
<br>
_______________________________________________<br>
flashrom mailing list<br>
<a href="mailto:flashrom@flashrom.org" target="_blank">flashrom@flashrom.org</a><br>
<a href="http://www.flashrom.org/mailman/listinfo/flashrom" target="_blank">http://www.flashrom.org/mailman/listinfo/flashrom</a><br>
</div></div></blockquote></div><br>