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)
int i, j;
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++) {
printf("%s", b[i].vendor_name);
for (j = 0; j < 25 - strlen(b[i].vendor_name); j++)
......@@ -831,9 +833,9 @@ void print_supported_boards(void)
for (j = 0; j < 25 - strlen(b[i].board_name); j++)
printf(" ");
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
printf("(autodetected)\n");
printf("(none, board is autodetected)\n");
}
printf("\nSupported boards which don't need write-enable code:\n\n");
......
......@@ -26,6 +26,7 @@
#define _LARGEFILE64_SOURCE
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
......@@ -1011,16 +1012,21 @@ const struct penable chipset_enables[] = {
void print_supported_chipsets(void)
{
int i;
printf("\nSupported chipsets:\n\n");
for (i = 0; chipset_enables[i].vendor_name != NULL; i++) {
printf("%s %s [%04x:%04x]%s\n", chipset_enables[i].vendor_name,
chipset_enables[i].device_name,
chipset_enables[i].vendor_id,
chipset_enables[i].device_id,
(chipset_enables[i].status == OK) ? "" : " (untested)");
int i, j;
const struct penable *c = chipset_enables;
printf("\nSupported chipsets:\n\nVendor: Chipset:"
" PCI IDs:\n\n");
for (i = 0; c[i].vendor_name != NULL; i++) {
printf("%s", c[i].vendor_name);
for (j = 0; j < 25 - strlen(c[i].vendor_name); j++)
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
flashrom \- detect, read, write, verify and erase flash chips
.SH SYNOPSIS
......@@ -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]
.SH DESCRIPTION
.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
using a supported mainboard, but it also supports flashing of network cards
(NICs), SATA controller cards, and other external devices which can program
......@@ -23,8 +23,7 @@ for details on coreboot)
.SH OPTIONS
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
checking that your flashrom version won't interpret them in a totally different
way.
checking that your flashrom version won't interpret options in a different way.
.PP
If no file is specified, then all that happens
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:
.sp
Currently overlapping sections are not supported.
.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
ROM layout and the ROM image in one file (cpio, zip or something?).
.TP
......@@ -89,11 +88,11 @@ 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.:
specify \-m, e.g.:
.sp
.B " flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom"
.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
coreboot table is found.
.TP
......@@ -114,18 +113,14 @@ Only flash image
from flash layout.
.TP
.B "\-L, \-\-list\-supported"
List the ROM chips, chipsets, and mainboards supported by flashrom.
The list of mainboards consists of those boards which need a special
ROM write-enable function for flashrom to work.
.sp
There are many other boards which will work out of the box, without such
special support in flashrom. Some of the known-good/known-bad and tested ones
are listed at
.BR http://coreboot.org/Flashrom#Supported_mainboards ,
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.
List the flash chips, chipsets, mainboards, and PCI card "programmers"
supported by flashrom.
.sp
There are many unlisted boards which will work out of the box, without
special support in flashrom. Please let us know if you can verify that
other boards work or do not work out of the box. For verification you have
to test an ERASE and/or WRITE operation, so make sure you only do that
if you have proper means to recover from failure!
.TP
.B "\-p, \-\-programmer <name>"
Specify the programmer device. Currently supported are:
......
......@@ -313,7 +313,7 @@ int erase_flash(struct flashchip *flash)
void print_supported_chips(void)
{
int okcol = 0, pos = 0;
int okcol = 0, pos = 0, i;
struct flashchip *f;
for (f = flashchips; f->name != NULL; f++) {
......@@ -323,7 +323,8 @@ void print_supported_chips(void)
}
okcol = (okcol + 7) & ~7;
POS_PRINT("Supported flash chips:");
printf("Supported flash chips:\n\n");
POS_PRINT("Vendor: Device:");
while (pos < okcol) {
printf("\t");
pos += 8 - (pos % 8);
......@@ -331,8 +332,16 @@ void print_supported_chips(void)
printf("Tested OK operations:\tKnown BAD operations:\n\n");
for (f = flashchips; f->name != NULL; f++) {
printf("%s %s", f->vendor, f->name);
pos = strlen(f->vendor) + 1 + strlen(f->name);
/* Don't print "unknown XXXX SPI chip" entries. */
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) {
printf("\t");
pos += 8 - (pos % 8);
......@@ -368,13 +377,13 @@ void print_supported_chips(void)
void usage(const char *name)
{
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);
printf("\n\nPlease note that the command line interface for flashrom will "
"change before flashrom 1.0.\nDo not use flashrom in scripts or "
"other automated tools without checking that your flashrom\n"
"version won't interpret them in a totally different way.\n\n");
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
(" -r | --read: read flash and save into file\n"
......@@ -387,7 +396,7 @@ void usage(const char *name)
" -e | --eend <addr>: exclude end postion\n"
" -m | --mainboard <[vendor:]part>: override mainboard settings\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"
" -L | --list-supported: print supported devices\n"
" -p | --programmer <name>: specify the programmer device\n"
......
......@@ -34,11 +34,11 @@ uint8_t *sii_bar;
uint16_t id;
struct pcidev_status satas_sii[] = {
{0x1095, 0x0680, PCI_OK, "Silicon Image", "PCI0680 Ultra ATA-133 Host Controller"},
{0x1095, 0x3114, PCI_OK, "Silicon Image", "SiI 3114 [SATALink/SATARaid] Serial ATA Controller"},
{0x1095, 0x3124, PCI_NT, "Silicon Image", "SiI 3124 PCI-X Serial ATA Controller"},
{0x1095, 0x3132, PCI_OK, "Silicon Image", "SiI 3132 Serial ATA Raid II Controller"},
{0x1095, 0x3512, PCI_NT, "Silicon Image", "SiI 3512 [SATALink/SATARaid] Serial ATA Controller"},
{0x1095, 0x0680, PCI_OK, "Silicon Image", "PCI0680 Ultra ATA-133 Host Ctrl"},
{0x1095, 0x3114, PCI_OK, "Silicon Image", "SiI 3114 [SATALink/SATARaid] SATA Ctrl"},
{0x1095, 0x3124, PCI_NT, "Silicon Image", "SiI 3124 PCI-X SATA Ctrl"},
{0x1095, 0x3132, PCI_OK, "Silicon Image", "SiI 3132 SATA Raid II Ctrl"},
{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