<div dir="ltr">Works on my hardware except that it is very slow, so changing usleep from 1000 to 10<br>and increasing timeout to 100 * 1000 * 60 (line 461 ichspi.c) results in a fast erase/read (about 2.5 sec)<br>and successful write in 62 seconds.<br>

<br>Test Log : <br><br>ali@Velocity:~/tmp/f$ sudo time ./flashrom/flashrom -w mybios.rom<br>flashrom v0.9.0-r471<br>Calibrating delay loop... OK.<br>No coreboot table found.<br>Found chipset "Intel ICH7M", enabling flash write... OK.<br>

Found chip "SST SST25VF080B" (1024 KB) at physical address 0xfff00000.<br>Flash image seems to be a legacy BIOS. Disabling checks.<br>62.14user 0.10system 1:03.08elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k<br>

0inputs+0outputs (0major+512minor)pagefaults 0swaps<br><br>ali@Velocity:~/tmp/f$ sudo time ./flashrom/flashrom -r ddd <br>flashrom v0.9.0-r471<br>Calibrating delay loop... OK.<br>No coreboot table found.<br>Found chipset "Intel ICH7M", enabling flash write... OK.<br>

Found chip "SST SST25VF080B" (1024 KB) at physical address 0xfff00000.<br>Reading flash... done.<br>2.87user 0.06system 0:03.05elapsed 96%CPU (0avgtext+0avgdata 0maxresident)k<br>0inputs+2048outputs (0major+513minor)pagefaults 0swaps<br>

<br>ali@Velocity:~/tmp/f$ diff ddd mybios.rom <br><br>ali@Velocity:~/tmp/f$ <br><br><br>Regards --<br>Ali Nadalizadeh<br><br><div class="gmail_quote">On Thu, May 7, 2009 at 5:44 PM, Carl-Daniel Hailfinger <span dir="ltr"><<a href="mailto:c-d.hailfinger.devel.2006@gmx.net">c-d.hailfinger.devel.2006@gmx.net</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Chips like the SST SST25VF080B can only handle single byte writes<br>
outside AAI mode.<br>
<br>
Change SPI architecture to handle 1-byte chunk chip writing differently<br>
from 256-byte chunk chip writing.<br>
<br>
Convert all flashchips.c entries with SPI programing to the 256-byte<br>
version by default.<br>
<br>
Change the flashchips entry for SST SST25VF080B to 1-byte writing.<br>
<br>
Untested.<br>
<br>
Signed-off-by: Carl-Daniel Hailfinger <<a href="mailto:c-d.hailfinger.devel.2006@gmx.net">c-d.hailfinger.devel.2006@gmx.net</a>><br>
<br>
Index: flashrom-SST25VF080B/flash.h<br>
===================================================================<br>
--- flashrom-SST25VF080B/flash.h        (Revision 471)<br>
+++ flashrom-SST25VF080B/flash.h        (Arbeitskopie)<br>
@@ -565,7 +565,8 @@<br>
 int spi_chip_erase_d8(struct flashchip *flash);<br>
 int spi_block_erase_52(const struct flashchip *flash, unsigned long addr);<br>
 int spi_block_erase_d8(const struct flashchip *flash, unsigned long addr);<br>
-int spi_chip_write(struct flashchip *flash, uint8_t *buf);<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_read(struct flashchip *flash, uint8_t *buf);<br>
 uint8_t spi_read_status_register(void);<br>
 int spi_disable_blockprotect(void);<br>
@@ -593,7 +594,7 @@<br>
 int ich_spi_command(unsigned int writecnt, unsigned int readcnt,<br>
                    const unsigned char *writearr, unsigned char *readarr);<br>
 int ich_spi_read(struct flashchip *flash, uint8_t * buf);<br>
-int ich_spi_write(struct flashchip *flash, uint8_t * buf);<br>
+int ich_spi_write_256(struct flashchip *flash, uint8_t * buf);<br>
<br>
 /* it87spi.c */<br>
 extern uint16_t it8716f_flashport;<br>
@@ -601,13 +602,14 @@<br>
 int it8716f_spi_command(unsigned int writecnt, unsigned int readcnt,<br>
                        const unsigned char *writearr, unsigned char *readarr);<br>
 int it8716f_spi_chip_read(struct flashchip *flash, uint8_t *buf);<br>
-int it8716f_spi_chip_write(struct flashchip *flash, uint8_t *buf);<br>
+int it8716f_spi_chip_write_1(struct flashchip *flash, uint8_t *buf);<br>
+int it8716f_spi_chip_write_256(struct flashchip *flash, uint8_t *buf);<br>
<br>
 /* sb600spi.c */<br>
 int sb600_spi_command(unsigned int writecnt, unsigned int readcnt,<br>
                      const unsigned char *writearr, unsigned char *readarr);<br>
 int sb600_spi_read(struct flashchip *flash, uint8_t *buf);<br>
-int sb600_spi_write(struct flashchip *flash, uint8_t *buf);<br>
+int sb600_spi_write_256(struct flashchip *flash, uint8_t *buf);<br>
 uint8_t sb600_read_status_register(void);<br>
 extern uint8_t volatile *sb600_spibar;<br>
<br>
@@ -706,7 +708,7 @@<br>
 int wbsio_check_for_spi(const char *name);<br>
 int wbsio_spi_command(unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr);<br>
 int wbsio_spi_read(struct flashchip *flash, uint8_t *buf);<br>
-int wbsio_spi_write(struct flashchip *flash, uint8_t *buf);<br>
+int wbsio_spi_write_256(struct flashchip *flash, uint8_t *buf);<br>
<br>
 /* stm50flw0x0x.c */<br>
 int probe_stm50flw0x0x(struct flashchip *flash);<br>
Index: flashrom-SST25VF080B/it87spi.c<br>
===================================================================<br>
--- flashrom-SST25VF080B/it87spi.c      (Revision 471)<br>
+++ flashrom-SST25VF080B/it87spi.c      (Arbeitskopie)<br>
@@ -215,10 +215,12 @@<br>
 }<br>
<br>
 /*<br>
- * IT8716F only allows maximum of 512 kb SPI mapped to LPC memory cycles<br>
  * Program chip using firmware cycle byte programming. (SLOW!)<br>
+ * This is for chips which can only handle one byte writes<br>
+ * and for chips where memory mapped programming is impossible due to<br>
+ * size constraints in IT87* (over 512 kB)<br>
  */<br>
-int it8716f_over512k_spi_chip_write(struct flashchip *flash, uint8_t *buf)<br>
+int it8716f_spi_chip_write_1(struct flashchip *flash, uint8_t *buf)<br>
 {<br>
        int total_size = 1024 * flash->total_size;<br>
        int i;<br>
@@ -262,13 +264,17 @@<br>
        return 0;<br>
 }<br>
<br>
-int it8716f_spi_chip_write(struct flashchip *flash, uint8_t *buf)<br>
+int it8716f_spi_chip_write_256(struct flashchip *flash, uint8_t *buf)<br>
 {<br>
        int total_size = 1024 * flash->total_size;<br>
        int i;<br>
<br>
+       /*<br>
+        * IT8716F only allows maximum of 512 kb SPI chip size for memory<br>
+        * mapped access.<br>
+        */<br>
        if (total_size > 512 * 1024) {<br>
-               it8716f_over512k_spi_chip_write(flash, buf);<br>
+               it8716f_spi_chip_write_1(flash, buf);<br>
        } else {<br>
                for (i = 0; i < total_size / 256; i++) {<br>
                        it8716f_spi_page_program(i, buf,<br>
Index: flashrom-SST25VF080B/flashchips.c<br>
===================================================================<br>
--- flashrom-SST25VF080B/flashchips.c   (Revision 471)<br>
+++ flashrom-SST25VF080B/flashchips.c   (Arbeitskopie)<br>
@@ -151,7 +151,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -165,7 +165,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -179,7 +179,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -193,7 +193,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -207,7 +207,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -221,7 +221,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -235,7 +235,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -249,7 +249,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -263,7 +263,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -277,7 +277,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -305,7 +305,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -319,7 +319,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -333,7 +333,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -348,7 +348,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
          },*/<br>
<br>
@@ -554,7 +554,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid4,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -737,7 +737,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -751,7 +751,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -765,7 +765,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -779,7 +779,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -793,7 +793,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -807,7 +807,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -821,7 +821,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -835,7 +835,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -849,7 +849,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -863,7 +863,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -877,7 +877,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -930,7 +930,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_d8,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -944,7 +944,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_d8,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -958,7 +958,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_d8,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -972,7 +972,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_d8,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -986,7 +986,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_d8,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1000,7 +1000,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1014,7 +1014,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1028,7 +1028,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1042,7 +1042,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1056,7 +1056,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1070,7 +1070,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1123,7 +1123,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1137,7 +1137,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1151,7 +1151,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1165,7 +1165,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1179,7 +1179,7 @@<br>
                .tested         = TEST_OK_PR,<br>
                .probe          = probe_spi_rems,<br>
                .erase          = spi_chip_erase_60,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1207,7 +1207,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_1,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1559,7 +1559,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1573,7 +1573,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1587,7 +1587,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1601,7 +1601,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1615,7 +1615,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_res,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1629,7 +1629,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1643,7 +1643,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1657,7 +1657,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1671,7 +1671,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1685,7 +1685,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1946,7 +1946,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1960,7 +1960,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1974,7 +1974,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1988,7 +1988,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
Index: flashrom-SST25VF080B/spi.c<br>
===================================================================<br>
--- flashrom-SST25VF080B/spi.c  (Revision 471)<br>
+++ flashrom-SST25VF080B/spi.c  (Arbeitskopie)<br>
@@ -597,19 +597,41 @@<br>
        return 1;<br>
 }<br>
<br>
-int spi_chip_write(struct flashchip *flash, uint8_t *buf)<br>
+/*<br>
+ * Program chip using firmware cycle byte programming. (SLOW!)<br>
+ * This is for chips which can only handle one byte writes<br>
+ * and for chips where memory mapped programming is impossible<br>
+ * (e.g. due to size constraints in IT87* for over 512 kB)<br>
+ */<br>
+int spi_chip_write_1(struct flashchip *flash, uint8_t *buf)<br>
 {<br>
+       int total_size = 1024 * flash->total_size;<br>
+       int i;<br>
+<br>
+       spi_disable_blockprotect();<br>
+       for (i = 0; i < total_size; i++) {<br>
+               spi_write_enable();<br>
+               spi_byte_program(i, buf[i]);<br>
+               while (spi_read_status_register() & JEDEC_RDSR_BIT_WIP)<br>
+                       myusec_delay(10);<br>
+       }<br>
+<br>
+       return 0;<br>
+}<br>
+<br>
+int spi_chip_write_256(struct flashchip *flash, uint8_t *buf)<br>
+{<br>
        switch (flashbus) {<br>
        case BUS_TYPE_IT87XX_SPI:<br>
-               return it8716f_spi_chip_write(flash, buf);<br>
+               return it8716f_spi_chip_write_256(flash, buf);<br>
        case BUS_TYPE_SB600_SPI:<br>
-               return sb600_spi_write(flash, buf);<br>
+               return sb600_spi_write_256(flash, buf);<br>
        case BUS_TYPE_ICH7_SPI:<br>
        case BUS_TYPE_ICH9_SPI:<br>
        case BUS_TYPE_VIA_SPI:<br>
-               return ich_spi_write(flash, buf);<br>
+               return ich_spi_write_256(flash, buf);<br>
        case BUS_TYPE_WBSIO_SPI:<br>
-               return wbsio_spi_write(flash, buf);<br>
+               return wbsio_spi_write_256(flash, buf);<br>
        default:<br>
                printf_debug<br>
                    ("%s called, but no SPI chipset/strapping detected\n",<br>
@@ -627,7 +649,7 @@<br>
        case BUS_TYPE_WBSIO_SPI:<br>
                fprintf(stderr, "%s: impossible with Winbond SPI masters,"<br>
                                " degrading to byte program\n", __func__);<br>
-               return spi_chip_write(flash, buf);<br>
+               return spi_chip_write_1(flash, buf);<br>
        default:<br>
                break;<br>
        }<br>
Index: flashrom-SST25VF080B/wbsio_spi.c<br>
===================================================================<br>
--- flashrom-SST25VF080B/wbsio_spi.c    (Revision 471)<br>
+++ flashrom-SST25VF080B/wbsio_spi.c    (Arbeitskopie)<br>
@@ -186,7 +186,7 @@<br>
        return 0;<br>
 }<br>
<br>
-int wbsio_spi_write(struct flashchip *flash, uint8_t *buf)<br>
+int wbsio_spi_write_256(struct flashchip *flash, uint8_t *buf)<br>
 {<br>
        int pos, size = flash->total_size * 1024;<br>
<br>
Index: flashrom-SST25VF080B/sb600spi.c<br>
===================================================================<br>
--- flashrom-SST25VF080B/sb600spi.c     (Revision 471)<br>
+++ flashrom-SST25VF080B/sb600spi.c     (Arbeitskopie)<br>
@@ -64,7 +64,7 @@<br>
        return readarr[0];<br>
 }<br>
<br>
-int sb600_spi_write(struct flashchip *flash, uint8_t *buf)<br>
+int sb600_spi_write_256(struct flashchip *flash, uint8_t *buf)<br>
 {<br>
        int rc = 0, i;<br>
        int total_size = flash->total_size * 1024;<br>
Index: flashrom-SST25VF080B/ichspi.c<br>
===================================================================<br>
--- flashrom-SST25VF080B/ichspi.c       (Revision 471)<br>
+++ flashrom-SST25VF080B/ichspi.c       (Arbeitskopie)<br>
@@ -707,7 +707,7 @@<br>
        return rc;<br>
 }<br>
<br>
-int ich_spi_write(struct flashchip *flash, uint8_t * buf)<br>
+int ich_spi_write_256(struct flashchip *flash, uint8_t * buf)<br>
 {<br>
        int i, j, rc = 0;<br>
        int total_size = flash->total_size * 1024;<br>
<font color="#888888"><br>
<br>
--<br>
<a href="http://www.hailfinger.org/" target="_blank">http://www.hailfinger.org/</a><br>
<br>
</font><br>Index: flashrom-SST25VF080B/flash.h<br>
===================================================================<br>
--- flashrom-SST25VF080B/flash.h        (Revision 471)<br>
+++ flashrom-SST25VF080B/flash.h        (Arbeitskopie)<br>
@@ -565,7 +565,8 @@<br>
 int spi_chip_erase_d8(struct flashchip *flash);<br>
 int spi_block_erase_52(const struct flashchip *flash, unsigned long addr);<br>
 int spi_block_erase_d8(const struct flashchip *flash, unsigned long addr);<br>
-int spi_chip_write(struct flashchip *flash, uint8_t *buf);<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_read(struct flashchip *flash, uint8_t *buf);<br>
 uint8_t spi_read_status_register(void);<br>
 int spi_disable_blockprotect(void);<br>
@@ -593,7 +594,7 @@<br>
 int ich_spi_command(unsigned int writecnt, unsigned int readcnt,<br>
                    const unsigned char *writearr, unsigned char *readarr);<br>
 int ich_spi_read(struct flashchip *flash, uint8_t * buf);<br>
-int ich_spi_write(struct flashchip *flash, uint8_t * buf);<br>
+int ich_spi_write_256(struct flashchip *flash, uint8_t * buf);<br>
<br>
 /* it87spi.c */<br>
 extern uint16_t it8716f_flashport;<br>
@@ -601,13 +602,14 @@<br>
 int it8716f_spi_command(unsigned int writecnt, unsigned int readcnt,<br>
                        const unsigned char *writearr, unsigned char *readarr);<br>
 int it8716f_spi_chip_read(struct flashchip *flash, uint8_t *buf);<br>
-int it8716f_spi_chip_write(struct flashchip *flash, uint8_t *buf);<br>
+int it8716f_spi_chip_write_1(struct flashchip *flash, uint8_t *buf);<br>
+int it8716f_spi_chip_write_256(struct flashchip *flash, uint8_t *buf);<br>
<br>
 /* sb600spi.c */<br>
 int sb600_spi_command(unsigned int writecnt, unsigned int readcnt,<br>
                      const unsigned char *writearr, unsigned char *readarr);<br>
 int sb600_spi_read(struct flashchip *flash, uint8_t *buf);<br>
-int sb600_spi_write(struct flashchip *flash, uint8_t *buf);<br>
+int sb600_spi_write_256(struct flashchip *flash, uint8_t *buf);<br>
 uint8_t sb600_read_status_register(void);<br>
 extern uint8_t volatile *sb600_spibar;<br>
<br>
@@ -706,7 +708,7 @@<br>
 int wbsio_check_for_spi(const char *name);<br>
 int wbsio_spi_command(unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr);<br>
 int wbsio_spi_read(struct flashchip *flash, uint8_t *buf);<br>
-int wbsio_spi_write(struct flashchip *flash, uint8_t *buf);<br>
+int wbsio_spi_write_256(struct flashchip *flash, uint8_t *buf);<br>
<br>
 /* stm50flw0x0x.c */<br>
 int probe_stm50flw0x0x(struct flashchip *flash);<br>
Index: flashrom-SST25VF080B/it87spi.c<br>
===================================================================<br>
--- flashrom-SST25VF080B/it87spi.c      (Revision 471)<br>
+++ flashrom-SST25VF080B/it87spi.c      (Arbeitskopie)<br>
@@ -215,10 +215,12 @@<br>
 }<br>
<br>
 /*<br>
- * IT8716F only allows maximum of 512 kb SPI mapped to LPC memory cycles<br>
  * Program chip using firmware cycle byte programming. (SLOW!)<br>
+ * This is for chips which can only handle one byte writes<br>
+ * and for chips where memory mapped programming is impossible due to<br>
+ * size constraints in IT87* (over 512 kB)<br>
  */<br>
-int it8716f_over512k_spi_chip_write(struct flashchip *flash, uint8_t *buf)<br>
+int it8716f_spi_chip_write_1(struct flashchip *flash, uint8_t *buf)<br>
 {<br>
        int total_size = 1024 * flash->total_size;<br>
        int i;<br>
@@ -262,13 +264,17 @@<br>
        return 0;<br>
 }<br>
<br>
-int it8716f_spi_chip_write(struct flashchip *flash, uint8_t *buf)<br>
+int it8716f_spi_chip_write_256(struct flashchip *flash, uint8_t *buf)<br>
 {<br>
        int total_size = 1024 * flash->total_size;<br>
        int i;<br>
<br>
+       /*<br>
+        * IT8716F only allows maximum of 512 kb SPI chip size for memory<br>
+        * mapped access.<br>
+        */<br>
        if (total_size > 512 * 1024) {<br>
-               it8716f_over512k_spi_chip_write(flash, buf);<br>
+               it8716f_spi_chip_write_1(flash, buf);<br>
        } else {<br>
                for (i = 0; i < total_size / 256; i++) {<br>
                        it8716f_spi_page_program(i, buf,<br>
Index: flashrom-SST25VF080B/flashchips.c<br>
===================================================================<br>
--- flashrom-SST25VF080B/flashchips.c   (Revision 471)<br>
+++ flashrom-SST25VF080B/flashchips.c   (Arbeitskopie)<br>
@@ -151,7 +151,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -165,7 +165,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -179,7 +179,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -193,7 +193,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -207,7 +207,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -221,7 +221,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -235,7 +235,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -249,7 +249,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -263,7 +263,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -277,7 +277,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -305,7 +305,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -319,7 +319,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -333,7 +333,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -348,7 +348,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
          },*/<br>
<br>
@@ -554,7 +554,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid4,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -737,7 +737,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -751,7 +751,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -765,7 +765,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -779,7 +779,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -793,7 +793,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -807,7 +807,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -821,7 +821,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -835,7 +835,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -849,7 +849,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -863,7 +863,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -877,7 +877,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -930,7 +930,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_d8,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -944,7 +944,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_d8,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -958,7 +958,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_d8,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -972,7 +972,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_d8,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -986,7 +986,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_d8,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1000,7 +1000,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1014,7 +1014,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1028,7 +1028,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1042,7 +1042,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1056,7 +1056,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1070,7 +1070,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1123,7 +1123,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1137,7 +1137,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1151,7 +1151,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1165,7 +1165,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1179,7 +1179,7 @@<br>
                .tested         = TEST_OK_PR,<br>
                .probe          = probe_spi_rems,<br>
                .erase          = spi_chip_erase_60,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1207,7 +1207,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_60_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_1,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1559,7 +1559,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1573,7 +1573,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1587,7 +1587,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1601,7 +1601,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1615,7 +1615,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_res,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1629,7 +1629,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1643,7 +1643,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1657,7 +1657,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1671,7 +1671,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1685,7 +1685,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1946,7 +1946,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1960,7 +1960,7 @@<br>
                .tested         = TEST_UNTESTED,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1974,7 +1974,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
@@ -1988,7 +1988,7 @@<br>
                .tested         = TEST_OK_PREW,<br>
                .probe          = probe_spi_rdid,<br>
                .erase          = spi_chip_erase_c7,<br>
-               .write          = spi_chip_write,<br>
+               .write          = spi_chip_write_256,<br>
                .read           = spi_chip_read,<br>
        },<br>
<br>
Index: flashrom-SST25VF080B/spi.c<br>
===================================================================<br>
--- flashrom-SST25VF080B/spi.c  (Revision 471)<br>
+++ flashrom-SST25VF080B/spi.c  (Arbeitskopie)<br>
@@ -597,19 +597,41 @@<br>
        return 1;<br>
 }<br>
<br>
-int spi_chip_write(struct flashchip *flash, uint8_t *buf)<br>
+/*<br>
+ * Program chip using firmware cycle byte programming. (SLOW!)<br>
+ * This is for chips which can only handle one byte writes<br>
+ * and for chips where memory mapped programming is impossible<br>
+ * (e.g. due to size constraints in IT87* for over 512 kB)<br>
+ */<br>
+int spi_chip_write_1(struct flashchip *flash, uint8_t *buf)<br>
 {<br>
+       int total_size = 1024 * flash->total_size;<br>
+       int i;<br>
+<br>
+       spi_disable_blockprotect();<br>
+       for (i = 0; i < total_size; i++) {<br>
+               spi_write_enable();<br>
+               spi_byte_program(i, buf[i]);<br>
+               while (spi_read_status_register() & JEDEC_RDSR_BIT_WIP)<br>
+                       myusec_delay(10);<br>
+       }<br>
+<br>
+       return 0;<br>
+}<br>
+<br>
+int spi_chip_write_256(struct flashchip *flash, uint8_t *buf)<br>
+{<br>
        switch (flashbus) {<br>
        case BUS_TYPE_IT87XX_SPI:<br>
-               return it8716f_spi_chip_write(flash, buf);<br>
+               return it8716f_spi_chip_write_256(flash, buf);<br>
        case BUS_TYPE_SB600_SPI:<br>
-               return sb600_spi_write(flash, buf);<br>
+               return sb600_spi_write_256(flash, buf);<br>
        case BUS_TYPE_ICH7_SPI:<br>
        case BUS_TYPE_ICH9_SPI:<br>
        case BUS_TYPE_VIA_SPI:<br>
-               return ich_spi_write(flash, buf);<br>
+               return ich_spi_write_256(flash, buf);<br>
        case BUS_TYPE_WBSIO_SPI:<br>
-               return wbsio_spi_write(flash, buf);<br>
+               return wbsio_spi_write_256(flash, buf);<br>
        default:<br>
                printf_debug<br>
                    ("%s called, but no SPI chipset/strapping detected\n",<br>
@@ -627,7 +649,7 @@<br>
        case BUS_TYPE_WBSIO_SPI:<br>
                fprintf(stderr, "%s: impossible with Winbond SPI masters,"<br>
                                " degrading to byte program\n", __func__);<br>
-               return spi_chip_write(flash, buf);<br>
+               return spi_chip_write_1(flash, buf);<br>
        default:<br>
                break;<br>
        }<br>
Index: flashrom-SST25VF080B/wbsio_spi.c<br>
===================================================================<br>
--- flashrom-SST25VF080B/wbsio_spi.c    (Revision 471)<br>
+++ flashrom-SST25VF080B/wbsio_spi.c    (Arbeitskopie)<br>
@@ -186,7 +186,7 @@<br>
        return 0;<br>
 }<br>
<br>
-int wbsio_spi_write(struct flashchip *flash, uint8_t *buf)<br>
+int wbsio_spi_write_256(struct flashchip *flash, uint8_t *buf)<br>
 {<br>
        int pos, size = flash->total_size * 1024;<br>
<br>
Index: flashrom-SST25VF080B/sb600spi.c<br>
===================================================================<br>
--- flashrom-SST25VF080B/sb600spi.c     (Revision 471)<br>
+++ flashrom-SST25VF080B/sb600spi.c     (Arbeitskopie)<br>
@@ -64,7 +64,7 @@<br>
        return readarr[0];<br>
 }<br>
<br>
-int sb600_spi_write(struct flashchip *flash, uint8_t *buf)<br>
+int sb600_spi_write_256(struct flashchip *flash, uint8_t *buf)<br>
 {<br>
        int rc = 0, i;<br>
        int total_size = flash->total_size * 1024;<br>
Index: flashrom-SST25VF080B/ichspi.c<br>
===================================================================<br>
--- flashrom-SST25VF080B/ichspi.c       (Revision 471)<br>
+++ flashrom-SST25VF080B/ichspi.c       (Arbeitskopie)<br>
@@ -707,7 +707,7 @@<br>
        return rc;<br>
 }<br>
<br>
-int ich_spi_write(struct flashchip *flash, uint8_t * buf)<br>
+int ich_spi_write_256(struct flashchip *flash, uint8_t * buf)<br>
 {<br>
        int i, j, rc = 0;<br>
        int total_size = flash->total_size * 1024;<br>
<br>--<br>
coreboot mailing list: <a href="mailto:coreboot@coreboot.org">coreboot@coreboot.org</a><br>
<a href="http://www.coreboot.org/mailman/listinfo/coreboot" target="_blank">http://www.coreboot.org/mailman/listinfo/coreboot</a><br></blockquote></div><br><br clear="all"><br>-- <br>علی نادعلی‌زاده<br>
</div>