From patchwork Thu Jun 17 10:31:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: SPI read/write progress bar hack Date: Thu, 17 Jun 2010 09:31:08 -0000 From: Carl-Daniel Hailfinger X-Patchwork-Id: 1522 Message-Id: <4C19F96C.50106@gmx.net> To: flashrom SPI read/write progress bar hack. Prints a dot for every page read/written. Signed-off-by: Carl-Daniel Hailfinger 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;