<div dir="ltr"><div>Hi Willy,</div><div>You might be interested in another approach that is used in the <a href="https://chromium.googlesource.com/chromiumos/third_party/flashrom">chromium branch</a>. The "--diff" longopt allows the user to supply a file to diff against the -w argument. This is useful in cases where the user wishes to skip the initial read step, and flashrom will figure out which blocks need to be erased and written thereby eliminating unnecessary erase/write operations as well.</div><div><br></div>There is some documentation for it here: <a href="https://sites.google.com/a/chromium.org/dev/chromium-os/packages/cros-flashrom#TOC-Speeding-Up-Writes">https://sites.google.com/a/chromium.org/dev/chromium-os/packages/cros-flashrom#TOC-Speeding-Up-Writes</a><br><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 10, 2015 at 2:13 PM, Willy Tarreau <span dir="ltr"><<a href="mailto:w@1wt.eu" target="_blank">w@1wt.eu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I was bothered by having to read all the contents of an empty flash<br>
before programming just a boot loader to it. It's particularly long<br>
when using a buspirate board. I looked into the code to see how to<br>
bypass this and discovered it was already planned but not implemented<br>
due to the (presumably) complex API of the doit() function.<br>
<br>
I took a different route : I'm using 3 different write levels in write_it:<br>
  - normal write (read first)<br>
  - trusted write (no need to read but still erase)<br>
  - fully trusted write (flash assumed to be clean)<br>
<br>
These ones are set using a new "-t" flag for which I have even updated<br>
the man page and indicated that it's not recommended.<br>
<br>
It worked well for me so I'm sending the patches assuming they'll be<br>
useful for someone else.<br>
<br>
BTW, to give you a bit more context, I was writing a 8MB flash to upgrade<br>
a small router from its 4MB one, so I just had to add 4MB of \xff after the<br>
existing image before flashing it.<br>
<br>
Best regards,<br>
Willy<br>
<br>
<br>_______________________________________________<br>
flashrom mailing list<br>
<a href="mailto:flashrom@flashrom.org">flashrom@flashrom.org</a><br>
<a href="http://www.flashrom.org/mailman/listinfo/flashrom" rel="noreferrer" target="_blank">http://www.flashrom.org/mailman/listinfo/flashrom</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">David Hendricks (dhendrix)<br>Systems Software Engineer, Google Inc.</div>
</div>