summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-10-06 23:48:34 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-10-06 23:48:34 +0000
commita73fb4983df7284e3d0e0a3fa79aa197bed324db (patch)
treebb46efa05f3782f03b7aeaab68eac36af5344d31
parentf992c19fcaba3567fb11767ad0b9aaf22459abc2 (diff)
downloadast2050-flashrom-a73fb4983df7284e3d0e0a3fa79aa197bed324db.zip
ast2050-flashrom-a73fb4983df7284e3d0e0a3fa79aa197bed324db.tar.gz
Refine -L output to include all programmer modules
Flashrom -L output did not contain a list of programmers nor were all programmers listed. Fix it and mention at least the name of each programmer. Wiki output is unchanged, and will need separate fixups. Corresponding to flashrom svn r1199. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
-rw-r--r--atahpt.c2
-rw-r--r--cli_classic.c32
-rw-r--r--flash.h1
-rw-r--r--flashrom.c41
-rw-r--r--ft2232_spi.c1
-rw-r--r--pcidev.c1
-rw-r--r--print.c88
7 files changed, 111 insertions, 55 deletions
diff --git a/atahpt.c b/atahpt.c
index f1e1296..2552697 100644
--- a/atahpt.c
+++ b/atahpt.c
@@ -30,7 +30,7 @@
#define PCI_VENDOR_ID_HPT 0x1103
-struct pcidev_status ata_hpt[] = {
+const struct pcidev_status ata_hpt[] = {
{0x1103, 0x0004, NT, "Highpoint", "HPT366/368/370/370A/372/372N"},
{0x1103, 0x0005, NT, "Highpoint", "HPT372A/372N"},
{0x1103, 0x0006, NT, "Highpoint", "HPT302/302N"},
diff --git a/cli_classic.c b/cli_classic.c
index 979a822..9b9b451 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -33,11 +33,6 @@
static void cli_classic_usage(const char *name)
{
- const char *pname;
- int pnamelen;
- int remaining = 0;
- enum programmer p;
-
printf("Usage: flashrom [-n] [-V] [-f] [-h|-R|-L|"
#if CONFIG_PRINT_WIKI == 1
"-z|"
@@ -83,32 +78,9 @@ static void cli_classic_usage(const char *name)
"in wiki syntax\n"
#endif
" -p | --programmer <name>[:<param>] specify the programmer "
- "device");
-
- for (p = 0; p < PROGRAMMER_INVALID; p++) {
- pname = programmer_table[p].name;
- pnamelen = strlen(pname);
- if (remaining - pnamelen - 2 < 0) {
- printf("\n ");
- remaining = 43;
- } else {
- printf(" ");
- remaining--;
- }
- if (p == 0) {
- printf("(");
- remaining--;
- }
- printf("%s", pname);
- remaining -= pnamelen;
- if (p < PROGRAMMER_INVALID - 1) {
- printf(",");
- remaining--;
- } else {
- printf(")\n");
- }
- }
+ "device\n");
+ list_programmers_linebreak(37, 80, 1);
printf("\nYou can specify one of -h, -R, -L, "
#if CONFIG_PRINT_WIKI == 1
"-z, "
diff --git a/flash.h b/flash.h
index 25624aa..40382f0 100644
--- a/flash.h
+++ b/flash.h
@@ -200,6 +200,7 @@ int need_erase(uint8_t *have, uint8_t *want, int len, enum write_granularity gra
char *strcat_realloc(char *dest, const char *src);
void print_version(void);
void print_banner(void);
+void list_programmers_linebreak(int startcol, int cols, int paren);
int selfcheck(void);
int doit(struct flashchip *flash, int force, char *filename, int read_it, int write_it, int erase_it, int verify_it);
diff --git a/flashrom.c b/flashrom.c
index 0a3e4fe..fa36bfb 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -1332,6 +1332,47 @@ void list_programmers(char *delim)
msg_ginfo("\n");
}
+void list_programmers_linebreak(int startcol, int cols, int paren)
+{
+ const char *pname;
+ int pnamelen;
+ int remaining = 0;
+ int firstline = 1;
+ enum programmer p;
+ int i;
+
+ for (p = 0; p < PROGRAMMER_INVALID; p++) {
+ pname = programmer_table[p].name;
+ pnamelen = strlen(pname);
+ if (remaining - pnamelen - 2 < 0) {
+ if (firstline)
+ firstline = 0;
+ else
+ printf("\n");
+ for (i = 0; i < startcol; i++)
+ printf(" ");
+ remaining = cols - startcol;
+ } else {
+ printf(" ");
+ remaining--;
+ }
+ if (paren && (p == 0)) {
+ printf("(");
+ remaining--;
+ }
+ printf("%s", pname);
+ remaining -= pnamelen;
+ if (p < PROGRAMMER_INVALID - 1) {
+ printf(",");
+ remaining--;
+ } else {
+ if (paren)
+ printf(")");
+ printf("\n");
+ }
+ }
+}
+
void print_sysinfo(void)
{
#if HAVE_UTSNAME == 1
diff --git a/ft2232_spi.c b/ft2232_spi.c
index 9c6b017..ee2b693 100644
--- a/ft2232_spi.c
+++ b/ft2232_spi.c
@@ -346,6 +346,7 @@ void print_supported_usbdevs(const struct usbdev_status *devs)
{
int i;
+ msg_pinfo("USB devices:\n");
for (i = 0; devs[i].vendor_name != NULL; i++) {
msg_pinfo("%s %s [%04x:%04x]%s\n", devs[i].vendor_name,
devs[i].device_name, devs[i].vendor_id,
diff --git a/pcidev.c b/pcidev.c
index 742184c..933fd4b 100644
--- a/pcidev.c
+++ b/pcidev.c
@@ -132,6 +132,7 @@ void print_supported_pcidevs(const struct pcidev_status *devs)
{
int i;
+ msg_pinfo("PCI devices:\n");
for (i = 0; devs[i].vendor_name != NULL; i++) {
msg_pinfo("%s %s [%02x:%02x]%s\n", devs[i].vendor_name,
devs[i].device_name, devs[i].vendor_id,
diff --git a/print.c b/print.c
index ccd499c..66b2938 100644
--- a/print.c
+++ b/print.c
@@ -223,49 +223,89 @@ static void print_supported_boards_helper(const struct board_info *boards,
void print_supported(void)
{
- print_supported_chips();
+ print_supported_chips();
+
+ printf("\nSupported programmers:\n");
+ list_programmers_linebreak(0, 80, 0);
#if CONFIG_INTERNAL == 1
- print_supported_chipsets();
- print_supported_boards_helper(boards_known, "boards");
- print_supported_boards_helper(laptops_known, "laptops");
+ printf("\nSupported devices for the %s programmer:\n",
+ programmer_table[PROGRAMMER_INTERNAL].name);
+ print_supported_chipsets();
+ print_supported_boards_helper(boards_known, "boards");
+ print_supported_boards_helper(laptops_known, "laptops");
#endif
-#if CONFIG_NIC3COM+CONFIG_NICREALTEK+CONFIG_NICNATSEMI+CONFIG_GFXNVIDIA+CONFIG_DRKAISER+CONFIG_SATASII+CONFIG_ATAHPT >= 1
- printf("\nSupported PCI devices flashrom can use "
- "as programmer:\n\n");
+#if CONFIG_DUMMY == 1
+ printf("\nSupported devices for the %s programmer:\n",
+ programmer_table[PROGRAMMER_DUMMY].name);
+ /* FIXME */
#endif
#if CONFIG_NIC3COM == 1
- print_supported_pcidevs(nics_3com);
+ printf("\nSupported devices for the %s programmer:\n",
+ programmer_table[PROGRAMMER_NIC3COM].name);
+ print_supported_pcidevs(nics_3com);
#endif
#if CONFIG_NICREALTEK == 1
- print_supported_pcidevs(nics_realtek);
- print_supported_pcidevs(nics_realteksmc1211);
+ printf("\nSupported devices for the %s programmer:\n",
+ programmer_table[PROGRAMMER_NICREALTEK].name);
+ print_supported_pcidevs(nics_realtek);
+ printf("\nSupported devices for the %s programmer:\n",
+ programmer_table[PROGRAMMER_NICREALTEK2].name);
+ print_supported_pcidevs(nics_realteksmc1211);
#endif
#if CONFIG_NICNATSEMI == 1
- print_supported_pcidevs(nics_natsemi);
+ printf("\nSupported devices for the %s programmer:\n",
+ programmer_table[PROGRAMMER_NICNATSEMI].name);
+ print_supported_pcidevs(nics_natsemi);
#endif
#if CONFIG_GFXNVIDIA == 1
- print_supported_pcidevs(gfx_nvidia);
+ printf("\nSupported devices for the %s programmer:\n",
+ programmer_table[PROGRAMMER_GFXNVIDIA].name);
+ print_supported_pcidevs(gfx_nvidia);
#endif
#if CONFIG_DRKAISER == 1
- print_supported_pcidevs(drkaiser_pcidev);
+ printf("\nSupported devices for the %s programmer:\n",
+ programmer_table[PROGRAMMER_DRKAISER].name);
+ print_supported_pcidevs(drkaiser_pcidev);
#endif
#if CONFIG_SATASII == 1
- print_supported_pcidevs(satas_sii);
+ printf("\nSupported devices for the %s programmer:\n",
+ programmer_table[PROGRAMMER_SATASII].name);
+ print_supported_pcidevs(satas_sii);
#endif
#if CONFIG_ATAHPT == 1
- print_supported_pcidevs(ata_hpt);
+ printf("\nSupported devices for the %s programmer:\n",
+ programmer_table[PROGRAMMER_ATAHPT].name);
+ print_supported_pcidevs(ata_hpt);
#endif
-#if CONFIG_NICINTEL_SPI == 1
- print_supported_pcidevs(nics_intel_spi);
+#if CONFIG_FT2232_SPI == 1
+ printf("\nSupported devices for the %s programmer:\n",
+ programmer_table[PROGRAMMER_FT2232_SPI].name);
+ print_supported_usbdevs(devs_ft2232spi);
#endif
-
-#if CONFIG_FT2232_SPI+CONFIG_DEDIPROG >= 1
- printf("\nSupported USB devices flashrom can use "
- "as programmer:\n\n");
+#if CONFIG_SERPROG == 1
+ printf("\nSupported devices for the %s programmer:\n",
+ programmer_table[PROGRAMMER_SERPROG].name);
+ /* FIXME */
#endif
-
-#if CONFIG_FT2232_SPI == 1
- print_supported_usbdevs(devs_ft2232spi);
+#if CONFIG_BUSPIRATE_SPI == 1
+ printf("\nSupported devices for the %s programmer:\n",
+ programmer_table[PROGRAMMER_BUSPIRATE_SPI].name);
+ /* FIXME */
+#endif
+#if CONFIG_DEDIPROG == 1
+ printf("\nSupported devices for the %s programmer:\n",
+ programmer_table[PROGRAMMER_DEDIPROG].name);
+ /* FIXME */
+#endif
+#if CONFIG_RAYER_SPI == 1
+ printf("\nSupported devices for the %s programmer:\n",
+ programmer_table[PROGRAMMER_RAYER_SPI].name);
+ /* FIXME */
+#endif
+#if CONFIG_NICINTEL_SPI == 1
+ printf("\nSupported devices for the %s programmer:\n",
+ programmer_table[PROGRAMMER_NICINTEL_SPI].name);
+ print_supported_pcidevs(nics_intel_spi);
#endif
}
OpenPOWER on IntegriCloud