flash/nor/tcl: add read_bank and verify_bank

The only read access to flash chips so is through the target's
memory. Flashes like jtagspi do not expose a memory mapped interface
to the flash. These commands use the flash_driver_read() driver API
directly.

Change-Id: I40b910de650114a3f676507f9f059a234377d862
Signed-off-by: Robert Jordens <jordens@gmail.com>
Reviewed-on: http://openocd.zylin.com/2842
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
This commit is contained in:
Robert Jordens
2015-07-01 02:55:49 -06:00
committed by Spencer Oliver
parent 2d99a0defa
commit 3edcb94186
2 changed files with 189 additions and 0 deletions

View File

@@ -4644,6 +4644,18 @@ starting at @var{offset} bytes from the beginning of the bank.
The @var{num} parameter is a value shown by @command{flash banks}.
@end deffn
@deffn Command {flash read_bank} num filename offset length
Read @var{length} bytes from the flash bank @var{num} starting at @var{offset}
and write the contents to the binary @file{filename}.
The @var{num} parameter is a value shown by @command{flash banks}.
@end deffn
@deffn Command {flash verify_bank} num filename offset
Compare the contents of the binary file @var{filename} with the contents of the
flash @var{num} starting at @var{offset}. Fails if the contents do not match.
The @var{num} parameter is a value shown by @command{flash banks}.
@end deffn
@deffn Command {flash write_image} [erase] [unlock] filename [offset] [type]
Write the image @file{filename} to the current target's flash bank(s).
Only loadable sections from the image are written.