mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 23:22:37 +02:00
Add --list-supported option which lists the supported ROM chips, chipsets, and mainboards
Corresponding to flashrom svn r199 and coreboot v2 svn r3133. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Ward Vandewege <ward@gnu.org>
This commit is contained in:
parent
75f510768d
commit
e5ac16445f
@ -500,6 +500,18 @@ struct board_pciid_enable board_pciid_enables[] = {
|
|||||||
{0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL} /* Keep this */
|
{0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL} /* Keep this */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void print_supported_boards(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
printf("\nSupported mainboards (this list is not exhaustive!):\n\n");
|
||||||
|
|
||||||
|
for (i = 0; board_pciid_enables[i].name != NULL; i++)
|
||||||
|
printf("%s\n", board_pciid_enables[i].name);
|
||||||
|
|
||||||
|
printf("\nSee also: http://coreboot.org/Flashrom\n");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Match boards on coreboot table gathered vendor and part name.
|
* Match boards on coreboot table gathered vendor and part name.
|
||||||
* Require main PCI IDs to match too as extra safety.
|
* Require main PCI IDs to match too as extra safety.
|
||||||
|
@ -561,6 +561,17 @@ static const FLASH_ENABLE enables[] = {
|
|||||||
{0x1166, 0x0205, "Broadcom HT-1000", enable_flash_ht1000},
|
{0x1166, 0x0205, "Broadcom HT-1000", enable_flash_ht1000},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void print_supported_chipsets(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
printf("\nSupported chipsets:\n\n");
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_SIZE(enables); i++)
|
||||||
|
printf("%s (%04x:%04x)\n", enables[i].name,
|
||||||
|
enables[i].vendor, enables[i].device);
|
||||||
|
}
|
||||||
|
|
||||||
int chipset_flash_enable(void)
|
int chipset_flash_enable(void)
|
||||||
{
|
{
|
||||||
struct pci_dev *dev = 0;
|
struct pci_dev *dev = 0;
|
||||||
@ -568,8 +579,7 @@ int chipset_flash_enable(void)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Now let's try to find the chipset we have... */
|
/* Now let's try to find the chipset we have... */
|
||||||
/* TODO: Use ARRAY_SIZE. */
|
for (i = 0; i < ARRAY_SIZE(enables); i++) {
|
||||||
for (i = 0; i < sizeof(enables) / sizeof(enables[0]); i++) {
|
|
||||||
dev = pci_dev_find(enables[i].vendor, enables[i].device);
|
dev = pci_dev_find(enables[i].vendor, enables[i].device);
|
||||||
if (dev)
|
if (dev)
|
||||||
break;
|
break;
|
||||||
|
5
flash.h
5
flash.h
@ -30,6 +30,8 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
||||||
|
|
||||||
struct flashchip {
|
struct flashchip {
|
||||||
const char *name;
|
const char *name;
|
||||||
/* With 32bit manufacture_id and model_id we can cover IDs up to
|
/* With 32bit manufacture_id and model_id we can cover IDs up to
|
||||||
@ -287,11 +289,14 @@ struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device);
|
|||||||
struct pci_dev *pci_card_find(uint16_t vendor, uint16_t device,
|
struct pci_dev *pci_card_find(uint16_t vendor, uint16_t device,
|
||||||
uint16_t card_vendor, uint16_t card_device);
|
uint16_t card_vendor, uint16_t card_device);
|
||||||
|
|
||||||
|
|
||||||
/* board_enable.c */
|
/* board_enable.c */
|
||||||
int board_flash_enable(const char *vendor, const char *part);
|
int board_flash_enable(const char *vendor, const char *part);
|
||||||
|
void print_supported_boards(void);
|
||||||
|
|
||||||
/* chipset_enable.c */
|
/* chipset_enable.c */
|
||||||
int chipset_flash_enable(void);
|
int chipset_flash_enable(void);
|
||||||
|
void print_supported_chipsets(void);
|
||||||
|
|
||||||
/* Physical memory mapping device */
|
/* Physical memory mapping device */
|
||||||
#if defined (__sun) && (defined(__i386) || defined(__amd64))
|
#if defined (__sun) && (defined(__i386) || defined(__amd64))
|
||||||
|
15
flashrom.8
15
flashrom.8
@ -2,13 +2,13 @@
|
|||||||
.SH NAME
|
.SH NAME
|
||||||
flashrom \- a universal BIOS/ROM/flash programming utility
|
flashrom \- a universal BIOS/ROM/flash programming utility
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B flashrom \fR[\fB\-rwvEVfhR\fR] [\fB\-c\fR chipname] [\fB\-s\fR exclude_start] [\fB\-e\fR exclude_end]
|
.B flashrom \fR[\fB\-rwvEVfLhR\fR] [\fB\-c\fR chipname] [\fB\-s\fR exclude_start] [\fB\-e\fR exclude_end]
|
||||||
[\fB-m\fR vendor:part] [\fB-l\fR file.layout] [\fB-i\fR image_name] [file]
|
[\fB-m\fR vendor:part] [\fB-l\fR file.layout] [\fB-i\fR image_name] [file]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.B flashrom
|
.B flashrom
|
||||||
is a universal flash programming utility for DIP, PLCC, or SPI flash ROM
|
is a universal flash programming utility for DIP, PLCC, or SPI flash ROM
|
||||||
chips. It can be used to flash BIOS/coreboot/firmware images, for example.
|
chips. It can be used to flash BIOS/coreboot/firmware images, for example.
|
||||||
|
.sp
|
||||||
(see
|
(see
|
||||||
.B http://coreboot.org
|
.B http://coreboot.org
|
||||||
for details on coreboot)
|
for details on coreboot)
|
||||||
@ -61,6 +61,17 @@ Only flash image
|
|||||||
.B <name>
|
.B <name>
|
||||||
from flash layout.
|
from flash layout.
|
||||||
.TP
|
.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.
|
||||||
|
.TP
|
||||||
.B "\-h, \-\-help"
|
.B "\-h, \-\-help"
|
||||||
Show a help text and exit.
|
Show a help text and exit.
|
||||||
.TP
|
.TP
|
||||||
|
23
flashrom.c
23
flashrom.c
@ -193,9 +193,19 @@ int verify_flash(struct flashchip *flash, uint8_t *buf)
|
|||||||
return 0;
|
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)
|
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(" [-e exclude_end] [-m [vendor:]part] [-l file.layout] [-i imagename] [file]\n");
|
||||||
printf
|
printf
|
||||||
(" -r | --read: read flash and save into file\n"
|
(" -r | --read: read flash and save into file\n"
|
||||||
@ -210,6 +220,8 @@ void usage(const char *name)
|
|||||||
" -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"
|
||||||
|
" -h | --help: print this help text\n"
|
||||||
" -R | --version: print the version (release)\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");
|
" is that flash info is dumped.\n\n");
|
||||||
@ -245,6 +257,7 @@ int main(int argc, char *argv[])
|
|||||||
{"force", 0, 0, 'f'},
|
{"force", 0, 0, 'f'},
|
||||||
{"layout", 1, 0, 'l'},
|
{"layout", 1, 0, 'l'},
|
||||||
{"image", 1, 0, 'i'},
|
{"image", 1, 0, 'i'},
|
||||||
|
{"list-supported", 0, 0, 'L'},
|
||||||
{"help", 0, 0, 'h'},
|
{"help", 0, 0, 'h'},
|
||||||
{"version", 0, 0, 'R'},
|
{"version", 0, 0, 'R'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
@ -264,7 +277,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
setbuf(stdout, NULL);
|
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) {
|
long_options, &option_index)) != EOF) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'r':
|
case 'r':
|
||||||
@ -317,6 +330,12 @@ int main(int argc, char *argv[])
|
|||||||
tempstr = strdup(optarg);
|
tempstr = strdup(optarg);
|
||||||
find_romentry(tempstr);
|
find_romentry(tempstr);
|
||||||
break;
|
break;
|
||||||
|
case 'L':
|
||||||
|
print_supported_chips();
|
||||||
|
print_supported_chipsets();
|
||||||
|
print_supported_boards();
|
||||||
|
exit(0);
|
||||||
|
break;
|
||||||
case 'R':
|
case 'R':
|
||||||
print_version();
|
print_version();
|
||||||
exit(0);
|
exit(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user