Mtd_debug patch

Stephen Beaver beavers at anx.com
Fri May 28 17:26:43 EDT 2010


The attached patch to the current version of mtd_debug (grabbed on5/28/2010)
adds two new capabilities:

usage: mtd_debug info   <device>
       mtd_debug read   <device> <offset> <len> <dest-filename>
       mtd_debug write  <device> <offset> <len> <source-filename>
       mtd_debug verify <device> <offset> <cmp-filename>
       mtd_debug erase  <device> <offset> <len>
       mtd_debug blank  <device> <offset> <len>

mtd_debug blank ... checks that an area of flash memory if blank (all 0xFFs)
ie it verifies that an erase succeeded.
mtd_debug verify ... checks that the contents of the flash memory match the
specified file. Ie it verifies that a write succeeded.

These functions allow things like:

#!/bin/sh

mtd_debug erase /dev/mtd1 0 0x200000
mtd_debug write /dev/mtd1 0 0x150000 uImage
if ( mtd_debug verifiy /dev/mtd1 0 uImage ) ; then
   reboot
else
   # Better try again, or we will die
fi



Both have been tested on NOR and NAND flash, and are just simple
modifications to the existing file_from_flash() function.

Steve
-- 
Stephen Beaver | ANXeBusiness | Engineering |219  232-8371 | www.anx.com |
beavers at anx.com
Think Green...do you really need to print this email?  Reduce, reuse,
recycle!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20100528/3be1cd3b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: verify-blank.patch
Type: video/x-flv
Size: 6669 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20100528/3be1cd3b/attachment.flv>


More information about the linux-mtd mailing list