[flashrom] [PATCH] SPI read/write progress bar hack

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Thu Jun 17 12:31:08 CEST 2010


SPI read/write progress bar hack. Prints a dot for every page read/written.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Daniel, this patch (together with the protocol violation 3x speedup
patch) should print roughly 4 dots per second for read/erase on your
system. I suggest you only try with read to check if read time is
affected by this. If read time is unaffected, erase time will be
unaffected as well. I expect one dot every 9 seconds for write, but I
also suggest you wait with another write attempt until I get around to
posting the AAI patch for you.

Index: flashrom-spi_progressbar_hack/spi25.c
===================================================================
--- flashrom-spi_progressbar_hack/spi25.c	(Revision 1049)
+++ flashrom-spi_progressbar_hack/spi25.c	(Arbeitskopie)
@@ -922,6 +922,8 @@
 	 * page as well, the loop condition uses <=.
 	 */
 	for (i = start / page_size; i <= (start + len - 1) / page_size; i++) {
+		/* Simple progress printing, one dot per page. */
+		msg_cdbg(".");
 		/* Byte position of the first byte in the range in this page. */
 		/* starthere is an offset to the base address of the chip. */
 		starthere = max(start, i * page_size);
@@ -966,6 +968,8 @@
 	 * page as well, the loop condition uses <=.
 	 */
 	for (i = start / page_size; i <= (start + len - 1) / page_size; i++) {
+		/* Simple progress printing, one dot per page. */
+		msg_cdbg(".");
 		/* Byte position of the first byte in the range in this page. */
 		/* starthere is an offset to the base address of the chip. */
 		starthere = max(start, i * page_size);
@@ -1006,6 +1010,9 @@
 	}
 	msg_cinfo("done.\n");
 	for (i = 0; i < total_size; i++) {
+		/* Simple progress printing, one dot per page. */
+		if (i % flash->page_size == 0)
+			msg_cdbg(".");
 		result = spi_byte_program(i, buf[i]);
 		if (result)
 			return 1;


-- 
http://www.hailfinger.org/





More information about the flashrom mailing list