Commit e8ba538d authored by Uwe Hermann's avatar Uwe Hermann Committed by Patrick Georgi
Browse files

A bunch of output beautifications and improvements, as well as doc fixes


 - Update manpage, we now report supported boards via -L.
 
 - Add some missing escaping for '-' characters in the manpage.

Corresponding to flashrom svn r543.

 - Shorten some of the really long device names, so that -L output looks
   nicer.
   
 - Display a "table header" for all entries/columns in -L output.
 
 - Make -L output tabular for all lists for better readability.
 
 - Do not print "unknown XXXX SPI chip" entries in -L output.
 
 - And random other cosmetics...
Signed-off-by: default avatarUwe Hermann <uwe@hermann-uwe.de>
Acked-by: default avatarUwe Hermann <uwe@hermann-uwe.de>
Acked-by: default avatarPatrick Georgi <patrick.georgi@coresystems.de>
parent 690bcbaf
...@@ -822,7 +822,9 @@ void print_supported_boards(void) ...@@ -822,7 +822,9 @@ void print_supported_boards(void)
int i, j; int i, j;
struct board_pciid_enable *b = board_pciid_enables; struct board_pciid_enable *b = board_pciid_enables;
printf("\nSupported boards which need write-enable code:\n\n"); printf("\nSupported boards which need write-enable code:\n\nVendor: "
" Board: Required option:\n\n");
for (i = 0; b[i].vendor_name != NULL; i++) { for (i = 0; b[i].vendor_name != NULL; i++) {
printf("%s", b[i].vendor_name); printf("%s", b[i].vendor_name);
for (j = 0; j < 25 - strlen(b[i].vendor_name); j++) for (j = 0; j < 25 - strlen(b[i].vendor_name); j++)
...@@ -831,9 +833,9 @@ void print_supported_boards(void) ...@@ -831,9 +833,9 @@ void print_supported_boards(void)
for (j = 0; j < 25 - strlen(b[i].board_name); j++) for (j = 0; j < 25 - strlen(b[i].board_name); j++)
printf(" "); printf(" ");
if (b[i].lb_vendor != NULL) if (b[i].lb_vendor != NULL)
printf("(-m %s:%s)\n", b[i].lb_vendor, b[i].lb_part); printf("-m %s:%s\n", b[i].lb_vendor, b[i].lb_part);
else else
printf("(autodetected)\n"); printf("(none, board is autodetected)\n");
} }
printf("\nSupported boards which don't need write-enable code:\n\n"); printf("\nSupported boards which don't need write-enable code:\n\n");
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#define _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/mman.h> #include <sys/mman.h>
...@@ -1011,16 +1012,21 @@ const struct penable chipset_enables[] = { ...@@ -1011,16 +1012,21 @@ const struct penable chipset_enables[] = {
void print_supported_chipsets(void) void print_supported_chipsets(void)
{ {
int i; int i, j;
const struct penable *c = chipset_enables;
printf("\nSupported chipsets:\n\n");
printf("\nSupported chipsets:\n\nVendor: Chipset:"
for (i = 0; chipset_enables[i].vendor_name != NULL; i++) { " PCI IDs:\n\n");
printf("%s %s [%04x:%04x]%s\n", chipset_enables[i].vendor_name,
chipset_enables[i].device_name, for (i = 0; c[i].vendor_name != NULL; i++) {
chipset_enables[i].vendor_id, printf("%s", c[i].vendor_name);
chipset_enables[i].device_id, for (j = 0; j < 25 - strlen(c[i].vendor_name); j++)
(chipset_enables[i].status == OK) ? "" : " (untested)"); printf(" ");
printf("%s", c[i].device_name);
for (j = 0; j < 25 - strlen(c[i].device_name); j++)
printf(" ");
printf("%04x:%04x%s\n", c[i].vendor_id, c[i].device_id,
(c[i].status == OK) ? "" : " (untested)");
} }
} }
......
.TH FLASHROM 8 "May 14, 2009" .TH FLASHROM 8 "May 21, 2009"
.SH NAME .SH NAME
flashrom \- detect, read, write, verify and erase flash chips flashrom \- detect, read, write, verify and erase flash chips
.SH SYNOPSIS .SH SYNOPSIS
...@@ -7,7 +7,7 @@ flashrom \- detect, read, write, verify and erase flash chips ...@@ -7,7 +7,7 @@ flashrom \- detect, read, write, verify and erase flash chips
[\fB\-l\fR file] [\fB\-i\fR image] [\fB\-p\fR programmer] [file] [\fB\-l\fR file] [\fB\-i\fR image] [\fB\-p\fR programmer] [file]
.SH DESCRIPTION .SH DESCRIPTION
.B flashrom .B flashrom
is a utility for detecting, reading, writing, verifying and erasing flash ROM is a utility for detecting, reading, writing, verifying and erasing flash
chips. It's often used to flash BIOS/EFI/coreboot/firmware images in-system chips. It's often used to flash BIOS/EFI/coreboot/firmware images in-system
using a supported mainboard, but it also supports flashing of network cards using a supported mainboard, but it also supports flashing of network cards
(NICs), SATA controller cards, and other external devices which can program (NICs), SATA controller cards, and other external devices which can program
...@@ -23,8 +23,7 @@ for details on coreboot) ...@@ -23,8 +23,7 @@ for details on coreboot)
.SH OPTIONS .SH OPTIONS
Please note that the command line interface for flashrom will change before Please note that the command line interface for flashrom will change before
flashrom 1.0. Do not use flashrom in scripts or other automated tools without flashrom 1.0. Do not use flashrom in scripts or other automated tools without
checking that your flashrom version won't interpret them in a totally different checking that your flashrom version won't interpret options in a different way.
way.
.PP .PP
If no file is specified, then all that happens If no file is specified, then all that happens
is that flash info is dumped and the flash chip is set to writable. is that flash info is dumped and the flash chip is set to writable.
...@@ -77,7 +76,7 @@ To update normal and fallback but leave the VGA BIOS alone, say: ...@@ -77,7 +76,7 @@ To update normal and fallback but leave the VGA BIOS alone, say:
.sp .sp
Currently overlapping sections are not supported. Currently overlapping sections are not supported.
.sp .sp
ROM layouts should replace the -s and -e option since they are more 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 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?). ROM layout and the ROM image in one file (cpio, zip or something?).
.TP .TP
...@@ -89,11 +88,11 @@ Override mainboard settings. ...@@ -89,11 +88,11 @@ Override mainboard settings.
.sp .sp
flashrom reads the coreboot table to determine the current mainboard. If no flashrom reads the coreboot table to determine the current mainboard. If no
coreboot table could be read or if you want to override these values, you can coreboot table could be read or if you want to override these values, you can
specify -m, e.g.: specify \-m, e.g.:
.sp .sp
.B " flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom" .B " flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom"
.sp .sp
See the 'Supported mainboards' section in the output of 'flashrom -L' for See the 'Supported mainboards' section in the output of 'flashrom \-L' for
a list of boards which require the specification of the board name, if no a list of boards which require the specification of the board name, if no
coreboot table is found. coreboot table is found.
.TP .TP
...@@ -114,18 +113,14 @@ Only flash image ...@@ -114,18 +113,14 @@ Only flash image
from flash layout. from flash layout.
.TP .TP
.B "\-L, \-\-list\-supported" .B "\-L, \-\-list\-supported"
List the ROM chips, chipsets, and mainboards supported by flashrom. List the flash chips, chipsets, mainboards, and PCI card "programmers"
The list of mainboards consists of those boards which need a special supported by flashrom.
ROM write-enable function for flashrom to work. .sp
.sp There are many unlisted boards which will work out of the box, without
There are many other boards which will work out of the box, without such special support in flashrom. Please let us know if you can verify that
special support in flashrom. Some of the known-good/known-bad and tested ones other boards work or do not work out of the box. For verification you have
are listed at to test an ERASE and/or WRITE operation, so make sure you only do that
.BR http://coreboot.org/Flashrom#Supported_mainboards , if you have proper means to recover from failure!
but the list is not exhaustive, of course.
.sp
Please let us know if you can verify other boards to work or not work out
of the box.
.TP .TP
.B "\-p, \-\-programmer <name>" .B "\-p, \-\-programmer <name>"
Specify the programmer device. Currently supported are: Specify the programmer device. Currently supported are:
......
...@@ -313,7 +313,7 @@ int erase_flash(struct flashchip *flash) ...@@ -313,7 +313,7 @@ int erase_flash(struct flashchip *flash)
void print_supported_chips(void) void print_supported_chips(void)
{ {
int okcol = 0, pos = 0; int okcol = 0, pos = 0, i;
struct flashchip *f; struct flashchip *f;
for (f = flashchips; f->name != NULL; f++) { for (f = flashchips; f->name != NULL; f++) {
...@@ -323,7 +323,8 @@ void print_supported_chips(void) ...@@ -323,7 +323,8 @@ void print_supported_chips(void)
} }
okcol = (okcol + 7) & ~7; okcol = (okcol + 7) & ~7;
POS_PRINT("Supported flash chips:"); printf("Supported flash chips:\n\n");
POS_PRINT("Vendor: Device:");
while (pos < okcol) { while (pos < okcol) {
printf("\t"); printf("\t");
pos += 8 - (pos % 8); pos += 8 - (pos % 8);
...@@ -331,8 +332,16 @@ void print_supported_chips(void) ...@@ -331,8 +332,16 @@ void print_supported_chips(void)
printf("Tested OK operations:\tKnown BAD operations:\n\n"); printf("Tested OK operations:\tKnown BAD operations:\n\n");
for (f = flashchips; f->name != NULL; f++) { for (f = flashchips; f->name != NULL; f++) {
printf("%s %s", f->vendor, f->name); /* Don't print "unknown XXXX SPI chip" entries. */
pos = strlen(f->vendor) + 1 + strlen(f->name); if (!strncmp(f->name, "unknown", 7))
continue;
printf("%s", f->vendor);
for (i = 0; i < 10 - strlen(f->vendor); i++)
printf(" ");
printf("%s", f->name);
pos = 10 + strlen(f->name);
while (pos < okcol) { while (pos < okcol) {
printf("\t"); printf("\t");
pos += 8 - (pos % 8); pos += 8 - (pos % 8);
...@@ -368,13 +377,13 @@ void print_supported_chips(void) ...@@ -368,13 +377,13 @@ void print_supported_chips(void)
void usage(const char *name) void usage(const char *name)
{ {
printf("usage: %s [-EVfLhR] [-r file] [-w file] [-v file] [-c chipname] [-s addr]\n" printf("usage: %s [-EVfLhR] [-r file] [-w file] [-v file] [-c chipname] [-s addr]\n"
" [-e addr] [-m [vendor:]part] [-l file] [-i image] [-p programmer] [file]", " [-e addr] [-m [vendor:]part] [-l file] [-i image] [-p programmer] [file]\n\n",
name); name);
printf("\n\nPlease note that the command line interface for flashrom will " printf("Please note that the command line interface for flashrom will "
"change before flashrom 1.0.\nDo not use flashrom in scripts or " "change before\nflashrom 1.0. Do not use flashrom in scripts "
"other automated tools without checking that your flashrom\n" "or other automated tools without\nchecking that your flashrom"
"version won't interpret them in a totally different way.\n\n"); " version won't interpret options in a different way.\n\n");
printf printf
(" -r | --read: read flash and save into file\n" (" -r | --read: read flash and save into file\n"
...@@ -387,7 +396,7 @@ void usage(const char *name) ...@@ -387,7 +396,7 @@ void usage(const char *name)
" -e | --eend <addr>: exclude end postion\n" " -e | --eend <addr>: exclude end postion\n"
" -m | --mainboard <[vendor:]part>: override mainboard settings\n" " -m | --mainboard <[vendor:]part>: override mainboard settings\n"
" -f | --force: force write without checking image\n" " -f | --force: force write without checking image\n"
" -l | --layout <file.layout>: read rom layout from file\n" " -l | --layout <file.layout>: read ROM layout from file\n"
" -i | --image <name>: only flash image name from flash layout\n" " -i | --image <name>: only flash image name from flash layout\n"
" -L | --list-supported: print supported devices\n" " -L | --list-supported: print supported devices\n"
" -p | --programmer <name>: specify the programmer device\n" " -p | --programmer <name>: specify the programmer device\n"
......
...@@ -34,11 +34,11 @@ uint8_t *sii_bar; ...@@ -34,11 +34,11 @@ uint8_t *sii_bar;
uint16_t id; uint16_t id;
struct pcidev_status satas_sii[] = { struct pcidev_status satas_sii[] = {
{0x1095, 0x0680, PCI_OK, "Silicon Image", "PCI0680 Ultra ATA-133 Host Controller"}, {0x1095, 0x0680, PCI_OK, "Silicon Image", "PCI0680 Ultra ATA-133 Host Ctrl"},
{0x1095, 0x3114, PCI_OK, "Silicon Image", "SiI 3114 [SATALink/SATARaid] Serial ATA Controller"}, {0x1095, 0x3114, PCI_OK, "Silicon Image", "SiI 3114 [SATALink/SATARaid] SATA Ctrl"},
{0x1095, 0x3124, PCI_NT, "Silicon Image", "SiI 3124 PCI-X Serial ATA Controller"}, {0x1095, 0x3124, PCI_NT, "Silicon Image", "SiI 3124 PCI-X SATA Ctrl"},
{0x1095, 0x3132, PCI_OK, "Silicon Image", "SiI 3132 Serial ATA Raid II Controller"}, {0x1095, 0x3132, PCI_OK, "Silicon Image", "SiI 3132 SATA Raid II Ctrl"},
{0x1095, 0x3512, PCI_NT, "Silicon Image", "SiI 3512 [SATALink/SATARaid] Serial ATA Controller"}, {0x1095, 0x3512, PCI_NT, "Silicon Image", "SiI 3512 [SATALink/SATARaid] SATA Ctrl"},
{}, {},
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment