summaryrefslogtreecommitdiff
path: root/util/flashrom/flashrom.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2008-03-12 11:54:51 +0000
committerUwe Hermann <uwe@hermann-uwe.de>2008-03-12 11:54:51 +0000
commit098913dadfcb9e5205112ee05ec3042bbd4cb277 (patch)
tree22040c256a0bca0783c6d106b3793d84ac3652cb /util/flashrom/flashrom.c
parent2aa14367774bc19ab4df4ff527e15d5e73258ddd (diff)
downloadcoreboot-098913dadfcb9e5205112ee05ec3042bbd4cb277.tar.xz
Add --list-supported option to flashrom which lists the supported
ROM chips, chipsets, and mainboards (Closes #90). Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Ward Vandewege <ward@gnu.org> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3133 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/flashrom/flashrom.c')
-rw-r--r--util/flashrom/flashrom.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/util/flashrom/flashrom.c b/util/flashrom/flashrom.c
index 59196bc145..a176319da8 100644
--- a/util/flashrom/flashrom.c
+++ b/util/flashrom/flashrom.c
@@ -193,9 +193,19 @@ int verify_flash(struct flashchip *flash, uint8_t *buf)
return 0;
}
+void print_supported_chips(void)
+{
+ int i;
+
+ printf("Supported ROM chips:\n\n");
+
+ for (i = 0; flashchips[i].name != NULL; i++)
+ printf("%s\n", flashchips[i].name);
+}
+
void usage(const char *name)
{
- printf("usage: %s [-rwvEVfhR] [-c chipname] [-s exclude_start]\n", name);
+ printf("usage: %s [-rwvEVfLhR] [-c chipname] [-s exclude_start]\n", name);
printf(" [-e exclude_end] [-m [vendor:]part] [-l file.layout] [-i imagename] [file]\n");
printf
(" -r | --read: read flash and save into file\n"
@@ -210,8 +220,10 @@ void usage(const char *name)
" -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"
+ " -h | --help: print this help text\n"
" -R | --version: print the version (release)\n"
- "\n" " If no file is specified, then all that happens"
+ "\n" " If no file is specified, then all that happens"
" is that flash info is dumped.\n\n");
exit(1);
}
@@ -245,6 +257,7 @@ int main(int argc, char *argv[])
{"force", 0, 0, 'f'},
{"layout", 1, 0, 'l'},
{"image", 1, 0, 'i'},
+ {"list-supported", 0, 0, 'L'},
{"help", 0, 0, 'h'},
{"version", 0, 0, 'R'},
{0, 0, 0, 0}
@@ -264,7 +277,7 @@ int main(int argc, char *argv[])
}
setbuf(stdout, NULL);
- while ((opt = getopt_long(argc, argv, "rRwvVEfc:s:e:m:l:i:h",
+ while ((opt = getopt_long(argc, argv, "rRwvVEfc:s:e:m:l:i:Lh",
long_options, &option_index)) != EOF) {
switch (opt) {
case 'r':
@@ -317,6 +330,12 @@ int main(int argc, char *argv[])
tempstr = strdup(optarg);
find_romentry(tempstr);
break;
+ case 'L':
+ print_supported_chips();
+ print_supported_chipsets();
+ print_supported_boards();
+ exit(0);
+ break;
case 'R':
print_version();
exit(0);