1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-28 07:23:43 +02:00

Change programmer options separator from = to :

Current programmer parameter syntax is -p programmer=parameter
Unfortunately, many parameters are of the form variable=val, so we get
commandlines like this.

flashrom -p it87spi=port=0x820 and this looks horrible.

Using : instead of = would make such parameters look better: flashrom -p
it87spi:port=0x820

As a side benefit, this patch mentions the programmer name in the error
message if it is unknown.

Corresponding to flashrom svn r693.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
This commit is contained in:
Carl-Daniel Hailfinger 2009-08-19 15:03:28 +00:00
parent 8ab49e72af
commit 664e7ad995
2 changed files with 10 additions and 10 deletions

View File

@ -150,7 +150,7 @@ Specify the programmer device. Currently supported are:
.sp .sp
The dummy programmer has an optional parameter specifying the bus types it The dummy programmer has an optional parameter specifying the bus types it
should support. For that you have to use the should support. For that you have to use the
.B "flashrom -p dummy=type" .B "flashrom -p dummy:type"
syntax where syntax where
.B type .B type
can be any comma-separated combination of can be any comma-separated combination of
@ -158,11 +158,11 @@ can be any comma-separated combination of
in any order. in any order.
.sp .sp
Example: Example:
.B "flashrom -p dummy=lpc,fwh" .B "flashrom -p dummy:lpc,fwh"
.sp .sp
If you have multiple supported PCI cards which can program flash chips If you have multiple supported PCI cards which can program flash chips
(NICs, SATA/IDE controllers, etc.) in your system, you must use the (NICs, SATA/IDE controllers, etc.) in your system, you must use the
.B "flashrom -p xxxx=bb:dd.f" .B "flashrom -p xxxx:bb:dd.f"
syntax to explicitly select one of them, where syntax to explicitly select one of them, where
.B xxxx .B xxxx
is the name of the programmer is the name of the programmer
@ -174,7 +174,7 @@ is the PCI device number, and
is the PCI function number of the desired NIC. is the PCI function number of the desired NIC.
.sp .sp
Example: Example:
.B "flashrom -p nic3com=05:04.0" .B "flashrom -p nic3com:05:04.0"
.sp .sp
Currently the following programmers support this mechanism: Currently the following programmers support this mechanism:
.BR nic3com , .BR nic3com ,
@ -183,14 +183,14 @@ Currently the following programmers support this mechanism:
The it87spi programmer has an optional parameter which will set the I/O base The it87spi programmer has an optional parameter which will set the I/O base
port of the IT87* SPI controller interface to the port specified in the port of the IT87* SPI controller interface to the port specified in the
parameter. For that you have to use the parameter. For that you have to use the
.B "flashrom -p it87spi=port=portnum" .B "flashrom -p it87spi:port=portnum"
syntax where syntax where
.B portnum .B portnum
is an I/O port number which must be a multiple of 8. is an I/O port number which must be a multiple of 8.
.sp .sp
The ft2232spi programmer has an optional parameter specifying the controller The ft2232spi programmer has an optional parameter specifying the controller
type and interface/port it should support. For that you have to use the type and interface/port it should support. For that you have to use the
.B "flashrom -p ft2232spi=model,port=interface" .B "flashrom -p ft2232spi:model,port=interface"
syntax where syntax where
.B model .B model
can be any of can be any of
@ -208,9 +208,9 @@ and the default interface is
The serprog programmer has an optional parameter specifying either a serial The serprog programmer has an optional parameter specifying either a serial
device/baud combination or an IP/port combination for communication with the device/baud combination or an IP/port combination for communication with the
programmer. For serial, you have to use the programmer. For serial, you have to use the
.B "flashrom -p serprog=/dev/device:baud" .B "flashrom -p serprog:/dev/device:baud"
syntax and for IP, you have to use syntax and for IP, you have to use
.B "flashrom -p serprog=ip:port" .B "flashrom -p serprog:ip:port"
instead. More information about serprog is available in serprog-protocol.txt in instead. More information about serprog is available in serprog-protocol.txt in
the source distribution. the source distribution.
.sp .sp

View File

@ -708,7 +708,7 @@ int main(int argc, char *argv[])
namelen = strlen(name); namelen = strlen(name);
if (strncmp(optarg, name, namelen) == 0) { if (strncmp(optarg, name, namelen) == 0) {
switch (optarg[namelen]) { switch (optarg[namelen]) {
case '=': case ':':
programmer_param = strdup(optarg + namelen + 1); programmer_param = strdup(optarg + namelen + 1);
break; break;
case '\0': case '\0':
@ -725,7 +725,7 @@ int main(int argc, char *argv[])
} }
} }
if (programmer == PROGRAMMER_INVALID) { if (programmer == PROGRAMMER_INVALID) {
printf("Error: Unknown programmer.\n"); printf("Error: Unknown programmer %s.\n", optarg);
exit(1); exit(1);
} }
break; break;