Commit 8841d3e7 authored by Carl-Daniel Hailfinger's avatar Carl-Daniel Hailfinger
Browse files

Fix assorted documentation, frontend and printing bugs


Change the command line interface to make file names positional.
Add more sanity checks to the command line parser.

Corresponding to flashrom svn r998.
Signed-off-by: default avatarCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: default avatarMichael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
parent 316a29f3
...@@ -71,7 +71,7 @@ all: pciutils features dep $(PROGRAM) ...@@ -71,7 +71,7 @@ all: pciutils features dep $(PROGRAM)
# of the checked out flashrom files. # of the checked out flashrom files.
# Note to packagers: Any tree exported with "make export" or "make tarball" # Note to packagers: Any tree exported with "make export" or "make tarball"
# will not require subversion. The downloadable snapshots are already exported. # will not require subversion. The downloadable snapshots are already exported.
SVNVERSION := $(shell LC_ALL=C svnversion -cn . | sed -e "s/.*://" -e "s/\([0-9]*\).*/\1/" | grep "[0-9]" || LC_ALL=C svn info . | grep ^Revision | sed "s/.*[[:blank:]]\+\([0-9]*\)[^0-9]*/\1/" | grep "[0-9]" || echo unknown) SVNVERSION := $(shell LC_ALL=C svnversion -cn . 2>/dev/null | sed -e "s/.*://" -e "s/\([0-9]*\).*/\1/" | grep "[0-9]" || LC_ALL=C svn info . 2>/dev/null | awk '/^Revision:/ {print $$2 }' | grep "[0-9]" || LC_ALL=C git svn info . 2>/dev/null | awk '/^Revision:/ {print $$2 }' | grep "[0-9]" || echo unknown)
RELEASE := 0.9.1 RELEASE := 0.9.1
VERSION := $(RELEASE)-r$(SVNVERSION) VERSION := $(RELEASE)-r$(SVNVERSION)
......
...@@ -37,33 +37,53 @@ void cli_classic_usage(const char *name) ...@@ -37,33 +37,53 @@ void cli_classic_usage(const char *name)
int remaining = 0; int remaining = 0;
enum programmer p; enum programmer p;
printf("Usage: %s [-VfLzhR] [-E|-r file|-w file|-v file] [-c chipname]\n" printf("Usage: %s [-n] [-V] [-f] [-h|-R|-L|"
" [-m [vendor:]part] [-l file] [-i image] [-p programmer]\n\n", name); #if PRINT_WIKI_SUPPORT == 1
"-z|"
printf("Please note that the command line interface for flashrom will " #endif
"change before\nflashrom 1.0. Do not use flashrom in scripts " "-E|-r <file>|-w <file>|-v <file>]\n"
"or other automated tools without\nchecking that your flashrom" " [-c <chipname>] [-m [<vendor>:]<part>] [-l <file>]\n"
" version won't interpret options in a different way.\n\n"); " [-i <image>] [-p <programmername>[:<parameters>]]\n",
name);
printf
(" -r | --read: read flash and save into file\n" printf("Please note that the command line interface for flashrom has "
" -w | --write: write file into flash\n" "changed between\n"
" -v | --verify: verify flash against file\n" "0.9.1 and 0.9.2 and will change again before flashrom 1.0.\n"
" -n | --noverify: don't verify flash against file\n" "Do not use flashrom in scripts or other automated tools "
" -E | --erase: erase flash device\n" "without checking\n"
" -V | --verbose: more verbose output\n" "that your flashrom version won't interpret options in a "
" -c | --chip <chipname>: probe only for specified flash chip\n" "different way.\n\n");
printf(" -h | --help print this help text\n"
" -R | --version print version (release)\n"
" -r | --read <file> read flash and save to "
"<file>\n"
" -w | --write <file> write <file> to flash\n"
" -v | --verify <file> verify flash against "
"<file>\n"
" -E | --erase erase flash device\n"
" -V | --verbose more verbose output\n"
" -c | --chip <chipname> probe only for specified "
"flash chip\n"
#if INTERNAL_SUPPORT == 1 #if INTERNAL_SUPPORT == 1
" -m | --mainboard <[vendor:]part>: override mainboard settings\n" /* FIXME: --mainboard should be a programmer parameter */
" -m | --mainboard <[vendor:]part> override mainboard "
"detection\n"
#endif #endif
" -f | --force: force write without checking image\n" " -f | --force force specific operations "
" -l | --layout <file.layout>: read ROM layout from file\n" "(see man page)\n"
" -i | --image <name>: only flash image name from flash layout\n" " -n | --noverify don't auto-verify\n"
" -L | --list-supported: print supported devices\n" " -l | --layout <file> read ROM layout from "
"<file>\n"
" -i | --image <name> only flash image <name> "
"from flash layout\n"
" -L | --list-supported print supported devices\n"
#if PRINT_WIKI_SUPPORT == 1 #if PRINT_WIKI_SUPPORT == 1
" -z | --list-supported-wiki: print supported devices in wiki syntax\n" " -z | --list-supported-wiki print supported devices "
"in wiki syntax\n"
#endif #endif
" -p | --programmer <name>: specify the programmer device"); " -p | --programmer <name>[:<param>] specify the programmer "
"device");
for (p = 0; p < PROGRAMMER_INVALID; p++) { for (p = 0; p < PROGRAMMER_INVALID; p++) {
pname = programmer_table[p].name; pname = programmer_table[p].name;
...@@ -88,12 +108,19 @@ void cli_classic_usage(const char *name) ...@@ -88,12 +108,19 @@ void cli_classic_usage(const char *name)
printf(")\n"); printf(")\n");
} }
} }
printf( printf("\nYou can specify one of -h, -R, -L, "
" -h | --help: print this help text\n" #if PRINT_WIKI_SUPPORT == 1
" -R | --version: print the version (release)\n" "-z, "
"\nYou can specify one of -E, -r, -w, -v or no operation. If no operation is\n" #endif
"specified, then all that happens is that flash info is dumped.\n\n"); "-E, -r, -w, -v or no operation.\n"
"If no operation is specified, flashrom will only probe for "
"flash chips.\n\n");
}
void cli_classic_abort_usage(const char *name)
{
printf("Please run \"%s --help\" for usage info.\n", name);
exit(1); exit(1);
} }
...@@ -115,16 +142,12 @@ int cli_classic(int argc, char *argv[]) ...@@ -115,16 +142,12 @@ int cli_classic(int argc, char *argv[])
int operation_specified = 0; int operation_specified = 0;
int i; int i;
#if PRINT_WIKI_SUPPORT == 1 const char *optstring = "r:Rw:v:nVEfc:m:l:i:p:Lzh";
const char *optstring = "rRwvnVEfc:m:l:i:p:Lzh";
#else
const char *optstring = "rRwvnVEfc:m:l:i:p:Lh";
#endif
static struct option long_options[] = { static struct option long_options[] = {
{"read", 0, 0, 'r'}, {"read", 1, 0, 'r'},
{"write", 0, 0, 'w'}, {"write", 1, 0, 'w'},
{"erase", 0, 0, 'E'}, {"erase", 0, 0, 'E'},
{"verify", 0, 0, 'v'}, {"verify", 1, 0, 'v'},
{"noverify", 0, 0, 'n'}, {"noverify", 0, 0, 'n'},
{"chip", 1, 0, 'c'}, {"chip", 1, 0, 'c'},
{"mainboard", 1, 0, 'm'}, {"mainboard", 1, 0, 'm'},
...@@ -133,9 +156,7 @@ int cli_classic(int argc, char *argv[]) ...@@ -133,9 +156,7 @@ int cli_classic(int argc, char *argv[])
{"layout", 1, 0, 'l'}, {"layout", 1, 0, 'l'},
{"image", 1, 0, 'i'}, {"image", 1, 0, 'i'},
{"list-supported", 0, 0, 'L'}, {"list-supported", 0, 0, 'L'},
#if PRINT_WIKI_SUPPORT == 1
{"list-supported-wiki", 0, 0, 'z'}, {"list-supported-wiki", 0, 0, 'z'},
#endif
{"programmer", 1, 0, 'p'}, {"programmer", 1, 0, 'p'},
{"help", 0, 0, 'h'}, {"help", 0, 0, 'h'},
{"version", 0, 0, 'R'}, {"version", 0, 0, 'R'},
...@@ -147,18 +168,15 @@ int cli_classic(int argc, char *argv[]) ...@@ -147,18 +168,15 @@ int cli_classic(int argc, char *argv[])
char *tempstr = NULL; char *tempstr = NULL;
print_version(); print_version();
print_banner();
if (argc > 1) {
/* Yes, print them. */
printf_debug("The arguments are:\n");
for (i = 1; i < argc; ++i)
printf_debug("%s\n", argv[i]);
}
if (selfcheck()) if (selfcheck())
exit(1); exit(1);
setbuf(stdout, NULL); setbuf(stdout, NULL);
/* FIXME: Delay all operation_specified checks until after command
* line parsing to allow --help overriding everything else.
*/
while ((opt = getopt_long(argc, argv, optstring, while ((opt = getopt_long(argc, argv, optstring,
long_options, &option_index)) != EOF) { long_options, &option_index)) != EOF) {
switch (opt) { switch (opt) {
...@@ -166,16 +184,18 @@ int cli_classic(int argc, char *argv[]) ...@@ -166,16 +184,18 @@ int cli_classic(int argc, char *argv[])
if (++operation_specified > 1) { if (++operation_specified > 1) {
fprintf(stderr, "More than one operation " fprintf(stderr, "More than one operation "
"specified. Aborting.\n"); "specified. Aborting.\n");
exit(1); cli_classic_abort_usage(argv[0]);
} }
filename = strdup(optarg);
read_it = 1; read_it = 1;
break; break;
case 'w': case 'w':
if (++operation_specified > 1) { if (++operation_specified > 1) {
fprintf(stderr, "More than one operation " fprintf(stderr, "More than one operation "
"specified. Aborting.\n"); "specified. Aborting.\n");
exit(1); cli_classic_abort_usage(argv[0]);
} }
filename = strdup(optarg);
write_it = 1; write_it = 1;
break; break;
case 'v': case 'v':
...@@ -183,20 +203,21 @@ int cli_classic(int argc, char *argv[]) ...@@ -183,20 +203,21 @@ int cli_classic(int argc, char *argv[])
if (++operation_specified > 1) { if (++operation_specified > 1) {
fprintf(stderr, "More than one operation " fprintf(stderr, "More than one operation "
"specified. Aborting.\n"); "specified. Aborting.\n");
exit(1); cli_classic_abort_usage(argv[0]);
} }
if (dont_verify_it) { if (dont_verify_it) {
fprintf(stderr, "--verify and --noverify are" fprintf(stderr, "--verify and --noverify are"
"mutually exclusive. Aborting.\n"); "mutually exclusive. Aborting.\n");
exit(1); cli_classic_abort_usage(argv[0]);
} }
filename = strdup(optarg);
verify_it = 1; verify_it = 1;
break; break;
case 'n': case 'n':
if (verify_it) { if (verify_it) {
fprintf(stderr, "--verify and --noverify are" fprintf(stderr, "--verify and --noverify are"
"mutually exclusive. Aborting.\n"); "mutually exclusive. Aborting.\n");
exit(1); cli_classic_abort_usage(argv[0]);
} }
dont_verify_it = 1; dont_verify_it = 1;
break; break;
...@@ -210,36 +231,55 @@ int cli_classic(int argc, char *argv[]) ...@@ -210,36 +231,55 @@ int cli_classic(int argc, char *argv[])
if (++operation_specified > 1) { if (++operation_specified > 1) {
fprintf(stderr, "More than one operation " fprintf(stderr, "More than one operation "
"specified. Aborting.\n"); "specified. Aborting.\n");
exit(1); cli_classic_abort_usage(argv[0]);
} }
erase_it = 1; erase_it = 1;
break; break;
#if INTERNAL_SUPPORT == 1
case 'm': case 'm':
#if INTERNAL_SUPPORT == 1
tempstr = strdup(optarg); tempstr = strdup(optarg);
lb_vendor_dev_from_string(tempstr); lb_vendor_dev_from_string(tempstr);
break; #else
fprintf(stderr, "Error: Internal programmer support "
"was not compiled in and --mainboard only\n"
"applies to the internal programmer. Aborting.\n");
cli_classic_abort_usage(argv[0]);
#endif #endif
break;
case 'f': case 'f':
force = 1; force = 1;
break; break;
case 'l': case 'l':
tempstr = strdup(optarg); tempstr = strdup(optarg);
if (read_romlayout(tempstr)) if (read_romlayout(tempstr))
exit(1); cli_classic_abort_usage(argv[0]);
break; break;
case 'i': case 'i':
tempstr = strdup(optarg); tempstr = strdup(optarg);
find_romentry(tempstr); find_romentry(tempstr);
break; break;
case 'L': case 'L':
if (++operation_specified > 1) {
fprintf(stderr, "More than one operation "
"specified. Aborting.\n");
cli_classic_abort_usage(argv[0]);
}
list_supported = 1; list_supported = 1;
break; break;
#if PRINT_WIKI_SUPPORT == 1
case 'z': case 'z':
#if PRINT_WIKI_SUPPORT == 1
if (++operation_specified > 1) {
fprintf(stderr, "More than one operation "
"specified. Aborting.\n");
cli_classic_abort_usage(argv[0]);
}
list_supported_wiki = 1; list_supported_wiki = 1;
break; #else
fprintf(stderr, "Error: Wiki output was not compiled "
"in. Aborting.\n");
cli_classic_abort_usage(argv[0]);
#endif #endif
break;
case 'p': case 'p':
for (programmer = 0; programmer < PROGRAMMER_INVALID; programmer++) { for (programmer = 0; programmer < PROGRAMMER_INVALID; programmer++) {
name = programmer_table[programmer].name; name = programmer_table[programmer].name;
...@@ -267,21 +307,37 @@ int cli_classic(int argc, char *argv[]) ...@@ -267,21 +307,37 @@ int cli_classic(int argc, char *argv[])
} }
} }
if (programmer == PROGRAMMER_INVALID) { if (programmer == PROGRAMMER_INVALID) {
printf("Error: Unknown programmer %s.\n", optarg); fprintf(stderr, "Error: Unknown programmer "
exit(1); "%s.\n", optarg);
cli_classic_abort_usage(argv[0]);
} }
break; break;
case 'R': case 'R':
/* print_version() is always called during startup. */ /* print_version() is always called during startup. */
if (++operation_specified > 1) {
fprintf(stderr, "More than one operation "
"specified. Aborting.\n");
cli_classic_abort_usage(argv[0]);
}
exit(0); exit(0);
break; break;
case 'h': case 'h':
default: if (++operation_specified > 1) {
fprintf(stderr, "More than one operation "
"specified. Aborting.\n");
cli_classic_abort_usage(argv[0]);
}
cli_classic_usage(argv[0]); cli_classic_usage(argv[0]);
exit(0);
break;
default:
cli_classic_abort_usage(argv[0]);
break; break;
} }
} }
/* FIXME: Print the actions flashrom will take. */
if (list_supported) { if (list_supported) {
print_supported(); print_supported();
exit(0); exit(0);
...@@ -294,18 +350,18 @@ int cli_classic(int argc, char *argv[]) ...@@ -294,18 +350,18 @@ int cli_classic(int argc, char *argv[])
} }
#endif #endif
if (read_it && write_it) { if (optind < argc) {
printf("Error: -r and -w are mutually exclusive.\n"); fprintf(stderr, "Error: Extra parameter found.\n");
cli_classic_usage(argv[0]); cli_classic_abort_usage(argv[0]);
} }
if (optind < argc) #if INTERNAL_SUPPORT == 1
filename = argv[optind++]; if ((programmer != PROGRAMMER_INTERNAL) && (lb_part || lb_vendor)) {
fprintf(stderr, "Error: --mainboard requires the internal "
if (optind < argc) { "programmer. Aborting.\n");
printf("Error: Extra parameter found.\n"); cli_classic_abort_usage(argv[0]);
cli_classic_usage(argv[0]);
} }
#endif
if (chip_to_probe) { if (chip_to_probe) {
for (flash = flashchips; flash && flash->name; flash++) for (flash = flashchips; flash && flash->name; flash++)
...@@ -321,13 +377,15 @@ int cli_classic(int argc, char *argv[]) ...@@ -321,13 +377,15 @@ int cli_classic(int argc, char *argv[])
/* Clean up after the check. */ /* Clean up after the check. */
flash = NULL; flash = NULL;
} }
msg_pdbg("Initializing %s programmer\n",
programmer_table[programmer].name);
if (programmer_init()) { if (programmer_init()) {
fprintf(stderr, "Error: Programmer initialization failed.\n"); fprintf(stderr, "Error: Programmer initialization failed.\n");
exit(1); exit(1);
} }
// FIXME: Delay calibration should happen in programmer code. /* FIXME: Delay calibration should happen in programmer code. */
myusec_calibrate_delay(); myusec_calibrate_delay();
for (i = 0; i < ARRAY_SIZE(flashes); i++) { for (i = 0; i < ARRAY_SIZE(flashes); i++) {
...@@ -383,7 +441,7 @@ int cli_classic(int argc, char *argv[]) ...@@ -383,7 +441,7 @@ int cli_classic(int argc, char *argv[])
printf("No operations were specified.\n"); printf("No operations were specified.\n");
// FIXME: flash writes stay enabled! // FIXME: flash writes stay enabled!
programmer_shutdown(); programmer_shutdown();
exit(1); exit(0);
} }
if (!filename && !erase_it) { if (!filename && !erase_it) {
......
...@@ -548,6 +548,7 @@ int verify_range(struct flashchip *flash, uint8_t *cmpbuf, int start, int len, c ...@@ -548,6 +548,7 @@ int verify_range(struct flashchip *flash, uint8_t *cmpbuf, int start, int len, c
int need_erase(uint8_t *have, uint8_t *want, int len, enum write_granularity gran); int need_erase(uint8_t *have, uint8_t *want, int len, enum write_granularity gran);
char *strcat_realloc(char *dest, const char *src); char *strcat_realloc(char *dest, const char *src);
void print_version(void); void print_version(void);
void print_banner(void);
int selfcheck(void); int selfcheck(void);
int doit(struct flashchip *flash, int force, char *filename, int read_it, int write_it, int erase_it, int verify_it); int doit(struct flashchip *flash, int force, char *filename, int read_it, int write_it, int erase_it, int verify_it);
......
.TH FLASHROM 8 "May 21, 2009" .TH FLASHROM 8 "Apr 29, 2010"
.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\-VfLzhRn\fR] [\fB\-E\fR|\fB\-r\fR file|\fB\-w\fR file|\fB\-v\fR file] [\fB\-c\fR chipname] .B flashrom \fR[\fB\-n\fR] [\fB\-V\fR] [\fB\-f\fR] [\fB\-h\fR|\fB\-R\fR|\
[\fB\-m\fR [vendor:]part] [\fB\-l\fR file] [\fB\-i\fR image] [\fB\-p\fR programmer] \fB\-L\fR|\fB\-z\fR|\fB\-E\fR|\fB\-r\fR <file>|\fB\-w\fR <file>|\
\fB\-v\fR <file>]
[\fB\-c\fR <chipname>] [\fB\-m\fR [<vendor>:]<part>] \
[\fB\-l\fR <file>]
[\fB\-i\fR <image>] [\fB\-p\fR <programmername>[:<parameters>]]
.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
...@@ -20,9 +24,8 @@ Please note that the command line interface for flashrom will change before ...@@ -20,9 +24,8 @@ Please note that the command line interface for flashrom will change before
flashrom 1.0. Do not use flashrom in scripts or other automated tools without flashrom 1.0. Do not use flashrom in scripts or other automated tools without
checking that your flashrom version won't interpret options in a different way. checking that your flashrom version won't interpret options in a different way.
.PP .PP
You can specify one of \-E, \-r, \-w, \-v or no operation. You can specify one of \-h, \-R, \-L, \-z, \-E, \-r, \-w, \-v or no operation.
If no operation is specified, then all that happens If no operation is specified, flashrom will only probe for flash chips. It is
is that flash info is dumped and the flash chip is set to writable. It is
recommended that if you try flashrom the first time on a system, you run it recommended that if you try flashrom the first time on a system, you run it
in probe only mode and check the output. Also you are advised to make a in probe only mode and check the output. Also you are advised to make a
backup of your current ROM contents with \-r before you try to write a new backup of your current ROM contents with \-r before you try to write a new
...@@ -33,19 +36,19 @@ Read flash ROM contents and save them into the given ...@@ -33,19 +36,19 @@ Read flash ROM contents and save them into the given
.BR <file> . .BR <file> .
.TP .TP
.B "\-w, \-\-write <file>" .B "\-w, \-\-write <file>"
Write file into flash ROM. Write
.B <file>
into flash ROM.
.TP .TP
.B "\-n, \-\-noverify" .B "\-n, \-\-noverify"
Do Skip the automatic verification of flash ROM contents after writing. Using this
.B not
verify the flash ROM contents after writing them to the chip. Using this
option is option is
.B not .B not
recommended, you should only use it if you know what you are doing and you recommended, you should only use it if you know what you are doing and if you
feel that the time for verification takes too long. feel that the time for verification takes too long.
.sp .sp
Typical usage is: Typical usage is:
.B "flashrom -wn file" .B "flashrom -n -w file"
.sp .sp
This option is only useful in combination with This option is only useful in combination with
.BR \-\-write . .BR \-\-write .
...@@ -66,14 +69,14 @@ printed by ...@@ -66,14 +69,14 @@ printed by
.B "flashrom \-L" .B "flashrom \-L"
without the vendor name. Please note that the chip name is case sensitive. without the vendor name. Please note that the chip name is case sensitive.
.TP .TP
.B "\-m, \-\-mainboard" <[vendor:]part> .B "\-m, \-\-mainboard" [<vendor>:]<part>
Override mainboard settings. Override mainboard settings.
.sp .sp
flashrom reads the coreboot table to determine the current mainboard. If no flashrom reads the coreboot table to determine the current mainboard. If no
coreboot table could be read or if you want to override these values, you can coreboot table could be read or if you want to override these values, you can
specify \-m, e.g.: specify \-m, e.g.:
.sp .sp
.B " flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom" .B " flashrom --mainboard AGAMI:ARUMA -w agami_aruma.rom"
.sp .sp
See the 'Supported mainboards' section in the output of 'flashrom \-L' for See the 'Supported mainboards' section in the output of 'flashrom \-L' for
a list of boards which require the specification of the board name, if no a list of boards which require the specification of the board name, if no
...@@ -108,19 +111,15 @@ the flash chip only. A ROM layout file looks like follows: ...@@ -108,19 +111,15 @@ the flash chip only. A ROM layout file looks like follows:
All addresses are offsets within the file, not absolute addresses! All addresses are offsets within the file, not absolute addresses!
If you only want to update the normal image in a ROM you can say: If you only want to update the normal image in a ROM you can say:
.sp .sp
.B " flashrom -w --layout rom.layout --image normal agami_aruma.rom" .B " flashrom --layout rom.layout --image normal -w agami_aruma.rom"
.sp .sp
To update normal and fallback but leave the VGA BIOS alone, say: To update normal and fallback but leave the VGA BIOS alone, say:
.sp .sp
.B " flashrom -w -l rom.layout -i normal \" .B " flashrom -l rom.layout -i normal \"
.br .br
.B " -i fallback agami_aruma.rom" .B " -i fallback -w agami_aruma.rom"
.sp .sp
Currently overlapping sections are not supported. Currently overlapping sections are not supported.
.sp
ROM layouts should replace the \-s and \-e option since they are more
flexible and they should lead to a ROM update file format with the
ROM layout and the ROM image in one file (cpio, zip or something?).
.TP .TP
.B "\-i, \-\-image <name>" .B "\-i, \-\-image <name>"
Only flash image Only flash image
...@@ -141,7 +140,8 @@ if you have proper means to recover from failure! ...@@ -141,7 +140,8 @@ if you have proper means to recover from failure!
Same as Same as
.BR \-\-list\-supported , .BR \-\-list\-supported ,
but outputs the supported hardware in MediaWiki syntax, so that it can be but outputs the supported hardware in MediaWiki syntax, so that it can be
easily pasted into the wiki page at http://www.flashrom.org/. easily pasted into the wiki page at http://www.flashrom.org/. Please note
that MediaWiki output is not compiled in by default.
.TP .TP
.B "\-p, \-\-programmer <name>[:parameter[,parameter[,parameter]]]" .B "\-p, \-\-programmer <name>[:parameter[,parameter[,parameter]]]"
Specify the programmer device. Currently supported are: Specify the programmer device. Currently supported are:
...@@ -237,6 +237,7 @@ do not match, it will refuse to write the image unless you specify ...@@ -237,6 +237,7 @@ do not match, it will refuse to write the image unless you specify
.sp .sp
If your mainboard uses an ITE IT87 series Super I/O for LPC<->SPI flash bus If your mainboard uses an ITE IT87 series Super I/O for LPC<->SPI flash bus
translation, flashrom should autodetect that configuration. You can use translation, flashrom should autodetect that configuration. You can use
.sp
.B "flashrom -p internal:it87spiport=portnum" .B "flashrom -p internal:it87spiport=portnum"
syntax as explained in the syntax as explained in the
.B it87spi .B it87spi
...@@ -382,6 +383,8 @@ Li-Ta Lo ...@@ -382,6 +383,8 @@ Li-Ta Lo
.br .br
Markus Boas <ryven@ryven.de> Markus Boas <ryven@ryven.de>
.br .br
Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
.br
Nikolay Petukhov <nikolay.petukhov@gmail.com> Nikolay Petukhov <nikolay.petukhov@gmail.com>
.br .br
Peter Stuge <peter@stuge.se> Peter Stuge <peter@stuge.se>
...@@ -392,6 +395,8 @@ Ronald G. Minnich <rminnich@gmail.com> ...@@ -392,6 +395,8 @@ Ronald G. Minnich <rminnich@gmail.com>
.br .br
Ronald Hoogenboom <ronald@zonnet.nl> Ronald Hoogenboom <ronald@zonnet.nl>
.br .br
Sean Nelson <audiohacked@gmail.com>
.br
Stefan Reinauer <stepan@coresystems.de> Stefan Reinauer <stepan@coresystems.de>
.br .br
Stefan Wildemann <stefan.wildemann@kontron.com> Stefan Wildemann <stefan.wildemann@kontron.com>
...@@ -406,5 +411,6 @@ Yinghai Lu ...@@ -406,5 +411,6 @@ Yinghai Lu
.br .br
some others some others
.PP .PP
This manual page was written by Uwe Hermann <uwe@hermann-uwe.de>. This manual page was written by Uwe Hermann <uwe@hermann-uwe.de> and Carl-Daniel
Hailfinger.
It is licensed under the terms of the GNU GPL (version 2 or later). It is licensed under the terms of the GNU GPL (version 2 or later).
...@@ -1130,8 +1130,9 @@ void emergency_help_message(void) ...@@ -1130,8 +1130,9 @@ void emergency_help_message(void)
{ {
msg_gerr("Your flash chip is in an unknown state.\n" msg_gerr("Your flash chip is in an unknown state.\n"
"Get help on IRC at irc.freenode.net (channel #flashrom) or\n" "Get help on IRC at irc.freenode.net (channel #flashrom) or\n"
"mail flashrom@flashrom.org!\n--------------------" "mail flashrom@flashrom.org!\n"
"-----------------------------------------------------------\n" "-------------------------------------------------------------"
"------------------\n"
"DO NOT REBOOT OR POWEROFF!\n"); "DO NOT REBOOT OR POWEROFF!\n");
} }
...@@ -1183,10 +1184,17 @@ void print_sysinfo(void) ...@@ -1183,10 +1184,17 @@ void print_sysinfo(void)
void print_version(void) void print_version(void)
{ {
msg_ginfo("flashrom v%s\n", flashrom_version); msg_ginfo("flashrom v%s", flashrom_version);
print_sysinfo(); print_sysinfo();
} }
void print_banner(void)
{
msg_ginfo("flashrom is free software, get the source code at "
"http://www.flashrom.org\n");
msg_ginfo("\n");
}
int selfcheck(void) int selfcheck(void)
{ {
int ret = 0; int ret = 0;
...@@ -1247,13 +1255,20 @@ void check_chip_supported(struct flashchip *flash) ...@@ -1247,13 +1255,20 @@ void check_chip_supported(struct flashchip *flash)
msg_cinfo("\n"); msg_cinfo("\n");
} }
/* FIXME: This message is designed towards CLI users. */ /* FIXME: This message is designed towards CLI users. */
msg_cinfo("Please email a report to flashrom@flashrom.org if any " msg_cinfo("The test status of this chip may have been updated "
"of the above operations\nwork correctly for you with " "in the latest development\n"
"this flash part. Please include the flashrom\noutput " "version of flashrom. If you are running the latest "
"with the additional -V option for all operations you " "development version,\n"
"tested (-V, -rV,\n-wV, -EV), and mention which " "please email a report to flashrom@flashrom.org if "
"mainboard or programmer you tested.\nThanks for your " "any of the above operations\n"
"help!\n===\n"); "work correctly for you with this flash part. Please "
"include the flashrom\n"
"output with the additional -V option for all "
"operations you tested (-V, -Vr,\n"
"-Vw, -VE), and mention which mainboard or "
"programmer you tested.\n"
"Thanks for your help!\n"
"===\n");
} }
} }
......
...@@ -247,6 +247,9 @@ void print_supported(void) ...@@ -247,6 +247,9 @@ void print_supported(void)
#if SATASII_SUPPORT == 1 #if SATASII_SUPPORT == 1
print_supported_pcidevs(satas_sii); print_supported_pcidevs(satas_sii);
#endif #endif
#if ATAHPT_SUPPORT == 1
print_supported_pcidevs(ata_hpt);
#endif
} }
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "flash.h" #include "flash.h"
#include "flashchips.h" #include "flashchips.h"
#if INTERNAL_SUPPORT == 1
struct board_info_url { struct board_info_url {
const char *vendor; const char *vendor;
const char *name; const char *name;
...@@ -36,6 +37,7 @@ struct board_info_notes { ...@@ -36,6 +37,7 @@ struct board_info_notes {
const char *name; const char *name;
const char *note; const char *note;
}; };
#endif
const char *wiki_header = "= Supported devices =\n\n\ const char *wiki_header = "= Supported devices =\n\n\
<div style=\"margin-top:0.5em; padding:0.5em 0.5em 0.5em 0.5em; \ <div style=\"margin-top:0.5em; padding:0.5em 0.5em 0.5em 0.5em; \
...@@ -44,6 +46,7 @@ Please do '''not''' edit these tables in the wiki directly, they are \ ...@@ -44,6 +46,7 @@ Please do '''not''' edit these tables in the wiki directly, they are \
generated by pasting '''flashrom -z''' output.<br />\ generated by pasting '''flashrom -z''' output.<br />\
'''Last update:''' %s(generated by flashrom %s)\n</small></div>\n"; '''Last update:''' %s(generated by flashrom %s)\n</small></div>\n";
#if INTERNAL_SUPPORT == 1
const char *chipset_th = "{| border=\"0\" style=\"font-size: smaller\"\n\ const char *chipset_th = "{| border=\"0\" style=\"font-size: smaller\"\n\
|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\ |- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
! align=\"left\" | Southbridge\n! align=\"left\" | PCI IDs\n\ ! align=\"left\" | Southbridge\n! align=\"left\" | PCI IDs\n\
...@@ -69,6 +72,7 @@ or may not be added later.\n\n\ ...@@ -69,6 +72,7 @@ or may not be added later.\n\n\
Mainboards which don't appear in the list may or may not work (we don't \ Mainboards which don't appear in the list may or may not work (we don't \
know, someone has to give it a try). Please report any further verified \ know, someone has to give it a try). Please report any further verified \
mainboards on the [[Mailinglist|mailing list]].\n"; mainboards on the [[Mailinglist|mailing list]].\n";
#endif
const char *chip_th = "{| border=\"0\" style=\"font-size: smaller\" \ const char *chip_th = "{| border=\"0\" style=\"font-size: smaller\" \
valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\ valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
...@@ -85,6 +89,7 @@ smaller\" valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\ ...@@ -85,6 +89,7 @@ smaller\" valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
! align=\"left\" | Device\n! align=\"left\" | PCI IDs\n\ ! align=\"left\" | Device\n! align=\"left\" | PCI IDs\n\
! align=\"left\" | Status\n\n"; ! align=\"left\" | Status\n\n";
#if INTERNAL_SUPPORT == 1
const char *laptop_intro = "\n== Supported laptops/notebooks ==\n\n\ const char *laptop_intro = "\n== Supported laptops/notebooks ==\n\n\
In general, flashing laptops is more difficult because laptops\n\n\ In general, flashing laptops is more difficult because laptops\n\n\
* often use the flash chip for stuff besides the BIOS,\n\ * often use the flash chip for stuff besides the BIOS,\n\
...@@ -505,6 +510,7 @@ void print_supported_boards_wiki(void) ...@@ -505,6 +510,7 @@ void print_supported_boards_wiki(void)
wiki_helper("Known good (worked out of the box)", "OK", 1, laptops_ok); wiki_helper("Known good (worked out of the box)", "OK", 1, laptops_ok);
wiki_helper("Not supported (yet)", "No", 1, laptops_bad); wiki_helper("Not supported (yet)", "No", 1, laptops_bad);
} }
#endif
void print_supported_chips_wiki(void) void print_supported_chips_wiki(void)
{ {
...@@ -576,9 +582,11 @@ void print_supported_wiki(void) ...@@ -576,9 +582,11 @@ void print_supported_wiki(void)
time_t t = time(NULL); time_t t = time(NULL);
printf(wiki_header, ctime(&t), flashrom_version); printf(wiki_header, ctime(&t), flashrom_version);
#if INTERNAL_SUPPORT == 1
print_supported_chips_wiki(); print_supported_chips_wiki();
print_supported_chipsets_wiki(); print_supported_chipsets_wiki();
print_supported_boards_wiki(); print_supported_boards_wiki();
#endif
printf("%s", programmer_section); printf("%s", programmer_section);
#if NIC3COM_SUPPORT == 1 #if NIC3COM_SUPPORT == 1
print_supported_pcidevs_wiki(nics_3com); print_supported_pcidevs_wiki(nics_3com);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment