No, 0.9.2 is not yet out. This patch should be committed in r999 so that the 0.9.2 tag in svn will be r1000.
Patches I absolutely want to get in before 0.9.2:
AT49F002(N)(T) eraseblock fix (needs re-review due to datasheet contradictions) http://patchwork.coreboot.org/patch/833/
drkaiser: MEM BAR fixes (needs update to fix gfxnvidia MEM BAR as well) http://patchwork.coreboot.org/patch/1077/
msg_* conversions (two patches, preferably as one commit, needs review) http://patchwork.coreboot.org/patch/1167/ http://patchwork.coreboot.org/patch/1166/
Fix delay loop (needs review) http://patchwork.coreboot.org/patch/1172/
This means we can fit 5 additional patches in flashrom to reach the desired commit number.
Candidates for such patches (desirable, but not absolutely must-have):
flashrom dependencies (needs fixing) http://patchwork.coreboot.org/patch/1131/
Merge print/print_wiki tables (needs review) http://patchwork.coreboot.org/patch/1044/
Move Gigabyte it87spi boards to 'no enable' section (conflicts with 1044) http://patchwork.coreboot.org/patch/1151/
Fix Kontron 986lcd-m (needs cleanup and retesting) http://patchwork.coreboot.org/patch/871/
Add missing Intel/VIA chipset IDs (needs finishing, Idwer made some progress) http://patchwork.coreboot.org/patch/1169/
Suggestions for other patches? If I overlooked any of your patches, I'm sorry. Feel free to point me to them and/or push them for inclusion.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-0.9.2/Makefile =================================================================== --- flashrom-0.9.2/Makefile (Revision 989) +++ flashrom-0.9.2/Makefile (Arbeitskopie) @@ -73,7 +73,7 @@ # 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)
-RELEASE := 0.9.1 +RELEASE := 0.9.2 VERSION := $(RELEASE)-r$(SVNVERSION) RELEASENAME ?= $(VERSION)
On 30.03.2010 05:25, Carl-Daniel Hailfinger wrote:
No, 0.9.2 is not yet out. This patch should be committed in r999 so that the 0.9.2 tag in svn will be r1000.
This goal is now unreachable. I hope we can at least commit the makefile change for 0.9.2 in r1000, the tag will be at least r1001.
Patches I want to get in before 0.9.2:
AT49F002(N)(T) eraseblock fix (needs re-review due to datasheet contradictions) http://patchwork.coreboot.org/patch/833/
drkaiser: MEM BAR fixes (needs update to fix gfxnvidia MEM BAR as well) http://patchwork.coreboot.org/patch/1077/
msg_* conversions (two patches, preferably as one commit, needs review) http://patchwork.coreboot.org/patch/1167/ http://patchwork.coreboot.org/patch/1166/
Suggestions for other patches? If I overlooked any of your patches, I'm sorry. Feel free to point me to them and/or push them for inclusion.
The patch below is a bit heavy, but I think a substantial part of it (especially the man page stuff) is really needed to release 0.9.2 without being ashamed of it.
While I'd prefer to have all of the changes below in 0.9.2, I will listen to reviews and kill/change parts of this patch where needed.
One thing still needs to be fixed, though. Do we want to print the command line arguments 1. always before parsing them regardless of verbosity (great for debugging, but clutters the output needlessly) 2. only after parsing them and only in verbose mode 3. only after parsing them regardless of verbosity 4. never The option "before parsing, but only in verbose mode" does not exist because we have to parse them to know if the user requested verbose mode.
Changelog: Fix assorted documentation and frontend bugs.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-0.9.2/flashrom.8 =================================================================== --- flashrom-0.9.2/flashrom.8 (revision 996) +++ flashrom-0.9.2/flashrom.8 (working copy) @@ -1,9 +1,13 @@ -.TH FLASHROM 8 "May 21, 2009" +.TH FLASHROM 8 "Apr 29, 2010" .SH NAME flashrom - detect, read, write, verify and erase flash chips .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] - [\fB-m\fR [vendor:]part] [\fB-l\fR file] [\fB-i\fR image] [\fB-p\fR programmer] +.B flashrom \fR[\fB-n\fR] [\fB-V\fR] [\fB-f\fR] [\fB-h\fR|\fB-R\fR|\ +\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 .B flashrom is a utility for detecting, reading, writing, verifying and erasing flash @@ -20,9 +24,8 @@ 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. .PP -You can specify one of -E, -r, -w, -v or no operation. -If no operation is specified, then all that happens -is that flash info is dumped and the flash chip is set to writable. It is +You can specify one of -h, -R, -L, -z, -E, -r, -w, -v or no operation. +If no operation is specified, flashrom will only probe for flash chips. It is 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 backup of your current ROM contents with -r before you try to write a new @@ -42,10 +45,11 @@ 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. +feel that the time for verification takes too long. Please note that flashrom +will automatically verify all operations unless you specify --noverify. .sp Typical usage is: -.B "flashrom -wn file" +.B "flashrom -n -w file" .sp This option is only useful in combination with .BR --write . @@ -66,14 +70,14 @@ .B "flashrom -L" without the vendor name. Please note that the chip name is case sensitive. .TP -.B "-m, --mainboard" <[vendor:]part> +.B "-m, --mainboard" [<vendor>:]<part> Override mainboard settings. .sp 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 specify -m, e.g.: .sp -.B " flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom" +.B " flashrom --mainboard AGAMI:ARUMA -w agami_aruma.rom" .sp 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 @@ -108,19 +112,15 @@ 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: .sp -.B " flashrom -w --layout rom.layout --image normal agami_aruma.rom" +.B " flashrom --layout rom.layout --image normal -w agami_aruma.rom" .sp To update normal and fallback but leave the VGA BIOS alone, say: .sp -.B " flashrom -w -l rom.layout -i normal " +.B " flashrom -l rom.layout -i normal " .br -.B " -i fallback agami_aruma.rom" +.B " -i fallback -w agami_aruma.rom" .sp 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 .B "-i, --image <name>" Only flash image @@ -141,7 +141,8 @@ Same as .BR --list-supported , 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 .B "-p, --programmer <name>[:parameter[,parameter[,parameter]]]" Specify the programmer device. Currently supported are: @@ -237,6 +238,7 @@ .sp 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 +.sp .B "flashrom -p internal:it87spiport=portnum" syntax as explained in the .B it87spi @@ -382,6 +384,8 @@ .br Markus Boas ryven@ryven.de .br +Michael Karcher flashrom@mkarcher.dialup.fu-berlin.de +.br Nikolay Petukhov nikolay.petukhov@gmail.com .br Peter Stuge peter@stuge.se @@ -392,6 +396,8 @@ .br Ronald Hoogenboom ronald@zonnet.nl .br +Sean Nelson audiohacked@gmail.com +.br Stefan Reinauer stepan@coresystems.de .br Stefan Wildemann stefan.wildemann@kontron.com @@ -406,5 +412,6 @@ .br some others .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). Index: flashrom-0.9.2/flash.h =================================================================== --- flashrom-0.9.2/flash.h (revision 996) +++ flashrom-0.9.2/flash.h (working copy) @@ -548,6 +548,7 @@ int need_erase(uint8_t *have, uint8_t *want, int len, enum write_granularity gran); char *strcat_realloc(char *dest, const char *src); void print_version(void); +void print_banner(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);
Index: flashrom-0.9.2/Makefile =================================================================== --- flashrom-0.9.2/Makefile (revision 996) +++ flashrom-0.9.2/Makefile (working copy) @@ -71,9 +71,9 @@ # of the checked out flashrom files. # Note to packagers: Any tree exported with "make export" or "make tarball" # 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.2 VERSION := $(RELEASE)-r$(SVNVERSION) RELEASENAME ?= $(VERSION)
Index: flashrom-0.9.2/cli_classic.c =================================================================== --- flashrom-0.9.2/cli_classic.c (revision 996) +++ flashrom-0.9.2/cli_classic.c (working copy) @@ -37,33 +37,53 @@ int remaining = 0; enum programmer p;
- printf("Usage: %s [-VfLzhR] [-E|-r file|-w file|-v file] [-c chipname]\n" - " [-m [vendor:]part] [-l file] [-i image] [-p programmer]\n\n", name); + printf( + "Usage: %s [-n] [-V] [-f] [-h|-R|-L|" +#if PRINT_WIKI_SUPPORT == 1 + "-z|" +#endif + "-E|-r <file>|-w <file>|-v <file>]\n" + " [-c <chipname>] [-m [<vendor>:]<part>] [-l <file>]\n" + " [-i <image>] [-p <programmername>[:<parameters>]]\n", + name);
- printf("Please note that the command line interface for flashrom will " - "change before\nflashrom 1.0. Do not use flashrom in scripts " - "or other automated tools without\nchecking that your flashrom" - " version won't interpret options in a different way.\n\n"); + printf("Please note that the command line interface for flashrom has " + "changed between\n" + "0.9.1 and 0.9.2 and will change again before flashrom 1.0.\n" + "Do not use flashrom in scripts or other automated tools " + "without checking\n" + "that your flashrom version won't interpret options in a " + "different way.\n\n");
- printf - (" -r | --read: read flash and save into file\n" - " -w | --write: write file into flash\n" - " -v | --verify: verify flash against file\n" - " -n | --noverify: don't 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" + 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 - " -m | --mainboard <[vendor:]part>: override mainboard settings\n" + /* FIXME: --mainboard should be a programmer parameter */ + " -m | --mainboard <[vendor:]part> override mainboard " + "detection\n" #endif - " -f | --force: force write without checking image\n" - " -l | --layout <file.layout>: read ROM layout from file\n" - " -i | --image <name>: only flash image name from flash layout\n" - " -L | --list-supported: print supported devices\n" + " -f | --force force something\n" + " -n | --noverify don't auto-verify\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 - " -z | --list-supported-wiki: print supported devices in wiki syntax\n" + " -z | --list-supported-wiki print supported devices " + "in wiki syntax\n" #endif - " -p | --programmer <name>: specify the programmer device"); + " -p | --programmer <name>[:<param>] specify the programmer " + "device");
for (p = 0; p < PROGRAMMER_INVALID; p++) { pname = programmer_table[p].name; @@ -89,11 +109,18 @@ } } - printf( - " -h | --help: print this help text\n" - " -R | --version: print the version (release)\n" - "\nYou can specify one of -E, -r, -w, -v or no operation. If no operation is\n" - "specified, then all that happens is that flash info is dumped.\n\n"); + printf("\nYou can specify one of -h, -R, -L, " +#if PRINT_WIKI_SUPPORT == 1 + "-z, " +#endif + "-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) +{ + cli_classic_usage(name); exit(1); }
@@ -116,15 +143,15 @@ int i;
#if PRINT_WIKI_SUPPORT == 1 - const char *optstring = "rRwvnVEfc:m:l:i:p:Lzh"; + const char *optstring = "r:Rw:v:nVEfc:m:l:i:p:Lzh"; #else - const char *optstring = "rRwvnVEfc:m:l:i:p:Lh"; + const char *optstring = "r:Rw:v:nVEfc:m:l:i:p:Lh"; #endif static struct option long_options[] = { - {"read", 0, 0, 'r'}, - {"write", 0, 0, 'w'}, + {"read", 1, 0, 'r'}, + {"write", 1, 0, 'w'}, {"erase", 0, 0, 'E'}, - {"verify", 0, 0, 'v'}, + {"verify", 1, 0, 'v'}, {"noverify", 0, 0, 'n'}, {"chip", 1, 0, 'c'}, {"mainboard", 1, 0, 'm'}, @@ -147,7 +174,9 @@ char *tempstr = NULL;
print_version(); + print_banner();
+#warning This is broken. printf_debug is a no-op because verbose=0 at this point if (argc > 1) { /* Yes, print them. */ printf_debug("The arguments are:\n"); @@ -166,16 +195,18 @@ if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } + filename = strdup(optarg); read_it = 1; break; case 'w': if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } + filename = strdup(optarg); write_it = 1; break; case 'v': @@ -183,20 +214,21 @@ if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } if (dont_verify_it) { fprintf(stderr, "--verify and --noverify are" "mutually exclusive. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } + filename = strdup(optarg); verify_it = 1; break; case 'n': if (verify_it) { fprintf(stderr, "--verify and --noverify are" "mutually exclusive. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } dont_verify_it = 1; break; @@ -210,7 +242,7 @@ if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } erase_it = 1; break; @@ -226,6 +258,7 @@ case 'l': tempstr = strdup(optarg); if (read_romlayout(tempstr)) + /* FIXME: Print usage message here? */ exit(1); break; case 'i': @@ -233,10 +266,20 @@ find_romentry(tempstr); break; case 'L': + if (++operation_specified > 1) { + fprintf(stderr, "More than one operation " + "specified. Aborting.\n"); + cli_classic_abort_usage(argv[0]); + } list_supported = 1; break; #if PRINT_WIKI_SUPPORT == 1 case 'z': + if (++operation_specified > 1) { + fprintf(stderr, "More than one operation " + "specified. Aborting.\n"); + cli_classic_abort_usage(argv[0]); + } list_supported_wiki = 1; break; #endif @@ -268,17 +311,30 @@ } if (programmer == PROGRAMMER_INVALID) { printf("Error: Unknown programmer %s.\n", optarg); - exit(1); + cli_classic_abort_usage(argv[0]); } break; case 'R': /* 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); break; 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]); + exit(0); break; + default: + cli_classic_abort_usage(argv[0]); + break; } }
@@ -294,17 +350,9 @@ } #endif
- if (read_it && write_it) { - printf("Error: -r and -w are mutually exclusive.\n"); - cli_classic_usage(argv[0]); - } - - if (optind < argc) - filename = argv[optind++]; - if (optind < argc) { printf("Error: Extra parameter found.\n"); - cli_classic_usage(argv[0]); + cli_classic_abort_usage(argv[0]); }
if (chip_to_probe) { @@ -322,6 +370,8 @@ flash = NULL; } + msg_pdbg("Initializing %s programmer\n", + programmer_table[programmer].name); if (programmer_init()) { fprintf(stderr, "Error: Programmer initialization failed.\n"); exit(1); @@ -383,7 +433,7 @@ printf("No operations were specified.\n"); // FIXME: flash writes stay enabled! programmer_shutdown(); - exit(1); + exit(0); }
if (!filename && !erase_it) { Index: flashrom-0.9.2/flashrom.c =================================================================== --- flashrom-0.9.2/flashrom.c (revision 996) +++ flashrom-0.9.2/flashrom.c (working copy) @@ -1187,6 +1187,12 @@ print_sysinfo(); }
+void print_banner(void) +{ + printf("flashrom is free software, get the source code at " + "http://www.flashrom.org%5Cn"); +} + int selfcheck(void) { int ret = 0; @@ -1247,13 +1253,19 @@ printf("\n"); } /* FIXME: This message is designed towards CLI users. */ - printf("Please email a report to flashrom@flashrom.org if any " - "of the above operations\nwork correctly for you with " - "this flash part. Please include the flashrom\noutput " - "with the additional -V option for all operations you " - "tested (-V, -rV,\n-wV, -EV), and mention which " - "mainboard or programmer you tested.\nThanks for your " - "help!\n===\n"); + printf("The test status of this chip may have been updated in " + "the latest development\n" + "version of flashrom. If you are running the latest " + "development version,\n" + "please email a report to flashrom@flashrom.org if any " + "of the above operations\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"); } }
On 4/28/10 5:59 PM, Carl-Daniel Hailfinger wrote:
On 30.03.2010 05:25, Carl-Daniel Hailfinger wrote:
No, 0.9.2 is not yet out. This patch should be committed in r999 so that the 0.9.2 tag in svn will be r1000.
This goal is now unreachable. I hope we can at least commit the makefile change for 0.9.2 in r1000, the tag will be at least r1001.
Patches I want to get in before 0.9.2:
AT49F002(N)(T) eraseblock fix (needs re-review due to datasheet contradictions) http://patchwork.coreboot.org/patch/833/
drkaiser: MEM BAR fixes (needs update to fix gfxnvidia MEM BAR as well) http://patchwork.coreboot.org/patch/1077/
msg_* conversions (two patches, preferably as one commit, needs review) http://patchwork.coreboot.org/patch/1167/ http://patchwork.coreboot.org/patch/1166/
Suggestions for other patches? If I overlooked any of your patches, I'm sorry. Feel free to point me to them and/or push them for inclusion.
The patch below is a bit heavy, but I think a substantial part of it (especially the man page stuff) is really needed to release 0.9.2 without being ashamed of it.
While I'd prefer to have all of the changes below in 0.9.2, I will listen to reviews and kill/change parts of this patch where needed.
One thing still needs to be fixed, though. Do we want to print the command line arguments
- always before parsing them regardless of verbosity (great for
debugging, but clutters the output needlessly) 2. only after parsing them and only in verbose mode 3. only after parsing them regardless of verbosity 4. never The option "before parsing, but only in verbose mode" does not exist because we have to parse them to know if the user requested verbose mode.
Changelog: Fix assorted documentation and frontend bugs.
Signed-off-by: Carl-Daniel Hailfingerc-d.hailfinger.devel.2006@gmx.net
Index: flashrom-0.9.2/Makefile
--- flashrom-0.9.2/Makefile (revision 996) +++ flashrom-0.9.2/Makefile (working copy) @@ -71,9 +71,9 @@ # of the checked out flashrom files. # Note to packagers: Any tree exported with "make export" or "make tarball" # 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)
git svn info somehow prints: "Revision: 996" instead of "996".
-RELEASE := 0.9.1 +RELEASE := 0.9.2 VERSION := $(RELEASE)-r$(SVNVERSION) RELEASENAME ?= $(VERSION)
Index: flashrom-0.9.2/flashrom.c
--- flashrom-0.9.2/flashrom.c (revision 996) +++ flashrom-0.9.2/flashrom.c (working copy) @@ -1187,6 +1187,12 @@ print_sysinfo(); }
+void print_banner(void) +{
- printf("flashrom is free software, get the source code at "
should be msg_ginfo() ?
"http://www.flashrom.org\n");
+}
- int selfcheck(void) { int ret = 0;
@@ -1247,13 +1253,19 @@ printf("\n");
this will conflict with my patch once it's committed
} /* FIXME: This message is designed towards CLI users. */
printf("Please email a report to flashrom@flashrom.org if any "
patch conflict
"of the above operations\nwork correctly for you with "
"this flash part. Please include the flashrom\noutput "
"with the additional -V option for all operations you "
"tested (-V, -rV,\n-wV, -EV), and mention which "
"mainboard or programmer you tested.\nThanks for your "
"help!\n===\n");
printf("The test status of this chip may have been updated in "
should be msg_cinfo()?
"the latest development\n"
"version of flashrom. If you are running the latest "
"development version,\n"
"please email a report to flashrom@flashrom.org if any "
"of the above operations\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");
Once we get all this sorted, its
Acked-by: Sean Nelson audiohacked@gmail.com
Am Mittwoch, den 28.04.2010, 19:02 -0700 schrieb Sean Nelson:
-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)
git svn info somehow prints: "Revision: 996" instead of "996".
Duplicate the dollars. Like in '{ print $$2; }'
Works fine on MacOS X afterwards. Still works on Linux/GNU.
Regards, Micheal Karcher
On 29.04.2010 07:41, Michael Karcher wrote:
Am Mittwoch, den 28.04.2010, 19:02 -0700 schrieb Sean Nelson:
Thanks for the reviews! New patch follows, and it should even work.
Fix assorted documentation and frontend bugs. Change the command line interface to make file names positional. Calibrate the delay loop before initializing the programmer. Fix Tyan S2915 by commenting out MCP55 LPC PCI ID 10de:0361 and add debug output to avoid similar nightmares in the future.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-0.9.2-cleanup/flashrom.8 =================================================================== --- flashrom-0.9.2-cleanup/flashrom.8 (Revision 997) +++ flashrom-0.9.2-cleanup/flashrom.8 (Arbeitskopie) @@ -1,9 +1,13 @@ -.TH FLASHROM 8 "May 21, 2009" +.TH FLASHROM 8 "Apr 29, 2010" .SH NAME flashrom - detect, read, write, verify and erase flash chips .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] - [\fB-m\fR [vendor:]part] [\fB-l\fR file] [\fB-i\fR image] [\fB-p\fR programmer] +.B flashrom \fR[\fB-n\fR] [\fB-V\fR] [\fB-f\fR] [\fB-h\fR|\fB-R\fR|\ +\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 .B flashrom is a utility for detecting, reading, writing, verifying and erasing flash @@ -20,9 +24,8 @@ 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. .PP -You can specify one of -E, -r, -w, -v or no operation. -If no operation is specified, then all that happens -is that flash info is dumped and the flash chip is set to writable. It is +You can specify one of -h, -R, -L, -z, -E, -r, -w, -v or no operation. +If no operation is specified, flashrom will only probe for flash chips. It is 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 backup of your current ROM contents with -r before you try to write a new @@ -42,10 +45,11 @@ 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. +feel that the time for verification takes too long. Please note that flashrom +will automatically verify all operations unless you specify --noverify. .sp Typical usage is: -.B "flashrom -wn file" +.B "flashrom -n -w file" .sp This option is only useful in combination with .BR --write . @@ -66,14 +70,14 @@ .B "flashrom -L" without the vendor name. Please note that the chip name is case sensitive. .TP -.B "-m, --mainboard" <[vendor:]part> +.B "-m, --mainboard" [<vendor>:]<part> Override mainboard settings. .sp 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 specify -m, e.g.: .sp -.B " flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom" +.B " flashrom --mainboard AGAMI:ARUMA -w agami_aruma.rom" .sp 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 @@ -108,19 +112,15 @@ 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: .sp -.B " flashrom -w --layout rom.layout --image normal agami_aruma.rom" +.B " flashrom --layout rom.layout --image normal -w agami_aruma.rom" .sp To update normal and fallback but leave the VGA BIOS alone, say: .sp -.B " flashrom -w -l rom.layout -i normal " +.B " flashrom -l rom.layout -i normal " .br -.B " -i fallback agami_aruma.rom" +.B " -i fallback -w agami_aruma.rom" .sp 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 .B "-i, --image <name>" Only flash image @@ -141,7 +141,8 @@ Same as .BR --list-supported , 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 .B "-p, --programmer <name>[:parameter[,parameter[,parameter]]]" Specify the programmer device. Currently supported are: @@ -237,6 +238,7 @@ .sp 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 +.sp .B "flashrom -p internal:it87spiport=portnum" syntax as explained in the .B it87spi @@ -382,6 +384,8 @@ .br Markus Boas ryven@ryven.de .br +Michael Karcher flashrom@mkarcher.dialup.fu-berlin.de +.br Nikolay Petukhov nikolay.petukhov@gmail.com .br Peter Stuge peter@stuge.se @@ -392,6 +396,8 @@ .br Ronald Hoogenboom ronald@zonnet.nl .br +Sean Nelson audiohacked@gmail.com +.br Stefan Reinauer stepan@coresystems.de .br Stefan Wildemann stefan.wildemann@kontron.com @@ -406,5 +412,6 @@ .br some others .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). Index: flashrom-0.9.2-cleanup/flash.h =================================================================== --- flashrom-0.9.2-cleanup/flash.h (Revision 997) +++ flashrom-0.9.2-cleanup/flash.h (Arbeitskopie) @@ -548,6 +548,7 @@ int need_erase(uint8_t *have, uint8_t *want, int len, enum write_granularity gran); char *strcat_realloc(char *dest, const char *src); void print_version(void); +void print_banner(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);
Index: flashrom-0.9.2-cleanup/Makefile =================================================================== --- flashrom-0.9.2-cleanup/Makefile (Revision 997) +++ flashrom-0.9.2-cleanup/Makefile (Arbeitskopie) @@ -71,7 +71,7 @@ # of the checked out flashrom files. # Note to packagers: Any tree exported with "make export" or "make tarball" # 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 VERSION := $(RELEASE)-r$(SVNVERSION) Index: flashrom-0.9.2-cleanup/chipset_enable.c =================================================================== --- flashrom-0.9.2-cleanup/chipset_enable.c (Revision 997) +++ flashrom-0.9.2-cleanup/chipset_enable.c (Arbeitskopie) @@ -1354,7 +1354,15 @@ {0x10de, 0x0262, NT, "NVIDIA", "MCP51", enable_flash_ck804}, {0x10de, 0x0263, NT, "NVIDIA", "MCP51", enable_flash_ck804}, {0x10de, 0x0360, OK, "NVIDIA", "MCP55", enable_flash_mcp55}, /* M57SLI*/ - {0x10de, 0x0361, OK, "NVIDIA", "MCP55", enable_flash_mcp55}, /* LPC */ + /* 10de:0361 is present in Tyan S2915 systems, but not connected to + * the flash chip. Instead, 10de:0364 is connected to the flash chip. + * Until we have PCI device class matching or some fallback mechanism, + * this is needed to get flashrom working on Tyan S2915 and maybe other + * dual-MCP55 boards. + */ +#if 0 + {0x10de, 0x0361, NT, "NVIDIA", "MCP55", enable_flash_mcp55}, /* LPC */ +#endif {0x10de, 0x0362, OK, "NVIDIA", "MCP55", enable_flash_mcp55}, /* LPC */ {0x10de, 0x0363, OK, "NVIDIA", "MCP55", enable_flash_mcp55}, /* LPC */ {0x10de, 0x0364, OK, "NVIDIA", "MCP55", enable_flash_mcp55}, /* LPC */ @@ -1439,6 +1447,9 @@ msg_pinfo("Found chipset "%s %s", enabling flash write... ", chipset_enables[i].vendor_name, chipset_enables[i].device_name); + msg_pdbg("chipset PCI ID is %04x:%04x, ", + chipset_enables[i].vendor_id, + chipset_enables[i].device_id);
ret = chipset_enables[i].doit(dev, chipset_enables[i].device_name); Index: flashrom-0.9.2-cleanup/cli_classic.c =================================================================== --- flashrom-0.9.2-cleanup/cli_classic.c (Revision 997) +++ flashrom-0.9.2-cleanup/cli_classic.c (Arbeitskopie) @@ -37,33 +37,53 @@ int remaining = 0; enum programmer p;
- printf("Usage: %s [-VfLzhR] [-E|-r file|-w file|-v file] [-c chipname]\n" - " [-m [vendor:]part] [-l file] [-i image] [-p programmer]\n\n", name); + printf( + "Usage: %s [-n] [-V] [-f] [-h|-R|-L|" +#if PRINT_WIKI_SUPPORT == 1 + "-z|" +#endif + "-E|-r <file>|-w <file>|-v <file>]\n" + " [-c <chipname>] [-m [<vendor>:]<part>] [-l <file>]\n" + " [-i <image>] [-p <programmername>[:<parameters>]]\n", + name);
- printf("Please note that the command line interface for flashrom will " - "change before\nflashrom 1.0. Do not use flashrom in scripts " - "or other automated tools without\nchecking that your flashrom" - " version won't interpret options in a different way.\n\n"); + printf("Please note that the command line interface for flashrom has " + "changed between\n" + "0.9.1 and 0.9.2 and will change again before flashrom 1.0.\n" + "Do not use flashrom in scripts or other automated tools " + "without checking\n" + "that your flashrom version won't interpret options in a " + "different way.\n\n");
- printf - (" -r | --read: read flash and save into file\n" - " -w | --write: write file into flash\n" - " -v | --verify: verify flash against file\n" - " -n | --noverify: don't 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" + 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 - " -m | --mainboard <[vendor:]part>: override mainboard settings\n" + /* FIXME: --mainboard should be a programmer parameter */ + " -m | --mainboard <[vendor:]part> override mainboard " + "detection\n" #endif - " -f | --force: force write without checking image\n" - " -l | --layout <file.layout>: read ROM layout from file\n" - " -i | --image <name>: only flash image name from flash layout\n" - " -L | --list-supported: print supported devices\n" + " -f | --force force something\n" + " -n | --noverify don't auto-verify\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 - " -z | --list-supported-wiki: print supported devices in wiki syntax\n" + " -z | --list-supported-wiki print supported devices " + "in wiki syntax\n" #endif - " -p | --programmer <name>: specify the programmer device"); + " -p | --programmer <name>[:<param>] specify the programmer " + "device");
for (p = 0; p < PROGRAMMER_INVALID; p++) { pname = programmer_table[p].name; @@ -89,11 +109,18 @@ } } - printf( - " -h | --help: print this help text\n" - " -R | --version: print the version (release)\n" - "\nYou can specify one of -E, -r, -w, -v or no operation. If no operation is\n" - "specified, then all that happens is that flash info is dumped.\n\n"); + printf("\nYou can specify one of -h, -R, -L, " +#if PRINT_WIKI_SUPPORT == 1 + "-z, " +#endif + "-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) +{ + cli_classic_usage(name); exit(1); }
@@ -116,15 +143,15 @@ int i;
#if PRINT_WIKI_SUPPORT == 1 - const char *optstring = "rRwvnVEfc:m:l:i:p:Lzh"; + const char *optstring = "r:Rw:v:nVEfc:m:l:i:p:Lzh"; #else - const char *optstring = "rRwvnVEfc:m:l:i:p:Lh"; + const char *optstring = "r:Rw:v:nVEfc:m:l:i:p:Lh"; #endif static struct option long_options[] = { - {"read", 0, 0, 'r'}, - {"write", 0, 0, 'w'}, + {"read", 1, 0, 'r'}, + {"write", 1, 0, 'w'}, {"erase", 0, 0, 'E'}, - {"verify", 0, 0, 'v'}, + {"verify", 1, 0, 'v'}, {"noverify", 0, 0, 'n'}, {"chip", 1, 0, 'c'}, {"mainboard", 1, 0, 'm'}, @@ -147,13 +174,19 @@ char *tempstr = NULL;
print_version(); + print_banner();
+#if 0 + /* FIXME: This is broken. printf_debug is a no-op because verbose=0 + * at this point. + */ if (argc > 1) { /* Yes, print them. */ printf_debug("The arguments are:\n"); for (i = 1; i < argc; ++i) printf_debug("%s\n", argv[i]); } +#endif
if (selfcheck()) exit(1); @@ -166,16 +199,18 @@ if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } + filename = strdup(optarg); read_it = 1; break; case 'w': if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } + filename = strdup(optarg); write_it = 1; break; case 'v': @@ -183,20 +218,21 @@ if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } if (dont_verify_it) { fprintf(stderr, "--verify and --noverify are" "mutually exclusive. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } + filename = strdup(optarg); verify_it = 1; break; case 'n': if (verify_it) { fprintf(stderr, "--verify and --noverify are" "mutually exclusive. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } dont_verify_it = 1; break; @@ -210,7 +246,7 @@ if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } erase_it = 1; break; @@ -226,6 +262,7 @@ case 'l': tempstr = strdup(optarg); if (read_romlayout(tempstr)) + /* FIXME: Print usage message here? */ exit(1); break; case 'i': @@ -233,10 +270,20 @@ find_romentry(tempstr); break; case 'L': + if (++operation_specified > 1) { + fprintf(stderr, "More than one operation " + "specified. Aborting.\n"); + cli_classic_abort_usage(argv[0]); + } list_supported = 1; break; #if PRINT_WIKI_SUPPORT == 1 case 'z': + if (++operation_specified > 1) { + fprintf(stderr, "More than one operation " + "specified. Aborting.\n"); + cli_classic_abort_usage(argv[0]); + } list_supported_wiki = 1; break; #endif @@ -268,17 +315,30 @@ } if (programmer == PROGRAMMER_INVALID) { printf("Error: Unknown programmer %s.\n", optarg); - exit(1); + cli_classic_abort_usage(argv[0]); } break; case 'R': /* 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); break; 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]); + exit(0); break; + default: + cli_classic_abort_usage(argv[0]); + break; } }
@@ -294,17 +354,9 @@ } #endif
- if (read_it && write_it) { - printf("Error: -r and -w are mutually exclusive.\n"); - cli_classic_usage(argv[0]); - } - - if (optind < argc) - filename = argv[optind++]; - if (optind < argc) { printf("Error: Extra parameter found.\n"); - cli_classic_usage(argv[0]); + cli_classic_abort_usage(argv[0]); }
if (chip_to_probe) { @@ -322,14 +374,16 @@ flash = NULL; } + /* FIXME: Delay calibration should happen in programmer code. */ + myusec_calibrate_delay(); + + msg_pdbg("Initializing %s programmer\n", + programmer_table[programmer].name); if (programmer_init()) { fprintf(stderr, "Error: Programmer initialization failed.\n"); exit(1); }
- // FIXME: Delay calibration should happen in programmer code. - myusec_calibrate_delay(); - for (i = 0; i < ARRAY_SIZE(flashes); i++) { flashes[i] = probe_flash(i ? flashes[i - 1] + 1 : flashchips, 0); @@ -383,7 +437,7 @@ printf("No operations were specified.\n"); // FIXME: flash writes stay enabled! programmer_shutdown(); - exit(1); + exit(0); }
if (!filename && !erase_it) { Index: flashrom-0.9.2-cleanup/flashrom.c =================================================================== --- flashrom-0.9.2-cleanup/flashrom.c (Revision 997) +++ flashrom-0.9.2-cleanup/flashrom.c (Arbeitskopie) @@ -955,7 +955,7 @@ ret = verify_range(flash, buf, 0, total_size, NULL);
if (!ret) - msg_cinfo("VERIFIED. \n"); + msg_cinfo("VERIFIED.\n");
return ret; } @@ -1183,10 +1183,16 @@
void print_version(void) { - msg_ginfo("flashrom v%s\n", flashrom_version); + msg_ginfo("flashrom v%s", flashrom_version); print_sysinfo(); }
+void print_banner(void) +{ + msg_ginfo("flashrom is free software, get the source code at " + "http://www.flashrom.org%5Cn"); +} + int selfcheck(void) { int ret = 0; @@ -1247,13 +1253,19 @@ msg_cinfo("\n"); } /* FIXME: This message is designed towards CLI users. */ - msg_cinfo("Please email a report to flashrom@flashrom.org if any " - "of the above operations\nwork correctly for you with " - "this flash part. Please include the flashrom\noutput " - "with the additional -V option for all operations you " - "tested (-V, -rV,\n-wV, -EV), and mention which " - "mainboard or programmer you tested.\nThanks for your " - "help!\n===\n"); + msg_cinfo("The test status of this chip may have been updated " + "in the latest development\n" + "version of flashrom. If you are running the latest " + "development version,\n" + "please email a report to flashrom@flashrom.org if " + "any of the above operations\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"); } }
Index: flashrom-0.9.2-cleanup/print.c =================================================================== --- flashrom-0.9.2-cleanup/print.c (Revision 997) +++ flashrom-0.9.2-cleanup/print.c (Arbeitskopie) @@ -247,6 +247,9 @@ #if SATASII_SUPPORT == 1 print_supported_pcidevs(satas_sii); #endif +#if ATAHPT_SUPPORT == 1 + print_supported_pcidevs(ata_hpt); +#endif }
Fix assorted documentation and frontend bugs. Change the command line interface to make file names positional.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-0.9.2-cleanup/flashrom.8 =================================================================== --- flashrom-0.9.2-cleanup/flashrom.8 (Revision 997) +++ flashrom-0.9.2-cleanup/flashrom.8 (Arbeitskopie) @@ -1,9 +1,13 @@ -.TH FLASHROM 8 "May 21, 2009" +.TH FLASHROM 8 "Apr 29, 2010" .SH NAME flashrom - detect, read, write, verify and erase flash chips .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] - [\fB-m\fR [vendor:]part] [\fB-l\fR file] [\fB-i\fR image] [\fB-p\fR programmer] +.B flashrom \fR[\fB-n\fR] [\fB-V\fR] [\fB-f\fR] [\fB-h\fR|\fB-R\fR|\ +\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 .B flashrom is a utility for detecting, reading, writing, verifying and erasing flash @@ -20,9 +24,8 @@ 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. .PP -You can specify one of -E, -r, -w, -v or no operation. -If no operation is specified, then all that happens -is that flash info is dumped and the flash chip is set to writable. It is +You can specify one of -h, -R, -L, -z, -E, -r, -w, -v or no operation. +If no operation is specified, flashrom will only probe for flash chips. It is 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 backup of your current ROM contents with -r before you try to write a new @@ -42,10 +45,11 @@ 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. +feel that the time for verification takes too long. Please note that flashrom +will automatically verify all operations unless you specify --noverify. .sp Typical usage is: -.B "flashrom -wn file" +.B "flashrom -n -w file" .sp This option is only useful in combination with .BR --write . @@ -66,14 +70,14 @@ .B "flashrom -L" without the vendor name. Please note that the chip name is case sensitive. .TP -.B "-m, --mainboard" <[vendor:]part> +.B "-m, --mainboard" [<vendor>:]<part> Override mainboard settings. .sp 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 specify -m, e.g.: .sp -.B " flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom" +.B " flashrom --mainboard AGAMI:ARUMA -w agami_aruma.rom" .sp 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 @@ -108,19 +112,15 @@ 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: .sp -.B " flashrom -w --layout rom.layout --image normal agami_aruma.rom" +.B " flashrom --layout rom.layout --image normal -w agami_aruma.rom" .sp To update normal and fallback but leave the VGA BIOS alone, say: .sp -.B " flashrom -w -l rom.layout -i normal " +.B " flashrom -l rom.layout -i normal " .br -.B " -i fallback agami_aruma.rom" +.B " -i fallback -w agami_aruma.rom" .sp 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 .B "-i, --image <name>" Only flash image @@ -141,7 +141,8 @@ Same as .BR --list-supported , 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 .B "-p, --programmer <name>[:parameter[,parameter[,parameter]]]" Specify the programmer device. Currently supported are: @@ -237,6 +238,7 @@ .sp 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 +.sp .B "flashrom -p internal:it87spiport=portnum" syntax as explained in the .B it87spi @@ -382,6 +384,8 @@ .br Markus Boas ryven@ryven.de .br +Michael Karcher flashrom@mkarcher.dialup.fu-berlin.de +.br Nikolay Petukhov nikolay.petukhov@gmail.com .br Peter Stuge peter@stuge.se @@ -392,6 +396,8 @@ .br Ronald Hoogenboom ronald@zonnet.nl .br +Sean Nelson audiohacked@gmail.com +.br Stefan Reinauer stepan@coresystems.de .br Stefan Wildemann stefan.wildemann@kontron.com @@ -406,5 +412,6 @@ .br some others .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). Index: flashrom-0.9.2-cleanup/flash.h =================================================================== --- flashrom-0.9.2-cleanup/flash.h (Revision 997) +++ flashrom-0.9.2-cleanup/flash.h (Arbeitskopie) @@ -548,6 +548,7 @@ int need_erase(uint8_t *have, uint8_t *want, int len, enum write_granularity gran); char *strcat_realloc(char *dest, const char *src); void print_version(void); +void print_banner(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);
Index: flashrom-0.9.2-cleanup/Makefile =================================================================== --- flashrom-0.9.2-cleanup/Makefile (Revision 997) +++ flashrom-0.9.2-cleanup/Makefile (Arbeitskopie) @@ -71,7 +71,7 @@ # of the checked out flashrom files. # Note to packagers: Any tree exported with "make export" or "make tarball" # 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 VERSION := $(RELEASE)-r$(SVNVERSION) Index: flashrom-0.9.2-cleanup/cli_classic.c =================================================================== --- flashrom-0.9.2-cleanup/cli_classic.c (Revision 997) +++ flashrom-0.9.2-cleanup/cli_classic.c (Arbeitskopie) @@ -37,33 +37,53 @@ int remaining = 0; enum programmer p;
- printf("Usage: %s [-VfLzhR] [-E|-r file|-w file|-v file] [-c chipname]\n" - " [-m [vendor:]part] [-l file] [-i image] [-p programmer]\n\n", name); + printf( + "Usage: %s [-n] [-V] [-f] [-h|-R|-L|" +#if PRINT_WIKI_SUPPORT == 1 + "-z|" +#endif + "-E|-r <file>|-w <file>|-v <file>]\n" + " [-c <chipname>] [-m [<vendor>:]<part>] [-l <file>]\n" + " [-i <image>] [-p <programmername>[:<parameters>]]\n", + name);
- printf("Please note that the command line interface for flashrom will " - "change before\nflashrom 1.0. Do not use flashrom in scripts " - "or other automated tools without\nchecking that your flashrom" - " version won't interpret options in a different way.\n\n"); + printf("Please note that the command line interface for flashrom has " + "changed between\n" + "0.9.1 and 0.9.2 and will change again before flashrom 1.0.\n" + "Do not use flashrom in scripts or other automated tools " + "without checking\n" + "that your flashrom version won't interpret options in a " + "different way.\n\n");
- printf - (" -r | --read: read flash and save into file\n" - " -w | --write: write file into flash\n" - " -v | --verify: verify flash against file\n" - " -n | --noverify: don't 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" + 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 - " -m | --mainboard <[vendor:]part>: override mainboard settings\n" + /* FIXME: --mainboard should be a programmer parameter */ + " -m | --mainboard <[vendor:]part> override mainboard " + "detection\n" #endif - " -f | --force: force write without checking image\n" - " -l | --layout <file.layout>: read ROM layout from file\n" - " -i | --image <name>: only flash image name from flash layout\n" - " -L | --list-supported: print supported devices\n" + " -f | --force force something\n" + " -n | --noverify don't auto-verify\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 - " -z | --list-supported-wiki: print supported devices in wiki syntax\n" + " -z | --list-supported-wiki print supported devices " + "in wiki syntax\n" #endif - " -p | --programmer <name>: specify the programmer device"); + " -p | --programmer <name>[:<param>] specify the programmer " + "device");
for (p = 0; p < PROGRAMMER_INVALID; p++) { pname = programmer_table[p].name; @@ -89,11 +109,18 @@ } } - printf( - " -h | --help: print this help text\n" - " -R | --version: print the version (release)\n" - "\nYou can specify one of -E, -r, -w, -v or no operation. If no operation is\n" - "specified, then all that happens is that flash info is dumped.\n\n"); + printf("\nYou can specify one of -h, -R, -L, " +#if PRINT_WIKI_SUPPORT == 1 + "-z, " +#endif + "-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) +{ + cli_classic_usage(name); exit(1); }
@@ -115,16 +142,12 @@ int operation_specified = 0; int i;
-#if PRINT_WIKI_SUPPORT == 1 - const char *optstring = "rRwvnVEfc:m:l:i:p:Lzh"; -#else - const char *optstring = "rRwvnVEfc:m:l:i:p:Lh"; -#endif + const char *optstring = "r:Rw:v:nVEfc:m:l:i:p:Lzh"; static struct option long_options[] = { - {"read", 0, 0, 'r'}, - {"write", 0, 0, 'w'}, + {"read", 1, 0, 'r'}, + {"write", 1, 0, 'w'}, {"erase", 0, 0, 'E'}, - {"verify", 0, 0, 'v'}, + {"verify", 1, 0, 'v'}, {"noverify", 0, 0, 'n'}, {"chip", 1, 0, 'c'}, {"mainboard", 1, 0, 'm'}, @@ -133,9 +156,7 @@ {"layout", 1, 0, 'l'}, {"image", 1, 0, 'i'}, {"list-supported", 0, 0, 'L'}, -#if PRINT_WIKI_SUPPORT == 1 {"list-supported-wiki", 0, 0, 'z'}, -#endif {"programmer", 1, 0, 'p'}, {"help", 0, 0, 'h'}, {"version", 0, 0, 'R'}, @@ -147,13 +168,19 @@ char *tempstr = NULL;
print_version(); + print_banner();
+#if 0 + /* FIXME: This is broken. printf_debug is a no-op because verbose=0 + * at this point. + */ if (argc > 1) { /* Yes, print them. */ printf_debug("The arguments are:\n"); for (i = 1; i < argc; ++i) printf_debug("%s\n", argv[i]); } +#endif
if (selfcheck()) exit(1); @@ -166,16 +193,18 @@ if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } + filename = strdup(optarg); read_it = 1; break; case 'w': if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } + filename = strdup(optarg); write_it = 1; break; case 'v': @@ -183,20 +212,21 @@ if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } if (dont_verify_it) { fprintf(stderr, "--verify and --noverify are" "mutually exclusive. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } + filename = strdup(optarg); verify_it = 1; break; case 'n': if (verify_it) { fprintf(stderr, "--verify and --noverify are" "mutually exclusive. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } dont_verify_it = 1; break; @@ -210,7 +240,7 @@ if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } erase_it = 1; break; @@ -226,6 +256,7 @@ case 'l': tempstr = strdup(optarg); if (read_romlayout(tempstr)) + /* FIXME: Print usage message here? */ exit(1); break; case 'i': @@ -233,13 +264,27 @@ find_romentry(tempstr); break; case 'L': + if (++operation_specified > 1) { + fprintf(stderr, "More than one operation " + "specified. Aborting.\n"); + cli_classic_abort_usage(argv[0]); + } list_supported = 1; break; + case 'z': #if PRINT_WIKI_SUPPORT == 1 - case 'z': + if (++operation_specified > 1) { + fprintf(stderr, "More than one operation " + "specified. Aborting.\n"); + cli_classic_abort_usage(argv[0]); + } list_supported_wiki = 1; +#else + fprintf(stderr, "Error: Wiki output was not compiled " + "in. Aborting.\n"); + exit(1); +#endif break; -#endif case 'p': for (programmer = 0; programmer < PROGRAMMER_INVALID; programmer++) { name = programmer_table[programmer].name; @@ -268,17 +313,30 @@ } if (programmer == PROGRAMMER_INVALID) { printf("Error: Unknown programmer %s.\n", optarg); - exit(1); + cli_classic_abort_usage(argv[0]); } break; case 'R': /* 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); break; 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]); + exit(0); break; + default: + cli_classic_abort_usage(argv[0]); + break; } }
@@ -294,17 +352,9 @@ } #endif
- if (read_it && write_it) { - printf("Error: -r and -w are mutually exclusive.\n"); - cli_classic_usage(argv[0]); - } - - if (optind < argc) - filename = argv[optind++]; - if (optind < argc) { printf("Error: Extra parameter found.\n"); - cli_classic_usage(argv[0]); + cli_classic_abort_usage(argv[0]); }
if (chip_to_probe) { @@ -322,12 +372,14 @@ flash = NULL; } + msg_pdbg("Initializing %s programmer\n", + programmer_table[programmer].name); if (programmer_init()) { fprintf(stderr, "Error: Programmer initialization failed.\n"); exit(1); }
- // FIXME: Delay calibration should happen in programmer code. + /* FIXME: Delay calibration should happen in programmer code. */ myusec_calibrate_delay();
for (i = 0; i < ARRAY_SIZE(flashes); i++) { @@ -383,7 +435,7 @@ printf("No operations were specified.\n"); // FIXME: flash writes stay enabled! programmer_shutdown(); - exit(1); + exit(0); }
if (!filename && !erase_it) { Index: flashrom-0.9.2-cleanup/flashrom.c =================================================================== --- flashrom-0.9.2-cleanup/flashrom.c (Revision 997) +++ flashrom-0.9.2-cleanup/flashrom.c (Arbeitskopie) @@ -955,7 +955,7 @@ ret = verify_range(flash, buf, 0, total_size, NULL);
if (!ret) - msg_cinfo("VERIFIED. \n"); + msg_cinfo("VERIFIED.\n");
return ret; } @@ -1183,10 +1183,16 @@
void print_version(void) { - msg_ginfo("flashrom v%s\n", flashrom_version); + msg_ginfo("flashrom v%s", flashrom_version); print_sysinfo(); }
+void print_banner(void) +{ + msg_ginfo("flashrom is free software, get the source code at " + "http://www.flashrom.org%5Cn"); +} + int selfcheck(void) { int ret = 0; @@ -1247,13 +1253,19 @@ msg_cinfo("\n"); } /* FIXME: This message is designed towards CLI users. */ - msg_cinfo("Please email a report to flashrom@flashrom.org if any " - "of the above operations\nwork correctly for you with " - "this flash part. Please include the flashrom\noutput " - "with the additional -V option for all operations you " - "tested (-V, -rV,\n-wV, -EV), and mention which " - "mainboard or programmer you tested.\nThanks for your " - "help!\n===\n"); + msg_cinfo("The test status of this chip may have been updated " + "in the latest development\n" + "version of flashrom. If you are running the latest " + "development version,\n" + "please email a report to flashrom@flashrom.org if " + "any of the above operations\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"); } }
Index: flashrom-0.9.2-cleanup/print.c =================================================================== --- flashrom-0.9.2-cleanup/print.c (Revision 997) +++ flashrom-0.9.2-cleanup/print.c (Arbeitskopie) @@ -247,6 +247,9 @@ #if SATASII_SUPPORT == 1 print_supported_pcidevs(satas_sii); #endif +#if ATAHPT_SUPPORT == 1 + print_supported_pcidevs(ata_hpt); +#endif }
@@ -42,10 +45,11 @@ 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. +feel that the time for verification takes too long. Please note that flashrom +will automatically verify all operations unless you specify --noverify.
Reword the whole paragraph instead of adding the note, like -n, --noverify Skip the automatic verification after writing... Especially, I don't like "all operations", as the verify is only implied for write, but read and erase are also "operations".
/* FIXME: --mainboard should be a programmer parameter */
Right.
" -f | --force force something\n"
"force specific operations (see man page)" ?
" -n | --noverify don't auto-verify\n"
" -l | --layout <file> read ROM layout from "
"file\n"
Style: I would indent "file" up to "read ROM layout". Your choice.
+#if 0
- /* FIXME: This is broken. printf_debug is a no-op because verbose=0
* at this point.
if (argc > 1) { /* Yes, print them. */ printf_debug("The arguments are:\n"); for (i = 1; i < argc; ++i) printf_debug("%s\n", argv[i]); }*/
+#endif
Throw it out completely. Whoever just wants to see the parameters flashrom is called with should write a wrapper script.
exit(1);
cli_classic_abort_usage(argv[0]);
Don't dump the usage on syntax errors. It clutters output too much so that you don't find the error message. Just print a one-liner like 'run "flashrom --help" for usage info'. I especially liked the debian tool that outputs "You need --help.", but don't recommend this very phrase to flashrom.
if (programmer == PROGRAMMER_INVALID) { printf("Error: Unknown programmer %s.\n", optarg);
exit(1);
cli_classic_abort_usage(argv[0]); }
In this case, list the supported programmers (and just them).
msg_cinfo("VERIFIED. \n");
msg_cinfo("VERIFIED.\n");
The spaces probably were to clear address counter characters. Did you verify that it is not needed with current chip drivers?
The remaining stuff looks good, you get a tentative Acked-by: Michael Karcher flashrom@mkarcher.dialup.fu-berlin.de
Regards, Michael Karcher
On 15.05.2010 12:46, Michael Karcher wrote:
@@ -42,10 +45,11 @@ 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. +feel that the time for verification takes too long. Please note that flashrom +will automatically verify all operations unless you specify --noverify.
Reword the whole paragraph instead of adding the note, like -n, --noverify Skip the automatic verification after writing... Especially, I don't like "all operations", as the verify is only implied for write, but read and erase are also "operations".
Done.
/* FIXME: --mainboard should be a programmer parameter */
Right.
Post 0.9.2, I'd say.
" -f | --force force something\n"
"force specific operations (see man page)" ?
Done.
" -n | --noverify don't auto-verify\n"
" -l | --layout <file> read ROM layout from "
"file\n"
Style: I would indent "file" up to "read ROM layout". Your choice.
It's only for making the code conform to 80 columns. The output is in one line. As such, I'd like to have the string in the code start at the beginning to make that painfully obvious.
+#if 0
- /* FIXME: This is broken. printf_debug is a no-op because verbose=0
* at this point.
if (argc > 1) { /* Yes, print them. */ printf_debug("The arguments are:\n"); for (i = 1; i < argc; ++i) printf_debug("%s\n", argv[i]); }*/
+#endif
Throw it out completely. Whoever just wants to see the parameters flashrom is called with should write a wrapper script.
I'd love to acticate that code permanently, but it does make sense to move the code down after option parsing, and reconstruct the arguments there. This is intended to make helping users easier, and also to simplify automated parsing of user reports. What do you think? Should I kill the code and add a FIXME comment?
exit(1);
cli_classic_abort_usage(argv[0]);
Don't dump the usage on syntax errors. It clutters output too much so that you don't find the error message. Just print a one-liner like 'run "flashrom --help" for usage info'. I especially liked the debian tool that outputs "You need --help.", but don't recommend this very phrase to flashrom.
I've changed cli_classic_abort_usage accordingly.
if (programmer == PROGRAMMER_INVALID) { printf("Error: Unknown programmer %s.\n", optarg);
exit(1);
cli_classic_abort_usage(argv[0]); }
In this case, list the supported programmers (and just them).
Hm. My current version tells the user to run "flashrom --help" and that will print a list of supported programmers. Is that OK for you?
msg_cinfo("VERIFIED. \n");
msg_cinfo("VERIFIED.\n");
The spaces probably were to clear address counter characters. Did you verify that it is not needed with current chip drivers?
Ouch, right! Thanks for spotting this. (One of the reasons I dislike the current progress printing stuff.)
The remaining stuff looks good, you get a tentative Acked-by: Michael Karcher flashrom@mkarcher.dialup.fu-berlin.de
Thanks for the review, could you please check if the new patch is OK? I added an error if --mainboard is specified for a non-internal programmer, fixed wiki printing compilation and adjusted some messages.
Regards, Carl-Daniel
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.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-0.9.2-cleanup/flashrom.8 =================================================================== --- flashrom-0.9.2-cleanup/flashrom.8 (Revision 997) +++ flashrom-0.9.2-cleanup/flashrom.8 (Arbeitskopie) @@ -1,9 +1,13 @@ -.TH FLASHROM 8 "May 21, 2009" +.TH FLASHROM 8 "Apr 29, 2010" .SH NAME flashrom - detect, read, write, verify and erase flash chips .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] - [\fB-m\fR [vendor:]part] [\fB-l\fR file] [\fB-i\fR image] [\fB-p\fR programmer] +.B flashrom \fR[\fB-n\fR] [\fB-V\fR] [\fB-f\fR] [\fB-h\fR|\fB-R\fR|\ +\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 .B flashrom is a utility for detecting, reading, writing, verifying and erasing flash @@ -20,9 +24,8 @@ 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. .PP -You can specify one of -E, -r, -w, -v or no operation. -If no operation is specified, then all that happens -is that flash info is dumped and the flash chip is set to writable. It is +You can specify one of -h, -R, -L, -z, -E, -r, -w, -v or no operation. +If no operation is specified, flashrom will only probe for flash chips. It is 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 backup of your current ROM contents with -r before you try to write a new @@ -33,19 +36,19 @@ .BR <file> . .TP .B "-w, --write <file>" -Write file into flash ROM. +Write +.B <file> +into flash ROM. .TP .B "-n, --noverify" -Do -.B not -verify the flash ROM contents after writing them to the chip. Using this +Skip the automatic verification of flash ROM contents after writing. Using this option is .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. .sp Typical usage is: -.B "flashrom -wn file" +.B "flashrom -n -w file" .sp This option is only useful in combination with .BR --write . @@ -66,14 +69,14 @@ .B "flashrom -L" without the vendor name. Please note that the chip name is case sensitive. .TP -.B "-m, --mainboard" <[vendor:]part> +.B "-m, --mainboard" [<vendor>:]<part> Override mainboard settings. .sp 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 specify -m, e.g.: .sp -.B " flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom" +.B " flashrom --mainboard AGAMI:ARUMA -w agami_aruma.rom" .sp 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 @@ -108,19 +111,15 @@ 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: .sp -.B " flashrom -w --layout rom.layout --image normal agami_aruma.rom" +.B " flashrom --layout rom.layout --image normal -w agami_aruma.rom" .sp To update normal and fallback but leave the VGA BIOS alone, say: .sp -.B " flashrom -w -l rom.layout -i normal " +.B " flashrom -l rom.layout -i normal " .br -.B " -i fallback agami_aruma.rom" +.B " -i fallback -w agami_aruma.rom" .sp 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 .B "-i, --image <name>" Only flash image @@ -141,7 +140,8 @@ Same as .BR --list-supported , 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 .B "-p, --programmer <name>[:parameter[,parameter[,parameter]]]" Specify the programmer device. Currently supported are: @@ -237,6 +237,7 @@ .sp 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 +.sp .B "flashrom -p internal:it87spiport=portnum" syntax as explained in the .B it87spi @@ -382,6 +383,8 @@ .br Markus Boas ryven@ryven.de .br +Michael Karcher flashrom@mkarcher.dialup.fu-berlin.de +.br Nikolay Petukhov nikolay.petukhov@gmail.com .br Peter Stuge peter@stuge.se @@ -392,6 +395,8 @@ .br Ronald Hoogenboom ronald@zonnet.nl .br +Sean Nelson audiohacked@gmail.com +.br Stefan Reinauer stepan@coresystems.de .br Stefan Wildemann stefan.wildemann@kontron.com @@ -406,5 +411,6 @@ .br some others .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). Index: flashrom-0.9.2-cleanup/flash.h =================================================================== --- flashrom-0.9.2-cleanup/flash.h (Revision 997) +++ flashrom-0.9.2-cleanup/flash.h (Arbeitskopie) @@ -548,6 +548,7 @@ int need_erase(uint8_t *have, uint8_t *want, int len, enum write_granularity gran); char *strcat_realloc(char *dest, const char *src); void print_version(void); +void print_banner(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);
Index: flashrom-0.9.2-cleanup/Makefile =================================================================== --- flashrom-0.9.2-cleanup/Makefile (Revision 997) +++ flashrom-0.9.2-cleanup/Makefile (Arbeitskopie) @@ -71,7 +71,7 @@ # of the checked out flashrom files. # Note to packagers: Any tree exported with "make export" or "make tarball" # 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 VERSION := $(RELEASE)-r$(SVNVERSION) Index: flashrom-0.9.2-cleanup/cli_classic.c =================================================================== --- flashrom-0.9.2-cleanup/cli_classic.c (Revision 997) +++ flashrom-0.9.2-cleanup/cli_classic.c (Arbeitskopie) @@ -37,33 +37,54 @@ int remaining = 0; enum programmer p;
- printf("Usage: %s [-VfLzhR] [-E|-r file|-w file|-v file] [-c chipname]\n" - " [-m [vendor:]part] [-l file] [-i image] [-p programmer]\n\n", name); + printf( + "Usage: %s [-n] [-V] [-f] [-h|-R|-L|" +#if PRINT_WIKI_SUPPORT == 1 + "-z|" +#endif + "-E|-r <file>|-w <file>|-v <file>]\n" + " [-c <chipname>] [-m [<vendor>:]<part>] [-l <file>]\n" + " [-i <image>] [-p <programmername>[:<parameters>]]\n", + name);
- printf("Please note that the command line interface for flashrom will " - "change before\nflashrom 1.0. Do not use flashrom in scripts " - "or other automated tools without\nchecking that your flashrom" - " version won't interpret options in a different way.\n\n"); + printf("Please note that the command line interface for flashrom has " + "changed between\n" + "0.9.1 and 0.9.2 and will change again before flashrom 1.0.\n" + "Do not use flashrom in scripts or other automated tools " + "without checking\n" + "that your flashrom version won't interpret options in a " + "different way.\n\n");
- printf - (" -r | --read: read flash and save into file\n" - " -w | --write: write file into flash\n" - " -v | --verify: verify flash against file\n" - " -n | --noverify: don't 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" + 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 - " -m | --mainboard <[vendor:]part>: override mainboard settings\n" + /* FIXME: --mainboard should be a programmer parameter */ + " -m | --mainboard <[vendor:]part> override mainboard " + "detection\n" #endif - " -f | --force: force write without checking image\n" - " -l | --layout <file.layout>: read ROM layout from file\n" - " -i | --image <name>: only flash image name from flash layout\n" - " -L | --list-supported: print supported devices\n" + " -f | --force force specific operations " + "(see man page)\n" + " -n | --noverify don't auto-verify\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 - " -z | --list-supported-wiki: print supported devices in wiki syntax\n" + " -z | --list-supported-wiki print supported devices " + "in wiki syntax\n" #endif - " -p | --programmer <name>: specify the programmer device"); + " -p | --programmer <name>[:<param>] specify the programmer " + "device");
for (p = 0; p < PROGRAMMER_INVALID; p++) { pname = programmer_table[p].name; @@ -89,11 +110,18 @@ } } - printf( - " -h | --help: print this help text\n" - " -R | --version: print the version (release)\n" - "\nYou can specify one of -E, -r, -w, -v or no operation. If no operation is\n" - "specified, then all that happens is that flash info is dumped.\n\n"); + printf("\nYou can specify one of -h, -R, -L, " +#if PRINT_WIKI_SUPPORT == 1 + "-z, " +#endif + "-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); }
@@ -115,16 +143,12 @@ int operation_specified = 0; int i;
-#if PRINT_WIKI_SUPPORT == 1 - const char *optstring = "rRwvnVEfc:m:l:i:p:Lzh"; -#else - const char *optstring = "rRwvnVEfc:m:l:i:p:Lh"; -#endif + const char *optstring = "r:Rw:v:nVEfc:m:l:i:p:Lzh"; static struct option long_options[] = { - {"read", 0, 0, 'r'}, - {"write", 0, 0, 'w'}, + {"read", 1, 0, 'r'}, + {"write", 1, 0, 'w'}, {"erase", 0, 0, 'E'}, - {"verify", 0, 0, 'v'}, + {"verify", 1, 0, 'v'}, {"noverify", 0, 0, 'n'}, {"chip", 1, 0, 'c'}, {"mainboard", 1, 0, 'm'}, @@ -133,9 +157,7 @@ {"layout", 1, 0, 'l'}, {"image", 1, 0, 'i'}, {"list-supported", 0, 0, 'L'}, -#if PRINT_WIKI_SUPPORT == 1 {"list-supported-wiki", 0, 0, 'z'}, -#endif {"programmer", 1, 0, 'p'}, {"help", 0, 0, 'h'}, {"version", 0, 0, 'R'}, @@ -147,13 +169,19 @@ char *tempstr = NULL;
print_version(); + print_banner();
+#if 0 + /* FIXME: This is broken. printf_debug is a no-op because verbose=0 + * at this point. + */ if (argc > 1) { /* Yes, print them. */ printf_debug("The arguments are:\n"); for (i = 1; i < argc; ++i) printf_debug("%s\n", argv[i]); } +#endif
if (selfcheck()) exit(1); @@ -166,16 +194,18 @@ if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } + filename = strdup(optarg); read_it = 1; break; case 'w': if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } + filename = strdup(optarg); write_it = 1; break; case 'v': @@ -183,20 +213,21 @@ if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } if (dont_verify_it) { fprintf(stderr, "--verify and --noverify are" "mutually exclusive. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } + filename = strdup(optarg); verify_it = 1; break; case 'n': if (verify_it) { fprintf(stderr, "--verify and --noverify are" "mutually exclusive. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } dont_verify_it = 1; break; @@ -210,36 +241,55 @@ if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } erase_it = 1; break; + case 'm': #if INTERNAL_SUPPORT == 1 - case 'm': tempstr = strdup(optarg); lb_vendor_dev_from_string(tempstr); +#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 break; -#endif case 'f': force = 1; break; case 'l': tempstr = strdup(optarg); if (read_romlayout(tempstr)) - exit(1); + cli_classic_abort_usage(argv[0]); break; case 'i': tempstr = strdup(optarg); find_romentry(tempstr); break; case 'L': + if (++operation_specified > 1) { + fprintf(stderr, "More than one operation " + "specified. Aborting.\n"); + cli_classic_abort_usage(argv[0]); + } list_supported = 1; break; + case 'z': #if PRINT_WIKI_SUPPORT == 1 - case 'z': + if (++operation_specified > 1) { + fprintf(stderr, "More than one operation " + "specified. Aborting.\n"); + cli_classic_abort_usage(argv[0]); + } list_supported_wiki = 1; +#else + fprintf(stderr, "Error: Wiki output was not compiled " + "in. Aborting.\n"); + cli_classic_abort_usage(argv[0]); +#endif break; -#endif case 'p': for (programmer = 0; programmer < PROGRAMMER_INVALID; programmer++) { name = programmer_table[programmer].name; @@ -267,18 +317,32 @@ } } if (programmer == PROGRAMMER_INVALID) { - printf("Error: Unknown programmer %s.\n", optarg); - exit(1); + fprintf(stderr, "Error: Unknown programmer " + "%s.\n", optarg); + cli_classic_abort_usage(argv[0]); } break; case 'R': /* 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); break; 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]); + exit(0); break; + default: + cli_classic_abort_usage(argv[0]); + break; } }
@@ -294,18 +358,18 @@ } #endif
- if (read_it && write_it) { - printf("Error: -r and -w are mutually exclusive.\n"); - cli_classic_usage(argv[0]); + if (optind < argc) { + fprintf(stderr, "Error: Extra parameter found.\n"); + cli_classic_abort_usage(argv[0]); }
- if (optind < argc) - filename = argv[optind++]; - - if (optind < argc) { - printf("Error: Extra parameter found.\n"); - cli_classic_usage(argv[0]); +#if INTERNAL_SUPPORT == 1 + if ((programmer != PROGRAMMER_INTERNAL) && (lb_part || lb_vendor)) { + fprintf(stderr, "Error: --mainboard requires the internal " + "programmer. Aborting.\n"); + cli_classic_abort_usage(argv[0]); } +#endif
if (chip_to_probe) { for (flash = flashchips; flash && flash->name; flash++) @@ -322,12 +386,14 @@ flash = NULL; } + msg_pdbg("Initializing %s programmer\n", + programmer_table[programmer].name); if (programmer_init()) { fprintf(stderr, "Error: Programmer initialization failed.\n"); exit(1); }
- // FIXME: Delay calibration should happen in programmer code. + /* FIXME: Delay calibration should happen in programmer code. */ myusec_calibrate_delay();
for (i = 0; i < ARRAY_SIZE(flashes); i++) { @@ -383,7 +449,7 @@ printf("No operations were specified.\n"); // FIXME: flash writes stay enabled! programmer_shutdown(); - exit(1); + exit(0); }
if (!filename && !erase_it) { Index: flashrom-0.9.2-cleanup/flashrom.c =================================================================== --- flashrom-0.9.2-cleanup/flashrom.c (Revision 997) +++ flashrom-0.9.2-cleanup/flashrom.c (Arbeitskopie) @@ -1183,10 +1183,17 @@
void print_version(void) { - msg_ginfo("flashrom v%s\n", flashrom_version); + msg_ginfo("flashrom v%s", flashrom_version); print_sysinfo(); }
+void print_banner(void) +{ + msg_ginfo("flashrom is free software, get the source code at " + "http://www.flashrom.org%5Cn"); + msg_ginfo("\n"); +} + int selfcheck(void) { int ret = 0; @@ -1247,13 +1254,19 @@ msg_cinfo("\n"); } /* FIXME: This message is designed towards CLI users. */ - msg_cinfo("Please email a report to flashrom@flashrom.org if any " - "of the above operations\nwork correctly for you with " - "this flash part. Please include the flashrom\noutput " - "with the additional -V option for all operations you " - "tested (-V, -rV,\n-wV, -EV), and mention which " - "mainboard or programmer you tested.\nThanks for your " - "help!\n===\n"); + msg_cinfo("The test status of this chip may have been updated " + "in the latest development\n" + "version of flashrom. If you are running the latest " + "development version,\n" + "please email a report to flashrom@flashrom.org if " + "any of the above operations\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"); } }
Index: flashrom-0.9.2-cleanup/print_wiki.c =================================================================== --- flashrom-0.9.2-cleanup/print_wiki.c (Revision 997) +++ flashrom-0.9.2-cleanup/print_wiki.c (Arbeitskopie) @@ -25,6 +25,7 @@ #include "flash.h" #include "flashchips.h"
+#if INTERNAL_SUPPORT == 1 struct board_info_url { const char *vendor; const char *name; @@ -36,6 +37,7 @@ const char *name; const char *note; }; +#endif
const char *wiki_header = "= Supported devices =\n\n\ <div style="margin-top:0.5em; padding:0.5em 0.5em 0.5em 0.5em; \ @@ -44,6 +46,7 @@ generated by pasting '''flashrom -z''' output.<br />\ '''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\ |- bgcolor="#6699dd"\n! align="left" | Vendor\n\ ! align="left" | Southbridge\n! align="left" | PCI IDs\n\ @@ -69,6 +72,7 @@ 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 \ mainboards on the [[Mailinglist|mailing list]].\n"; +#endif
const char *chip_th = "{| border="0" style="font-size: smaller" \ valign="top"\n|- bgcolor="#6699dd"\n! align="left" | Vendor\n\ @@ -85,6 +89,7 @@ ! align="left" | Device\n! align="left" | PCI IDs\n\ ! align="left" | Status\n\n";
+#if INTERNAL_SUPPORT == 1 const char *laptop_intro = "\n== Supported laptops/notebooks ==\n\n\ In general, flashing laptops is more difficult because laptops\n\n\ * often use the flash chip for stuff besides the BIOS,\n\ @@ -505,6 +510,7 @@ wiki_helper("Known good (worked out of the box)", "OK", 1, laptops_ok); wiki_helper("Not supported (yet)", "No", 1, laptops_bad); } +#endif
void print_supported_chips_wiki(void) { @@ -576,9 +582,11 @@ time_t t = time(NULL);
printf(wiki_header, ctime(&t), flashrom_version); +#if INTERNAL_SUPPORT == 1 print_supported_chips_wiki(); print_supported_chipsets_wiki(); print_supported_boards_wiki(); +#endif printf("%s", programmer_section); #if NIC3COM_SUPPORT == 1 print_supported_pcidevs_wiki(nics_3com); Index: flashrom-0.9.2-cleanup/print.c =================================================================== --- flashrom-0.9.2-cleanup/print.c (Revision 997) +++ flashrom-0.9.2-cleanup/print.c (Arbeitskopie) @@ -247,6 +247,9 @@ #if SATASII_SUPPORT == 1 print_supported_pcidevs(satas_sii); #endif +#if ATAHPT_SUPPORT == 1 + print_supported_pcidevs(ata_hpt); +#endif }
Am Samstag, den 15.05.2010, 14:49 +0200 schrieb Carl-Daniel Hailfinger:
/* FIXME: --mainboard should be a programmer parameter */
Right.
Post 0.9.2, I'd say.
Yes, definitely.
" -n | --noverify don't auto-verify\n"
" -l | --layout <file> read ROM layout from "
"file\n"
Style: I would indent "file" up to "read ROM layout". Your choice.
It's only for making the code conform to 80 columns. The output is in one line. As such, I'd like to have the string in the code start at the beginning to make that painfully obvious.
Point taken. As discussed on IRC, indent by two characters to make even more clear that the previous line does not end in "\n".
+#if 0
- /* FIXME: This is broken. printf_debug is a no-op because verbose=0
* at this point.
if (argc > 1) { /* Yes, print them. */ printf_debug("The arguments are:\n"); for (i = 1; i < argc; ++i) printf_debug("%s\n", argv[i]); }*/
+#endif
Throw it out completely. Whoever just wants to see the parameters flashrom is called with should write a wrapper script.
I'd love to acticate that code permanently, but it does make sense to move the code down after option parsing, and reconstruct the arguments there.
Reconstructing arguments is possible, but describing what flashrom is going to do seems more useful (also discussed on IRC). If problems are reported about command line parsing, they should also include the command line already.
exit(1);
cli_classic_abort_usage(argv[0]);
Don't dump the usage on syntax errors. It clutters output too much so that you don't find the error message. Just print a one-liner like 'run "flashrom --help" for usage info'. I especially liked the debian tool that outputs "You need --help.", but don't recommend this very phrase to flashrom.
I've changed cli_classic_abort_usage accordingly.
Fine.
if (programmer == PROGRAMMER_INVALID) { printf("Error: Unknown programmer %s.\n", optarg);
exit(1);
cli_classic_abort_usage(argv[0]); }
In this case, list the supported programmers (and just them).
Hm. My current version tells the user to run "flashrom --help" and that will print a list of supported programmers. Is that OK for you?
Fine for now. But I still like the programmer list directly here better.
msg_cinfo("VERIFIED. \n");
msg_cinfo("VERIFIED.\n");
The spaces probably were to clear address counter characters. Did you verify that it is not needed with current chip drivers?
Ouch, right! Thanks for spotting this. (One of the reasons I dislike the current progress printing stuff.)
Yeah, that part of flashrom is bit hacky.
Thanks for the review, could you please check if the new patch is OK? I added an error if --mainboard is specified for a non-internal programmer, fixed wiki printing compilation and adjusted some messages.
- printf("Please note that the command line interface for flashrom has "
"changed between\n"
"0.9.1 and 0.9.2 and will change again before flashrom 1.0.\n"
"Do not use flashrom in scripts or other automated tools "
"without checking\n"
"that your flashrom version won't interpret options in a "
"different way.\n\n");
You are right. Indentation style (two characters indented for continuation lines) makes senses here, too.
/* FIXME: This message is designed towards CLI users. */
msg_cinfo("Please email a report to flashrom@flashrom.org if any "
"of the above operations\nwork correctly for you with "
"this flash part. Please include the flashrom\noutput "
"with the additional -V option for all operations you "
"tested (-V, -rV,\n-wV, -EV), and mention which "
"mainboard or programmer you tested.\nThanks for your "
"help!\n===\n");
msg_cinfo("The test status of this chip may have been updated "
"in the latest development\n"
"version of flashrom. If you are running the latest "
"development version,\n"
"please email a report to flashrom@flashrom.org if "
"any of the above operations\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");
And here.
Whether you change the indentation or not: Acked-by: Michael Karcher flashrom@mkarcher.dialup.fu-berlin.de
Regards, Michael Karcher
On 15.05.2010 15:37, Michael Karcher wrote:
Am Samstag, den 15.05.2010, 14:49 +0200 schrieb Carl-Daniel Hailfinger:
if (programmer == PROGRAMMER_INVALID) { printf("Error: Unknown programmer %s.\n", optarg);
exit(1);
}cli_classic_abort_usage(argv[0]);
In this case, list the supported programmers (and just them).
Hm. My current version tells the user to run "flashrom --help" and that will print a list of supported programmers. Is that OK for you?
Fine for now. But I still like the programmer list directly here better. [...]
Indentation style (two characters indented for continuation lines) makes senses here, too.
We will probably revisit the indentation issue in the future.
Acked-by: Michael Karcher flashrom@mkarcher.dialup.fu-berlin.de
Thanks!
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.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net Acked-by: Michael Karcher flashrom@mkarcher.dialup.fu-berlin.de
Index: flashrom-0.9.2-cleanup/flashrom.8 =================================================================== --- flashrom-0.9.2-cleanup/flashrom.8 (Revision 997) +++ flashrom-0.9.2-cleanup/flashrom.8 (Arbeitskopie) @@ -1,9 +1,13 @@ -.TH FLASHROM 8 "May 21, 2009" +.TH FLASHROM 8 "Apr 29, 2010" .SH NAME flashrom - detect, read, write, verify and erase flash chips .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] - [\fB-m\fR [vendor:]part] [\fB-l\fR file] [\fB-i\fR image] [\fB-p\fR programmer] +.B flashrom \fR[\fB-n\fR] [\fB-V\fR] [\fB-f\fR] [\fB-h\fR|\fB-R\fR|\ +\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 .B flashrom is a utility for detecting, reading, writing, verifying and erasing flash @@ -20,9 +24,8 @@ 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. .PP -You can specify one of -E, -r, -w, -v or no operation. -If no operation is specified, then all that happens -is that flash info is dumped and the flash chip is set to writable. It is +You can specify one of -h, -R, -L, -z, -E, -r, -w, -v or no operation. +If no operation is specified, flashrom will only probe for flash chips. It is 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 backup of your current ROM contents with -r before you try to write a new @@ -33,19 +36,19 @@ .BR <file> . .TP .B "-w, --write <file>" -Write file into flash ROM. +Write +.B <file> +into flash ROM. .TP .B "-n, --noverify" -Do -.B not -verify the flash ROM contents after writing them to the chip. Using this +Skip the automatic verification of flash ROM contents after writing. Using this option is .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. .sp Typical usage is: -.B "flashrom -wn file" +.B "flashrom -n -w file" .sp This option is only useful in combination with .BR --write . @@ -66,14 +69,14 @@ .B "flashrom -L" without the vendor name. Please note that the chip name is case sensitive. .TP -.B "-m, --mainboard" <[vendor:]part> +.B "-m, --mainboard" [<vendor>:]<part> Override mainboard settings. .sp 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 specify -m, e.g.: .sp -.B " flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom" +.B " flashrom --mainboard AGAMI:ARUMA -w agami_aruma.rom" .sp 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 @@ -108,19 +111,15 @@ 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: .sp -.B " flashrom -w --layout rom.layout --image normal agami_aruma.rom" +.B " flashrom --layout rom.layout --image normal -w agami_aruma.rom" .sp To update normal and fallback but leave the VGA BIOS alone, say: .sp -.B " flashrom -w -l rom.layout -i normal " +.B " flashrom -l rom.layout -i normal " .br -.B " -i fallback agami_aruma.rom" +.B " -i fallback -w agami_aruma.rom" .sp 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 .B "-i, --image <name>" Only flash image @@ -141,7 +140,8 @@ Same as .BR --list-supported , 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 .B "-p, --programmer <name>[:parameter[,parameter[,parameter]]]" Specify the programmer device. Currently supported are: @@ -237,6 +237,7 @@ .sp 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 +.sp .B "flashrom -p internal:it87spiport=portnum" syntax as explained in the .B it87spi @@ -382,6 +383,8 @@ .br Markus Boas ryven@ryven.de .br +Michael Karcher flashrom@mkarcher.dialup.fu-berlin.de +.br Nikolay Petukhov nikolay.petukhov@gmail.com .br Peter Stuge peter@stuge.se @@ -392,6 +395,8 @@ .br Ronald Hoogenboom ronald@zonnet.nl .br +Sean Nelson audiohacked@gmail.com +.br Stefan Reinauer stepan@coresystems.de .br Stefan Wildemann stefan.wildemann@kontron.com @@ -406,5 +411,6 @@ .br some others .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). Index: flashrom-0.9.2-cleanup/flash.h =================================================================== --- flashrom-0.9.2-cleanup/flash.h (Revision 997) +++ flashrom-0.9.2-cleanup/flash.h (Arbeitskopie) @@ -548,6 +548,7 @@ int need_erase(uint8_t *have, uint8_t *want, int len, enum write_granularity gran); char *strcat_realloc(char *dest, const char *src); void print_version(void); +void print_banner(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);
Index: flashrom-0.9.2-cleanup/Makefile =================================================================== --- flashrom-0.9.2-cleanup/Makefile (Revision 997) +++ flashrom-0.9.2-cleanup/Makefile (Arbeitskopie) @@ -71,7 +71,7 @@ # of the checked out flashrom files. # Note to packagers: Any tree exported with "make export" or "make tarball" # 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 VERSION := $(RELEASE)-r$(SVNVERSION) Index: flashrom-0.9.2-cleanup/cli_classic.c =================================================================== --- flashrom-0.9.2-cleanup/cli_classic.c (Revision 997) +++ flashrom-0.9.2-cleanup/cli_classic.c (Arbeitskopie) @@ -37,33 +37,53 @@ int remaining = 0; enum programmer p;
- printf("Usage: %s [-VfLzhR] [-E|-r file|-w file|-v file] [-c chipname]\n" - " [-m [vendor:]part] [-l file] [-i image] [-p programmer]\n\n", name); + printf("Usage: %s [-n] [-V] [-f] [-h|-R|-L|" +#if PRINT_WIKI_SUPPORT == 1 + "-z|" +#endif + "-E|-r <file>|-w <file>|-v <file>]\n" + " [-c <chipname>] [-m [<vendor>:]<part>] [-l <file>]\n" + " [-i <image>] [-p <programmername>[:<parameters>]]\n", + name);
- printf("Please note that the command line interface for flashrom will " - "change before\nflashrom 1.0. Do not use flashrom in scripts " - "or other automated tools without\nchecking that your flashrom" - " version won't interpret options in a different way.\n\n"); + printf("Please note that the command line interface for flashrom has " + "changed between\n" + "0.9.1 and 0.9.2 and will change again before flashrom 1.0.\n" + "Do not use flashrom in scripts or other automated tools " + "without checking\n" + "that your flashrom version won't interpret options in a " + "different way.\n\n");
- printf - (" -r | --read: read flash and save into file\n" - " -w | --write: write file into flash\n" - " -v | --verify: verify flash against file\n" - " -n | --noverify: don't 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" + 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 - " -m | --mainboard <[vendor:]part>: override mainboard settings\n" + /* FIXME: --mainboard should be a programmer parameter */ + " -m | --mainboard <[vendor:]part> override mainboard " + "detection\n" #endif - " -f | --force: force write without checking image\n" - " -l | --layout <file.layout>: read ROM layout from file\n" - " -i | --image <name>: only flash image name from flash layout\n" - " -L | --list-supported: print supported devices\n" + " -f | --force force specific operations " + "(see man page)\n" + " -n | --noverify don't auto-verify\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 - " -z | --list-supported-wiki: print supported devices in wiki syntax\n" + " -z | --list-supported-wiki print supported devices " + "in wiki syntax\n" #endif - " -p | --programmer <name>: specify the programmer device"); + " -p | --programmer <name>[:<param>] specify the programmer " + "device");
for (p = 0; p < PROGRAMMER_INVALID; p++) { pname = programmer_table[p].name; @@ -88,12 +108,19 @@ printf(")\n"); } } - - printf( - " -h | --help: print this help text\n" - " -R | --version: print the version (release)\n" - "\nYou can specify one of -E, -r, -w, -v or no operation. If no operation is\n" - "specified, then all that happens is that flash info is dumped.\n\n"); + + printf("\nYou can specify one of -h, -R, -L, " +#if PRINT_WIKI_SUPPORT == 1 + "-z, " +#endif + "-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); }
@@ -115,16 +142,12 @@ int operation_specified = 0; int i;
-#if PRINT_WIKI_SUPPORT == 1 - const char *optstring = "rRwvnVEfc:m:l:i:p:Lzh"; -#else - const char *optstring = "rRwvnVEfc:m:l:i:p:Lh"; -#endif + const char *optstring = "r:Rw:v:nVEfc:m:l:i:p:Lzh"; static struct option long_options[] = { - {"read", 0, 0, 'r'}, - {"write", 0, 0, 'w'}, + {"read", 1, 0, 'r'}, + {"write", 1, 0, 'w'}, {"erase", 0, 0, 'E'}, - {"verify", 0, 0, 'v'}, + {"verify", 1, 0, 'v'}, {"noverify", 0, 0, 'n'}, {"chip", 1, 0, 'c'}, {"mainboard", 1, 0, 'm'}, @@ -133,9 +156,7 @@ {"layout", 1, 0, 'l'}, {"image", 1, 0, 'i'}, {"list-supported", 0, 0, 'L'}, -#if PRINT_WIKI_SUPPORT == 1 {"list-supported-wiki", 0, 0, 'z'}, -#endif {"programmer", 1, 0, 'p'}, {"help", 0, 0, 'h'}, {"version", 0, 0, 'R'}, @@ -147,18 +168,15 @@ char *tempstr = NULL;
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()) exit(1);
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, long_options, &option_index)) != EOF) { switch (opt) { @@ -166,16 +184,18 @@ if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } + filename = strdup(optarg); read_it = 1; break; case 'w': if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } + filename = strdup(optarg); write_it = 1; break; case 'v': @@ -183,20 +203,21 @@ if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } if (dont_verify_it) { fprintf(stderr, "--verify and --noverify are" "mutually exclusive. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } + filename = strdup(optarg); verify_it = 1; break; case 'n': if (verify_it) { fprintf(stderr, "--verify and --noverify are" "mutually exclusive. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } dont_verify_it = 1; break; @@ -210,36 +231,55 @@ if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); - exit(1); + cli_classic_abort_usage(argv[0]); } erase_it = 1; break; + case 'm': #if INTERNAL_SUPPORT == 1 - case 'm': tempstr = strdup(optarg); lb_vendor_dev_from_string(tempstr); +#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 break; -#endif case 'f': force = 1; break; case 'l': tempstr = strdup(optarg); if (read_romlayout(tempstr)) - exit(1); + cli_classic_abort_usage(argv[0]); break; case 'i': tempstr = strdup(optarg); find_romentry(tempstr); break; case 'L': + if (++operation_specified > 1) { + fprintf(stderr, "More than one operation " + "specified. Aborting.\n"); + cli_classic_abort_usage(argv[0]); + } list_supported = 1; break; + case 'z': #if PRINT_WIKI_SUPPORT == 1 - case 'z': + if (++operation_specified > 1) { + fprintf(stderr, "More than one operation " + "specified. Aborting.\n"); + cli_classic_abort_usage(argv[0]); + } list_supported_wiki = 1; +#else + fprintf(stderr, "Error: Wiki output was not compiled " + "in. Aborting.\n"); + cli_classic_abort_usage(argv[0]); +#endif break; -#endif case 'p': for (programmer = 0; programmer < PROGRAMMER_INVALID; programmer++) { name = programmer_table[programmer].name; @@ -267,21 +307,37 @@ } } if (programmer == PROGRAMMER_INVALID) { - printf("Error: Unknown programmer %s.\n", optarg); - exit(1); + fprintf(stderr, "Error: Unknown programmer " + "%s.\n", optarg); + cli_classic_abort_usage(argv[0]); } break; case 'R': /* 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); break; 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]); + exit(0); break; + default: + cli_classic_abort_usage(argv[0]); + break; } }
+ /* FIXME: Print the actions flashrom will take. */ + if (list_supported) { print_supported(); exit(0); @@ -294,18 +350,18 @@ } #endif
- if (read_it && write_it) { - printf("Error: -r and -w are mutually exclusive.\n"); - cli_classic_usage(argv[0]); + if (optind < argc) { + fprintf(stderr, "Error: Extra parameter found.\n"); + cli_classic_abort_usage(argv[0]); }
- if (optind < argc) - filename = argv[optind++]; - - if (optind < argc) { - printf("Error: Extra parameter found.\n"); - cli_classic_usage(argv[0]); +#if INTERNAL_SUPPORT == 1 + if ((programmer != PROGRAMMER_INTERNAL) && (lb_part || lb_vendor)) { + fprintf(stderr, "Error: --mainboard requires the internal " + "programmer. Aborting.\n"); + cli_classic_abort_usage(argv[0]); } +#endif
if (chip_to_probe) { for (flash = flashchips; flash && flash->name; flash++) @@ -321,13 +377,15 @@ /* Clean up after the check. */ flash = NULL; } - + + msg_pdbg("Initializing %s programmer\n", + programmer_table[programmer].name); if (programmer_init()) { fprintf(stderr, "Error: Programmer initialization failed.\n"); exit(1); }
- // FIXME: Delay calibration should happen in programmer code. + /* FIXME: Delay calibration should happen in programmer code. */ myusec_calibrate_delay();
for (i = 0; i < ARRAY_SIZE(flashes); i++) { @@ -383,7 +441,7 @@ printf("No operations were specified.\n"); // FIXME: flash writes stay enabled! programmer_shutdown(); - exit(1); + exit(0); }
if (!filename && !erase_it) { Index: flashrom-0.9.2-cleanup/flashrom.c =================================================================== --- flashrom-0.9.2-cleanup/flashrom.c (Revision 997) +++ flashrom-0.9.2-cleanup/flashrom.c (Arbeitskopie) @@ -1130,8 +1130,9 @@ { msg_gerr("Your flash chip is in an unknown state.\n" "Get help on IRC at irc.freenode.net (channel #flashrom) or\n" - "mail flashrom@flashrom.org!\n--------------------" - "-----------------------------------------------------------\n" + "mail flashrom@flashrom.org!\n" + "-------------------------------------------------------------" + "------------------\n" "DO NOT REBOOT OR POWEROFF!\n"); }
@@ -1183,10 +1184,17 @@
void print_version(void) { - msg_ginfo("flashrom v%s\n", flashrom_version); + msg_ginfo("flashrom v%s", flashrom_version); print_sysinfo(); }
+void print_banner(void) +{ + msg_ginfo("flashrom is free software, get the source code at " + "http://www.flashrom.org%5Cn"); + msg_ginfo("\n"); +} + int selfcheck(void) { int ret = 0; @@ -1247,13 +1255,20 @@ msg_cinfo("\n"); } /* FIXME: This message is designed towards CLI users. */ - msg_cinfo("Please email a report to flashrom@flashrom.org if any " - "of the above operations\nwork correctly for you with " - "this flash part. Please include the flashrom\noutput " - "with the additional -V option for all operations you " - "tested (-V, -rV,\n-wV, -EV), and mention which " - "mainboard or programmer you tested.\nThanks for your " - "help!\n===\n"); + msg_cinfo("The test status of this chip may have been updated " + "in the latest development\n" + "version of flashrom. If you are running the latest " + "development version,\n" + "please email a report to flashrom@flashrom.org if " + "any of the above operations\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"); } }
Index: flashrom-0.9.2-cleanup/print_wiki.c =================================================================== --- flashrom-0.9.2-cleanup/print_wiki.c (Revision 997) +++ flashrom-0.9.2-cleanup/print_wiki.c (Arbeitskopie) @@ -25,6 +25,7 @@ #include "flash.h" #include "flashchips.h"
+#if INTERNAL_SUPPORT == 1 struct board_info_url { const char *vendor; const char *name; @@ -36,6 +37,7 @@ const char *name; const char *note; }; +#endif
const char *wiki_header = "= Supported devices =\n\n\ <div style="margin-top:0.5em; padding:0.5em 0.5em 0.5em 0.5em; \ @@ -44,6 +46,7 @@ generated by pasting '''flashrom -z''' output.<br />\ '''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\ |- bgcolor="#6699dd"\n! align="left" | Vendor\n\ ! align="left" | Southbridge\n! align="left" | PCI IDs\n\ @@ -69,6 +72,7 @@ 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 \ mainboards on the [[Mailinglist|mailing list]].\n"; +#endif
const char *chip_th = "{| border="0" style="font-size: smaller" \ valign="top"\n|- bgcolor="#6699dd"\n! align="left" | Vendor\n\ @@ -85,6 +89,7 @@ ! align="left" | Device\n! align="left" | PCI IDs\n\ ! align="left" | Status\n\n";
+#if INTERNAL_SUPPORT == 1 const char *laptop_intro = "\n== Supported laptops/notebooks ==\n\n\ In general, flashing laptops is more difficult because laptops\n\n\ * often use the flash chip for stuff besides the BIOS,\n\ @@ -505,6 +510,7 @@ wiki_helper("Known good (worked out of the box)", "OK", 1, laptops_ok); wiki_helper("Not supported (yet)", "No", 1, laptops_bad); } +#endif
void print_supported_chips_wiki(void) { @@ -576,9 +582,11 @@ time_t t = time(NULL);
printf(wiki_header, ctime(&t), flashrom_version); +#if INTERNAL_SUPPORT == 1 print_supported_chips_wiki(); print_supported_chipsets_wiki(); print_supported_boards_wiki(); +#endif printf("%s", programmer_section); #if NIC3COM_SUPPORT == 1 print_supported_pcidevs_wiki(nics_3com); Index: flashrom-0.9.2-cleanup/print.c =================================================================== --- flashrom-0.9.2-cleanup/print.c (Revision 997) +++ flashrom-0.9.2-cleanup/print.c (Arbeitskopie) @@ -247,6 +247,9 @@ #if SATASII_SUPPORT == 1 print_supported_pcidevs(satas_sii); #endif +#if ATAHPT_SUPPORT == 1 + print_supported_pcidevs(ata_hpt); +#endif }
On 15.05.2010 17:03, Carl-Daniel Hailfinger wrote:
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.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net Acked-by: Michael Karcher flashrom@mkarcher.dialup.fu-berlin.de
Committed in r998. Thanks for the reviews.
Regards, Carl-Daniel