blob: 193fc28a46e43453b8b6c1a21c54ed3f91c1b5a4 [file] [log] [blame]
Uwe Hermanne8ba5382009-05-22 11:37:27 +00001.TH FLASHROM 8 "May 21, 2009"
Stefan Reinauer261144c2006-07-27 23:29:02 +00002.SH NAME
Uwe Hermann530cb2d2009-05-14 22:58:21 +00003flashrom \- detect, read, write, verify and erase flash chips
Stefan Reinauer261144c2006-07-27 23:29:02 +00004.SH SYNOPSIS
Uwe Hermann530cb2d2009-05-14 22:58:21 +00005.B flashrom \fR[\fB\-EVfLhR\fR] [\fB\-r\fR file] [\fB\-w\fR file] [\fB\-v\fR file]
6 [\fB\-c\fR chipname] [\fB\-s\fR addr] [\fB\-e\fR addr] [\fB\-m\fR [vendor:]part]
7 [\fB\-l\fR file] [\fB\-i\fR image] [\fB\-p\fR programmer] [file]
Stefan Reinauer261144c2006-07-27 23:29:02 +00008.SH DESCRIPTION
9.B flashrom
Uwe Hermanne8ba5382009-05-22 11:37:27 +000010is a utility for detecting, reading, writing, verifying and erasing flash
Uwe Hermann530cb2d2009-05-14 22:58:21 +000011chips. It's often used to flash BIOS/EFI/coreboot/firmware images in-system
12using a supported mainboard, but it also supports flashing of network cards
13(NICs), SATA controller cards, and other external devices which can program
14flash chips.
Uwe Hermanne74b9f82009-04-10 14:41:29 +000015.PP
Uwe Hermannd42009c2009-04-11 13:59:00 +000016It supports a wide range of DIP32, PLCC32, DIP8, SO8/SOIC8, TSOP32, and
17TSOP40 chips, which use various protocols such as LPC, FWH, parallel flash,
18or SPI.
Uwe Hermanne74b9f82009-04-10 14:41:29 +000019.PP
Uwe Hermann42eb17f2008-01-18 17:48:51 +000020(see
21.B http://coreboot.org
22for details on coreboot)
Stefan Reinauer261144c2006-07-27 23:29:02 +000023.SH OPTIONS
Carl-Daniel Hailfinger5de93412009-05-01 10:53:49 +000024Please note that the command line interface for flashrom will change before
25flashrom 1.0. Do not use flashrom in scripts or other automated tools without
Uwe Hermanne8ba5382009-05-22 11:37:27 +000026checking that your flashrom version won't interpret options in a different way.
Carl-Daniel Hailfinger5de93412009-05-01 10:53:49 +000027.PP
Stefan Reinauer261144c2006-07-27 23:29:02 +000028If no file is specified, then all that happens
29is that flash info is dumped and the flash chip is set to writable.
Stefan Reinauerde063bf2006-09-21 13:09:22 +000030.TP
Uwe Hermanne74b9f82009-04-10 14:41:29 +000031.B "\-r, \-\-read <file>"
32Read flash ROM contents and save them into the given
33.BR <file> .
Stefan Reinauerde063bf2006-09-21 13:09:22 +000034.TP
Uwe Hermanne74b9f82009-04-10 14:41:29 +000035.B "\-w, \-\-write <file>"
36Write file into flash ROM (default when
37.B <file>
38is specified).
Stefan Reinauerde063bf2006-09-21 13:09:22 +000039.TP
Uwe Hermanne74b9f82009-04-10 14:41:29 +000040.B "\-v, \-\-verify <file>"
41Verify the flash ROM contents against the given
42.BR <file> .
Stefan Reinauerde063bf2006-09-21 13:09:22 +000043.TP
Stefan Reinauer261144c2006-07-27 23:29:02 +000044.B "\-E, \-\-erase"
Uwe Hermanne74b9f82009-04-10 14:41:29 +000045Erase the flash ROM chip.
Stefan Reinauerde063bf2006-09-21 13:09:22 +000046.TP
Stefan Reinauer261144c2006-07-27 23:29:02 +000047.B "\-V, \-\-verbose"
48More verbose output.
Stefan Reinauerde063bf2006-09-21 13:09:22 +000049.TP
Stefan Reinauer261144c2006-07-27 23:29:02 +000050.B "\-c, \-\-chip" <chipname>
Uwe Hermann42eb17f2008-01-18 17:48:51 +000051Probe only for specified flash ROM chip.
Stefan Reinauerde063bf2006-09-21 13:09:22 +000052.TP
Stefan Reinauer261144c2006-07-27 23:29:02 +000053.B "\-s, \-\-estart" <addr>
Uwe Hermann42eb17f2008-01-18 17:48:51 +000054Exclude start position (obsolete).
Uwe Hermann87c07932009-05-05 16:15:46 +000055.sp
56flashrom supports ROM layouts. This allows you to flash certain parts of
57the flash chip only. A ROM layout file looks like follows:
58.sp
59 00000000:00008fff gfxrom
60 00009000:0003ffff normal
61 00040000:0007ffff fallback
62.sp
63 i.e.:
64 startaddr:endaddr name
65.sp
66All addresses are offsets within the file, not absolute addresses!
67If you only want to update the normal image in a ROM you can say:
68.sp
69.B " flashrom -w --layout rom.layout --image normal agami_aruma.rom"
70.sp
71To update normal and fallback but leave the VGA BIOS alone, say:
72.sp
73.B " flashrom -w -l rom.layout -i normal \"
74.br
75.B " -i fallback agami_aruma.rom"
76.sp
77Currently overlapping sections are not supported.
78.sp
Uwe Hermanne8ba5382009-05-22 11:37:27 +000079ROM layouts should replace the \-s and \-e option since they are more
Uwe Hermann87c07932009-05-05 16:15:46 +000080flexible and they should lead to a ROM update file format with the
81ROM layout and the ROM image in one file (cpio, zip or something?).
Stefan Reinauerde063bf2006-09-21 13:09:22 +000082.TP
Stefan Reinauerf8337dd2006-08-03 10:49:09 +000083.B "\-e, \-\-eend" <addr>
Uwe Hermann42eb17f2008-01-18 17:48:51 +000084Exclude end postion (obsolete).
Stefan Reinauerde063bf2006-09-21 13:09:22 +000085.TP
Peter Stuge6b53fed2008-01-27 16:21:21 +000086.B "\-m, \-\-mainboard" <[vendor:]part>
Uwe Hermann87c07932009-05-05 16:15:46 +000087Override mainboard settings.
88.sp
89flashrom reads the coreboot table to determine the current mainboard. If no
90coreboot table could be read or if you want to override these values, you can
Uwe Hermanne8ba5382009-05-22 11:37:27 +000091specify \-m, e.g.:
Uwe Hermann87c07932009-05-05 16:15:46 +000092.sp
93.B " flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom"
94.sp
Uwe Hermanne8ba5382009-05-22 11:37:27 +000095See the 'Supported mainboards' section in the output of 'flashrom \-L' for
Uwe Hermann87c07932009-05-05 16:15:46 +000096a list of boards which require the specification of the board name, if no
97coreboot table is found.
Stefan Reinauerde063bf2006-09-21 13:09:22 +000098.TP
Stefan Reinauer261144c2006-07-27 23:29:02 +000099.B "\-f, \-\-force"
Uwe Hermann67808fe2007-10-18 00:29:05 +0000100Force write without checking whether the ROM image file is really meant
101to be used on this board.
102.sp
Stefan Reinauere3f3e2e2008-01-18 15:33:10 +0000103Note: This check only works while coreboot is running, and only for those
104boards where the coreboot code supports it.
Stefan Reinauerde063bf2006-09-21 13:09:22 +0000105.TP
Uwe Hermanne74b9f82009-04-10 14:41:29 +0000106.B "\-l, \-\-layout <file>"
107Read ROM layout from
108.BR <file> .
Stefan Reinauerde063bf2006-09-21 13:09:22 +0000109.TP
Uwe Hermanne74b9f82009-04-10 14:41:29 +0000110.B "\-i, \-\-image <name>"
Uwe Hermann67808fe2007-10-18 00:29:05 +0000111Only flash image
112.B <name>
113from flash layout.
Stefan Reinauerde063bf2006-09-21 13:09:22 +0000114.TP
Uwe Hermanne5ac1642008-03-12 11:54:51 +0000115.B "\-L, \-\-list\-supported"
Uwe Hermanne8ba5382009-05-22 11:37:27 +0000116List the flash chips, chipsets, mainboards, and PCI card "programmers"
117supported by flashrom.
Uwe Hermanne5ac1642008-03-12 11:54:51 +0000118.sp
Uwe Hermanne8ba5382009-05-22 11:37:27 +0000119There are many unlisted boards which will work out of the box, without
120special support in flashrom. Please let us know if you can verify that
121other boards work or do not work out of the box. For verification you have
122to test an ERASE and/or WRITE operation, so make sure you only do that
123if you have proper means to recover from failure!
Uwe Hermanne5ac1642008-03-12 11:54:51 +0000124.TP
Carl-Daniel Hailfingerce986772009-05-09 00:27:07 +0000125.B "\-p, \-\-programmer <name>"
126Specify the programmer device. Currently supported are:
127.sp
Uwe Hermann530cb2d2009-05-14 22:58:21 +0000128.BR "* internal" " (default, for in-system flashing in the mainboard)"
129.sp
Uwe Hermannc7e8a0c2009-05-19 14:14:21 +0000130.BR "* dummy" " (just prints all operations and accesses)"
131.sp
Uwe Hermann530cb2d2009-05-14 22:58:21 +0000132.BR "* nic3com" " (for flash ROMs on 3COM network cards)"
133.sp
Uwe Hermannc7e8a0c2009-05-19 14:14:21 +0000134.BR "* satasii" " (for flash ROMs on Silicon Image SATA/IDE controllers)"
135.sp
136If you have multiple supported PCI cards which can program flash chips
137(NICs, SATA/IDE controllers, etc.) in your system, you must use the
138.B "flashrom -p xxxx=bb:dd.f"
139syntax to explicitly select one of them, where
140.B xxxx
141is the name of the programmer
Uwe Hermann530cb2d2009-05-14 22:58:21 +0000142.B bb
143is the PCI bus number,
144.B dd
145is the PCI device number, and
146.B f
147is the PCI function number of the desired NIC.
148.sp
149Example:
150.B "flashrom -p nic3com=05:04.0"
151.sp
Uwe Hermannc7e8a0c2009-05-19 14:14:21 +0000152Currently the following programmers support this mechanism:
153.BR nic3com ,
154.BR satasii .
Carl-Daniel Hailfingerce986772009-05-09 00:27:07 +0000155.TP
Stefan Reinauer261144c2006-07-27 23:29:02 +0000156.B "\-h, \-\-help"
157Show a help text and exit.
Bernhard Walle201bde32008-01-21 15:24:22 +0000158.TP
159.B "\-R, \-\-version"
160Show version information and exit.
Peter Stuge42688e52009-01-26 02:20:56 +0000161.SH EXIT STATUS
162flashrom exits with 0 on success, 1 on most failures but with 2 if /dev/mem
163(/dev/xsvc on Solaris) can not be opened and with 3 if a call to mmap() fails.
Stefan Reinauer261144c2006-07-27 23:29:02 +0000164.SH BUGS
Uwe Hermann42eb17f2008-01-18 17:48:51 +0000165Please report any bugs at
166.BR http://tracker.coreboot.org/trac/coreboot/newticket ","
167or on the coreboot mailing list
168.RB "(" http://coreboot.org/Mailinglist ")."
Stefan Reinauer261144c2006-07-27 23:29:02 +0000169.SH LICENCE
170.B flashrom
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000171is covered by the GNU General Public License (GPL), version 2. Some files are
172additionally available under the GPL (version 2, or any later version).
Stefan Reinauer261144c2006-07-27 23:29:02 +0000173.SH COPYRIGHT
Stefan Reinauer261144c2006-07-27 23:29:02 +0000174.br
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000175Please see the individual files.
Stefan Reinauer261144c2006-07-27 23:29:02 +0000176.SH AUTHORS
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000177Carl-Daniel Hailfinger
178.br
179Claus Gindhart <claus.gindhart@kontron.com>
180.br
181Dominik Geyer <dominik.geyer@kontron.com>
182.br
183Eric Biederman <ebiederman@lnxi.com>
184.br
185Giampiero Giancipoli <gianci@email.it>
186.br
187Joe Bao <Zheng.Bao@amd.com>
188.br
189Luc Verhaegen <libv@skynet.be>
190.br
Carl-Daniel Hailfinger451dc802009-05-01 11:00:39 +0000191Li-Ta Lo
192.br
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000193Markus Boas <ryven@ryven.de>
194.br
195Nikolay Petukhov <nikolay.petukhov@gmail.com>
196.br
197Peter Stuge <peter@stuge.se>
198.br
199Reinder E.N. de Haan <lb_reha@mveas.com>
200.br
201Ronald G. Minnich <rminnich@gmail.com>
202.br
203Ronald Hoogenboom <ronald@zonnet.nl>
Stefan Reinauer261144c2006-07-27 23:29:02 +0000204.br
205Stefan Reinauer <stepan@coresystems.de>
206.br
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000207Stefan Wildemann <stefan.wildemann@kontron.com>
208.br
209Steven James <pyro@linuxlabs.com>
210.br
211Uwe Hermann <uwe@hermann-uwe.de>
212.br
213Wang Qingpei <Qingpei.Wang@amd.com>
214.br
215Yinghai Lu <yinghai.lu@amd.com>
Stefan Reinauerf8337dd2006-08-03 10:49:09 +0000216.br
217some others
Stefan Reinauer261144c2006-07-27 23:29:02 +0000218.PP
Stefan Reinauerde063bf2006-09-21 13:09:22 +0000219This manual page was written by Uwe Hermann <uwe@hermann-uwe.de>.
Uwe Hermann42eb17f2008-01-18 17:48:51 +0000220It is licensed under the terms of the GNU GPL (version 2 or later).