<div class="gmail_quote">On Thu, Oct 28, 2010 at 8:35 PM, Carl-Daniel Hailfinger <span dir="ltr"><<a href="mailto:c-d.hailfinger.devel.2006@gmx.net">c-d.hailfinger.devel.2006@gmx.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On 29.10.2010 04:58, David Hendricks wrote:<br>
> New version, more bug fixes. Thanks for Carl-Daniel for testing!<br>
> - Restore the original ROM before beginning the second set of tests.<br>
> - The last iteration of the second test (un-aligned partial writes) was<br>
> causing problems on a 128KB part (emulated). I've removed it for now since<br>
> I'm in a hurry to get out tonight.<br>
> - Fixed a copy + paste error in the 4k aligned test layout.<br>
> - Added $FLASHROM_PARAM to the list of parameters passed into Flashrom.<br>
><br>
<br>
</div>Thanks! The following change to the second while loop seems to fix the<br>
issues with 128kB flash chips for me:<br>
<br>
# Protect against too long write<br>
writelen=4096<br>
if [ $((${offset} + 4096 + 4096)) -ge 131072 ]; then<br>
        writelen=$((131072 - $((${offset} + 4096))))<br>
        if [ ${writelen} -lt 0 ]; then<br>
                writelen=0<br>
        fi<br>
fi<br>
dd if=${ZERO_4K} of=${TESTFILE} bs=1 conv=notrunc seek=${offset} 2>/dev/null<br>
dd if=${FF_4K} of=${TESTFILE} bs=1 conv=notrunc seek=$((${offset} +<br>
4096)) count=writelen 2>/dev/null<br></blockquote><div><br></div><div>ACKed-by: David Hendricks <<a href="mailto:dhendrix@google.com">dhendrix@google.com</a>></div><div><br></div><div>Before you commit, add the last range to the unaligned layout and maybe add a note to the comments above. Maybe something like:</div>

<div><div><div><font class="Apple-style-span" face="'courier new', monospace"># 3. The new content must be written at specified offsets.</font></div><div><font class="Apple-style-span" face="'courier new', monospace">#</font></div>

</div><div><font class="Apple-style-span" face="'courier new', monospace"># Note: The last chunk of 0xff bytes is only 2K as to avoid overrunning a 128KB</font></div><div><font class="Apple-style-span" face="'courier new', monospace"># test image.</font></div>

</div><div><font class="Apple-style-span" face="'courier new', monospace">echo "</font></div><div><font class="Apple-style-span" face="'courier new', monospace">...</font></div><div><div><font class="Apple-style-span" face="'courier new', monospace">0x01e800:0x01f7ff 00_15</font></div>

<div><font class="Apple-style-span" face="'courier new', monospace">0x01f800:0x01ffff ff_15</font></div></div><div><font class="Apple-style-span" face="'courier new', monospace">" > layout_unaligned.txt</font></div>

<div><br></div><div>Thanks!</div></div><br>-- <br>David Hendricks (dhendrix)<br>Systems Software Engineer, Google Inc.<br>