Implementing bulk write for max speed on the Dediprog will require some traces of the SPI bus.
Add chunked write ability to the Dediprog SF100 driver. The chunk size is guessed, you can try to raise it up to 256, but please check that write works without corruption. The chunk size may also depend on the firmware version. 12 should be a safe bet, and if everything else fails, reduce the chunk size to 1 (old behaviour).
Please note that the write speedup only applies to chips which have SPI page write (i.e. chips using spi_chip_write_256).
Tests appreciated.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-dediprog_write_chunked/dediprog.c =================================================================== --- flashrom-dediprog_write_chunked/dediprog.c (Revision 1234) +++ flashrom-dediprog_write_chunked/dediprog.c (Arbeitskopie) @@ -238,6 +238,12 @@ return 0; }
+int dediprog_spi_write_256(struct flashchip *flash, uint8_t *buf, int start, int len) +{ + /* No idea about the real limit. Maybe 12, maybe more, maybe less. */ + return spi_write_chunked(flash, buf, start, len, 12); +} + int dediprog_spi_send_command(unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr) { Index: flashrom-dediprog_write_chunked/spi.c =================================================================== --- flashrom-dediprog_write_chunked/spi.c (Revision 1234) +++ flashrom-dediprog_write_chunked/spi.c (Arbeitskopie) @@ -124,7 +124,7 @@ .command = dediprog_spi_send_command, .multicommand = default_spi_send_multicommand, .read = dediprog_spi_read, - .write_256 = spi_chip_write_1, + .write_256 = dediprog_spi_write_256, }, #endif
Index: flashrom-dediprog_write_chunked/programmer.h =================================================================== --- flashrom-dediprog_write_chunked/programmer.h (Revision 1234) +++ flashrom-dediprog_write_chunked/programmer.h (Arbeitskopie) @@ -472,6 +472,7 @@ int dediprog_shutdown(void); int dediprog_spi_send_command(unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr); int dediprog_spi_read(struct flashchip *flash, uint8_t *buf, int start, int len); +int dediprog_spi_write_256(struct flashchip *flash, uint8_t *buf, int start, int len);
/* flashrom.c */ struct decode_sizes {