<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 21, 2016 at 1:41 PM, Salvador Eduardo Tropea <span dir="ltr"><<a href="mailto:salvador@inti.gob.ar">salvador@inti.gob.ar</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi David:<br>
<br>
Thanks for your comments.<br>
<br>
<br>
El 20/04/16 a las 20:42, David Hendricks escribió:<span class="gmail-"><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
Hello Salvador,<br>
Yes, this is a very useful feature - we've had it in the chromiumos branch for a while now :-)<br>
<br>
I need to read your implementation. Ours is called "fast-verify" which will read and only verify portions of the flash specified with -i arguments.<br>
</blockquote>
<br></span>
What about writes? My problem is that I have a 4 MiB flash and that usually need to use 32kB from it.</blockquote><div><br></div><div>Yes, it works for writes as well. Using your layout file as an example:</div><div><div>00000000:00007e2b fpga</div><div>00007e2c:003fffff free</div></div><div><br></div><div>If the eraseblock size is 4KB and you run <i>"</i>flashrom -p <programmer> -l layout -i fpga -w foo.bin --fast-verify<i>"</i>, chromium's flashrom will:</div><div>1. Detect the flash chip.</div><div>2. Parse the -i argument</div><div>3. Do a partial read. This is broken into a multiple steps.</div><div>3a. Determine the "required_erase_size", for example, 4KB. Right now the mechanism is crude and chooses the smallest block size that is eraseable.</div><div>3b. Align regions that are read based on required_erase_size. 0000 is already aligned, but 7e2b will be aligned up to 7fff.</div><div>3c. Read the aligned region content, which is 0000:7fff instead of 0000:7e2b, into the new content buffer.</div><div>4. Copy the new content from the "fpga" region into the new content buffer.</div><div>5. Erase and write 0000:7fff</div><div>6. Verify from 0000:7fff</div><div><br></div><div>Overall it looks pretty similar to what you posted. Here's the original implementation: <a href="https://chromium-review.googlesource.com/#/c/240176/4">https://chromium-review.googlesource.com/#/c/240176/</a>. There are a couple of follow-up patches as well, in case you're interested.</div><div><br></div><div>One more thing to note - Be careful about interactions with the proposed patch to read the current contents of flash from a file: <a href="https://www.flashrom.org/pipermail/flashrom/2015-December/014034.html">https://www.flashrom.org/pipermail/flashrom/2015-December/014034.html</a>. Specifically, make sure that the aligned offsets are used for reading old content no matter if the old content is in a flash chip or a file.</div></div><div><br></div>-- <br><div class="gmail_signature">David Hendricks (dhendrix)<br>Systems Software Engineer, Google Inc.</div>
</div></div>