linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Mtd_debug patch
@ 2010-05-28 21:26 Stephen Beaver
  2010-06-13  8:57 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Beaver @ 2010-05-28 21:26 UTC (permalink / raw)
  To: linux-mtd


[-- Attachment #1.1: Type: text/plain, Size: 1214 bytes --]

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@anx.com
Think Green...do you really need to print this email?  Reduce, reuse,
recycle!


[-- Attachment #1.2: Type: text/html, Size: 2670 bytes --]

[-- Attachment #2: verify-blank.patch --]
[-- Type: video/x-flv, Size: 6670 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-13  9:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-28 21:26 Mtd_debug patch Stephen Beaver
2010-06-13  8:57 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).