mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-29 07:53:44 +02:00
Always verify write operations automatically
Should this be undesireable because of speed reasons, --noverify can be used to suppress an auto-verify. Corresponding to flashrom svn r631. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Harald Gutmann <harald.gutmann@gmx.net>
This commit is contained in:
parent
3431bb70aa
commit
ea07f6245c
20
flashrom.8
20
flashrom.8
@ -2,9 +2,8 @@
|
|||||||
.SH NAME
|
.SH NAME
|
||||||
flashrom \- detect, read, write, verify and erase flash chips
|
flashrom \- detect, read, write, verify and erase flash chips
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B flashrom \fR[\fB\-VfLzhR\fR] [\fB\-E\fR|\fB\-r\fR file|\fB\-w\fR file|\fB\-v\fR file]
|
.B flashrom \fR[\fB\-VfLzhRn\fR] [\fB\-E\fR|\fB\-r\fR file|\fB\-w\fR file|\fB\-v\fR file] [\fB\-c\fR chipname]
|
||||||
[\fB\-c\fR chipname] [\fB\-m\fR [vendor:]part]
|
[\fB\-m\fR [vendor:]part] [\fB\-l\fR file] [\fB\-i\fR image] [\fB\-p\fR programmer]
|
||||||
[\fB\-l\fR file] [\fB\-i\fR image] [\fB\-p\fR programmer]
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.B flashrom
|
.B flashrom
|
||||||
is a utility for detecting, reading, writing, verifying and erasing flash
|
is a utility for detecting, reading, writing, verifying and erasing flash
|
||||||
@ -38,6 +37,21 @@ Write file into flash ROM (default when
|
|||||||
.B <file>
|
.B <file>
|
||||||
is specified).
|
is specified).
|
||||||
.TP
|
.TP
|
||||||
|
.B "\-n, \-\-noverify"
|
||||||
|
Do
|
||||||
|
.B not
|
||||||
|
verify the flash ROM contents after writing them to the chip. Using this
|
||||||
|
option is
|
||||||
|
.B not
|
||||||
|
recommended, you should only use it if you know what you are doing and you
|
||||||
|
feel that the time for verification takes too long.
|
||||||
|
.sp
|
||||||
|
Typical usage is:
|
||||||
|
.B "flashrom -wn file"
|
||||||
|
.sp
|
||||||
|
This option is only useful in combination with
|
||||||
|
.BR \-\-write .
|
||||||
|
.TP
|
||||||
.B "\-v, \-\-verify <file>"
|
.B "\-v, \-\-verify <file>"
|
||||||
Verify the flash ROM contents against the given
|
Verify the flash ROM contents against the given
|
||||||
.BR <file> .
|
.BR <file> .
|
||||||
|
13
flashrom.c
13
flashrom.c
@ -480,6 +480,7 @@ void usage(const char *name)
|
|||||||
(" -r | --read: read flash and save into file\n"
|
(" -r | --read: read flash and save into file\n"
|
||||||
" -w | --write: write file into flash\n"
|
" -w | --write: write file into flash\n"
|
||||||
" -v | --verify: verify flash against file\n"
|
" -v | --verify: verify flash against file\n"
|
||||||
|
" -n | --noverify: don't verify flash against file\n"
|
||||||
" -E | --erase: erase flash device\n"
|
" -E | --erase: erase flash device\n"
|
||||||
" -V | --verbose: more verbose output\n"
|
" -V | --verbose: more verbose output\n"
|
||||||
" -c | --chip <chipname>: probe only for specified flash chip\n"
|
" -c | --chip <chipname>: probe only for specified flash chip\n"
|
||||||
@ -515,7 +516,7 @@ int main(int argc, char *argv[])
|
|||||||
int option_index = 0;
|
int option_index = 0;
|
||||||
int force = 0;
|
int force = 0;
|
||||||
int read_it = 0, write_it = 0, erase_it = 0, verify_it = 0;
|
int read_it = 0, write_it = 0, erase_it = 0, verify_it = 0;
|
||||||
int list_supported = 0, list_supported_wiki = 0;
|
int dont_verify_it = 0, list_supported = 0, list_supported_wiki = 0;
|
||||||
int operation_specified = 0;
|
int operation_specified = 0;
|
||||||
int ret = 0, i;
|
int ret = 0, i;
|
||||||
|
|
||||||
@ -524,6 +525,7 @@ int main(int argc, char *argv[])
|
|||||||
{"write", 0, 0, 'w'},
|
{"write", 0, 0, 'w'},
|
||||||
{"erase", 0, 0, 'E'},
|
{"erase", 0, 0, 'E'},
|
||||||
{"verify", 0, 0, 'v'},
|
{"verify", 0, 0, 'v'},
|
||||||
|
{"noverify", 0, 0, 'n'},
|
||||||
{"chip", 1, 0, 'c'},
|
{"chip", 1, 0, 'c'},
|
||||||
{"mainboard", 1, 0, 'm'},
|
{"mainboard", 1, 0, 'm'},
|
||||||
{"verbose", 0, 0, 'V'},
|
{"verbose", 0, 0, 'V'},
|
||||||
@ -553,7 +555,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
setbuf(stdout, NULL);
|
setbuf(stdout, NULL);
|
||||||
while ((opt = getopt_long(argc, argv, "rRwvVEfc:m:l:i:p:Lzh",
|
while ((opt = getopt_long(argc, argv, "rRwvnVEfc:m:l:i:p:Lzh",
|
||||||
long_options, &option_index)) != EOF) {
|
long_options, &option_index)) != EOF) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'r':
|
case 'r':
|
||||||
@ -580,6 +582,9 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
verify_it = 1;
|
verify_it = 1;
|
||||||
break;
|
break;
|
||||||
|
case 'n':
|
||||||
|
dont_verify_it = 1;
|
||||||
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
chip_to_probe = strdup(optarg);
|
chip_to_probe = strdup(optarg);
|
||||||
break;
|
break;
|
||||||
@ -779,6 +784,10 @@ int main(int argc, char *argv[])
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Always verify write operations unless -n is used. */
|
||||||
|
if (write_it && !dont_verify_it)
|
||||||
|
verify_it = 1;
|
||||||
|
|
||||||
size = flash->total_size * 1024;
|
size = flash->total_size * 1024;
|
||||||
buf = (uint8_t *) calloc(size, sizeof(char));
|
buf = (uint8_t *) calloc(size, sizeof(char));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user