blob: 3986f75b84c96161fe603cfbc318571a6cca6ec1 [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 Hermannea07f622009-06-24 17:31:08 +00005.B flashrom \fR[\fB\-VfLzhRn\fR] [\fB\-E\fR|\fB\-r\fR file|\fB\-w\fR file|\fB\-v\fR file] [\fB\-c\fR chipname]
6 [\fB\-m\fR [vendor:]part] [\fB\-l\fR file] [\fB\-i\fR image] [\fB\-p\fR programmer]
Stefan Reinauer261144c2006-07-27 23:29:02 +00007.SH DESCRIPTION
8.B flashrom
Uwe Hermanne8ba5382009-05-22 11:37:27 +00009is a utility for detecting, reading, writing, verifying and erasing flash
Uwe Hermann530cb2d2009-05-14 22:58:21 +000010chips. It's often used to flash BIOS/EFI/coreboot/firmware images in-system
11using a supported mainboard, but it also supports flashing of network cards
12(NICs), SATA controller cards, and other external devices which can program
13flash chips.
Uwe Hermanne74b9f82009-04-10 14:41:29 +000014.PP
Uwe Hermannd42009c2009-04-11 13:59:00 +000015It supports a wide range of DIP32, PLCC32, DIP8, SO8/SOIC8, TSOP32, and
16TSOP40 chips, which use various protocols such as LPC, FWH, parallel flash,
17or SPI.
Stefan Reinauer261144c2006-07-27 23:29:02 +000018.SH OPTIONS
Carl-Daniel Hailfinger5de93412009-05-01 10:53:49 +000019Please note that the command line interface for flashrom will change before
20flashrom 1.0. Do not use flashrom in scripts or other automated tools without
Uwe Hermanne8ba5382009-05-22 11:37:27 +000021checking that your flashrom version won't interpret options in a different way.
Carl-Daniel Hailfinger5de93412009-05-01 10:53:49 +000022.PP
Uwe Hermann1432a602009-06-28 23:26:37 +000023You can specify one of \-E, \-r, \-w, \-v or no operation.
Carl-Daniel Hailfinger01d6aba2009-06-12 14:02:07 +000024If no operation is specified, then all that happens
Stefan Reinauer261144c2006-07-27 23:29:02 +000025is that flash info is dumped and the flash chip is set to writable.
Stefan Reinauerde063bf2006-09-21 13:09:22 +000026.TP
Uwe Hermanne74b9f82009-04-10 14:41:29 +000027.B "\-r, \-\-read <file>"
28Read flash ROM contents and save them into the given
29.BR <file> .
Stefan Reinauerde063bf2006-09-21 13:09:22 +000030.TP
Uwe Hermanne74b9f82009-04-10 14:41:29 +000031.B "\-w, \-\-write <file>"
Uwe Hermann9d680802009-07-11 22:17:28 +000032Write file into flash ROM.
Stefan Reinauerde063bf2006-09-21 13:09:22 +000033.TP
Uwe Hermannea07f622009-06-24 17:31:08 +000034.B "\-n, \-\-noverify"
35Do
36.B not
37verify the flash ROM contents after writing them to the chip. Using this
38option is
39.B not
40recommended, you should only use it if you know what you are doing and you
41feel that the time for verification takes too long.
42.sp
43Typical usage is:
44.B "flashrom -wn file"
45.sp
46This option is only useful in combination with
47.BR \-\-write .
48.TP
Uwe Hermanne74b9f82009-04-10 14:41:29 +000049.B "\-v, \-\-verify <file>"
50Verify the flash ROM contents against the given
51.BR <file> .
Stefan Reinauerde063bf2006-09-21 13:09:22 +000052.TP
Stefan Reinauer261144c2006-07-27 23:29:02 +000053.B "\-E, \-\-erase"
Uwe Hermanne74b9f82009-04-10 14:41:29 +000054Erase the flash ROM chip.
Stefan Reinauerde063bf2006-09-21 13:09:22 +000055.TP
Stefan Reinauer261144c2006-07-27 23:29:02 +000056.B "\-V, \-\-verbose"
57More verbose output.
Stefan Reinauerde063bf2006-09-21 13:09:22 +000058.TP
Stefan Reinauer261144c2006-07-27 23:29:02 +000059.B "\-c, \-\-chip" <chipname>
Uwe Hermann42eb17f2008-01-18 17:48:51 +000060Probe only for specified flash ROM chip.
Uwe Hermann87c07932009-05-05 16:15:46 +000061.sp
62flashrom supports ROM layouts. This allows you to flash certain parts of
63the flash chip only. A ROM layout file looks like follows:
64.sp
65 00000000:00008fff gfxrom
66 00009000:0003ffff normal
67 00040000:0007ffff fallback
68.sp
69 i.e.:
70 startaddr:endaddr name
71.sp
72All addresses are offsets within the file, not absolute addresses!
73If you only want to update the normal image in a ROM you can say:
74.sp
75.B " flashrom -w --layout rom.layout --image normal agami_aruma.rom"
76.sp
77To update normal and fallback but leave the VGA BIOS alone, say:
78.sp
79.B " flashrom -w -l rom.layout -i normal \"
80.br
81.B " -i fallback agami_aruma.rom"
82.sp
83Currently overlapping sections are not supported.
84.sp
Uwe Hermanne8ba5382009-05-22 11:37:27 +000085ROM layouts should replace the \-s and \-e option since they are more
Uwe Hermann87c07932009-05-05 16:15:46 +000086flexible and they should lead to a ROM update file format with the
87ROM layout and the ROM image in one file (cpio, zip or something?).
Stefan Reinauerde063bf2006-09-21 13:09:22 +000088.TP
Peter Stuge6b53fed2008-01-27 16:21:21 +000089.B "\-m, \-\-mainboard" <[vendor:]part>
Uwe Hermann87c07932009-05-05 16:15:46 +000090Override mainboard settings.
91.sp
92flashrom reads the coreboot table to determine the current mainboard. If no
93coreboot table could be read or if you want to override these values, you can
Uwe Hermanne8ba5382009-05-22 11:37:27 +000094specify \-m, e.g.:
Uwe Hermann87c07932009-05-05 16:15:46 +000095.sp
96.B " flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom"
97.sp
Uwe Hermanne8ba5382009-05-22 11:37:27 +000098See the 'Supported mainboards' section in the output of 'flashrom \-L' for
Uwe Hermann87c07932009-05-05 16:15:46 +000099a list of boards which require the specification of the board name, if no
100coreboot table is found.
Stefan Reinauerde063bf2006-09-21 13:09:22 +0000101.TP
Stefan Reinauer261144c2006-07-27 23:29:02 +0000102.B "\-f, \-\-force"
Uwe Hermann67808fe2007-10-18 00:29:05 +0000103Force write without checking whether the ROM image file is really meant
104to be used on this board.
105.sp
Stefan Reinauere3f3e2e2008-01-18 15:33:10 +0000106Note: This check only works while coreboot is running, and only for those
107boards where the coreboot code supports it.
Stefan Reinauerde063bf2006-09-21 13:09:22 +0000108.TP
Uwe Hermanne74b9f82009-04-10 14:41:29 +0000109.B "\-l, \-\-layout <file>"
110Read ROM layout from
111.BR <file> .
Stefan Reinauerde063bf2006-09-21 13:09:22 +0000112.TP
Uwe Hermanne74b9f82009-04-10 14:41:29 +0000113.B "\-i, \-\-image <name>"
Uwe Hermann67808fe2007-10-18 00:29:05 +0000114Only flash image
115.B <name>
116from flash layout.
Stefan Reinauerde063bf2006-09-21 13:09:22 +0000117.TP
Uwe Hermanne5ac1642008-03-12 11:54:51 +0000118.B "\-L, \-\-list\-supported"
Uwe Hermanne8ba5382009-05-22 11:37:27 +0000119List the flash chips, chipsets, mainboards, and PCI card "programmers"
120supported by flashrom.
Uwe Hermanne5ac1642008-03-12 11:54:51 +0000121.sp
Uwe Hermanne8ba5382009-05-22 11:37:27 +0000122There are many unlisted boards which will work out of the box, without
123special support in flashrom. Please let us know if you can verify that
124other boards work or do not work out of the box. For verification you have
125to test an ERASE and/or WRITE operation, so make sure you only do that
126if you have proper means to recover from failure!
Uwe Hermanne5ac1642008-03-12 11:54:51 +0000127.TP
Uwe Hermann20a293f2009-06-19 10:42:43 +0000128.B "\-z, \-\-list\-supported-wiki"
129Same as
130.BR \-\-list\-supported ,
131but outputs the supported hardware in MediaWiki syntax, so that it can be
Stefan Reinauer22ea8cd2009-07-30 13:32:26 +0000132easily pasted into the wiki page at http://www.flashrom.org/.
Uwe Hermann20a293f2009-06-19 10:42:43 +0000133.TP
Carl-Daniel Hailfingerce986772009-05-09 00:27:07 +0000134.B "\-p, \-\-programmer <name>"
135Specify the programmer device. Currently supported are:
136.sp
Uwe Hermann530cb2d2009-05-14 22:58:21 +0000137.BR "* internal" " (default, for in-system flashing in the mainboard)"
138.sp
Uwe Hermannc7e8a0c2009-05-19 14:14:21 +0000139.BR "* dummy" " (just prints all operations and accesses)"
140.sp
Uwe Hermann530cb2d2009-05-14 22:58:21 +0000141.BR "* nic3com" " (for flash ROMs on 3COM network cards)"
142.sp
Uwe Hermann2bc98f62009-09-30 18:29:55 +0000143.BR "* gfxnvidia" " (for flash ROMs on NVIDIA graphics cards)"
144.sp
TURBO Jb0912c02009-09-02 23:00:46 +0000145.BR "* drkaiser" " (for flash ROMs on Dr. Kaiser PC-Waechter PCI cards)"
146.sp
Uwe Hermannc7e8a0c2009-05-19 14:14:21 +0000147.BR "* satasii" " (for flash ROMs on Silicon Image SATA/IDE controllers)"
148.sp
Uwe Hermanne9d04d42009-06-02 19:54:22 +0000149.BR "* it87spi" " (for flash ROMs behind an ITE IT87xx Super I/O LPC/SPI translation unit)"
Carl-Daniel Hailfingerb8afecd2009-05-31 18:00:57 +0000150.sp
Paul Fox05dfbe62009-06-16 21:08:06 +0000151.BR "* ft2232spi" " (for flash ROMs attached to a FT2232H/FT4232H based USB SPI programmer)"
152.sp
Carl-Daniel Hailfingerdfade102009-08-18 23:51:22 +0000153.BR "* serprog" " (for flash ROMs attached to Urja's AVR programmer)"
154.sp
Carl-Daniel Hailfinger3504b532009-06-01 00:02:11 +0000155The dummy programmer has an optional parameter specifying the bus types it
156should support. For that you have to use the
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000157.B "flashrom -p dummy:type"
Carl-Daniel Hailfinger3504b532009-06-01 00:02:11 +0000158syntax where
159.B type
160can be any comma-separated combination of
161.B parallel lpc fwh spi all
162in any order.
163.sp
164Example:
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000165.B "flashrom -p dummy:lpc,fwh"
Carl-Daniel Hailfinger3504b532009-06-01 00:02:11 +0000166.sp
Uwe Hermannc7e8a0c2009-05-19 14:14:21 +0000167If you have multiple supported PCI cards which can program flash chips
168(NICs, SATA/IDE controllers, etc.) in your system, you must use the
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000169.B "flashrom -p xxxx:bb:dd.f"
Uwe Hermannc7e8a0c2009-05-19 14:14:21 +0000170syntax to explicitly select one of them, where
171.B xxxx
172is the name of the programmer
Uwe Hermann530cb2d2009-05-14 22:58:21 +0000173.B bb
174is the PCI bus number,
175.B dd
176is the PCI device number, and
177.B f
178is the PCI function number of the desired NIC.
179.sp
180Example:
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000181.B "flashrom -p nic3com:05:04.0"
Uwe Hermann530cb2d2009-05-14 22:58:21 +0000182.sp
Uwe Hermannc7e8a0c2009-05-19 14:14:21 +0000183Currently the following programmers support this mechanism:
184.BR nic3com ,
Uwe Hermann2bc98f62009-09-30 18:29:55 +0000185.BR gfxnvidia ,
Uwe Hermannc7e8a0c2009-05-19 14:14:21 +0000186.BR satasii .
Carl-Daniel Hailfingerfeea2722009-07-01 00:02:23 +0000187.sp
Carl-Daniel Hailfingerdfade102009-08-18 23:51:22 +0000188The it87spi programmer has an optional parameter which will set the I/O base
189port of the IT87* SPI controller interface to the port specified in the
190parameter. For that you have to use the
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000191.B "flashrom -p it87spi:port=portnum"
Carl-Daniel Hailfingerbb297f72009-07-11 18:05:42 +0000192syntax where
193.B portnum
194is an I/O port number which must be a multiple of 8.
195.sp
Carl-Daniel Hailfingerdfade102009-08-18 23:51:22 +0000196The ft2232spi programmer has an optional parameter specifying the controller
197type and interface/port it should support. For that you have to use the
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000198.B "flashrom -p ft2232spi:model,port=interface"
Carl-Daniel Hailfingerfeea2722009-07-01 00:02:23 +0000199syntax where
200.B model
201can be any of
202.B 2232H 4232H
203and
204.B interface
205can be any of
206.B A
207.BR B .
208The default model is
209.B 4232H
210and the default interface is
211.BR B .
Carl-Daniel Hailfingerdfade102009-08-18 23:51:22 +0000212.sp
213The serprog programmer has an optional parameter specifying either a serial
214device/baud combination or an IP/port combination for communication with the
215programmer. For serial, you have to use the
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000216.B "flashrom -p serprog:/dev/device:baud"
Carl-Daniel Hailfingerdfade102009-08-18 23:51:22 +0000217syntax and for IP, you have to use
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000218.B "flashrom -p serprog:ip:port"
Carl-Daniel Hailfingerdfade102009-08-18 23:51:22 +0000219instead. More information about serprog is available in serprog-protocol.txt in
220the source distribution.
221.sp
222Support for some programmers can be disabled at compile time.
223.B "flashrom -h"
224lists all supported programmers.
Carl-Daniel Hailfingerce986772009-05-09 00:27:07 +0000225.TP
Stefan Reinauer261144c2006-07-27 23:29:02 +0000226.B "\-h, \-\-help"
227Show a help text and exit.
Bernhard Walle201bde32008-01-21 15:24:22 +0000228.TP
229.B "\-R, \-\-version"
230Show version information and exit.
Peter Stuge42688e52009-01-26 02:20:56 +0000231.SH EXIT STATUS
232flashrom exits with 0 on success, 1 on most failures but with 2 if /dev/mem
233(/dev/xsvc on Solaris) can not be opened and with 3 if a call to mmap() fails.
Stefan Reinauer261144c2006-07-27 23:29:02 +0000234.SH BUGS
Uwe Hermann42eb17f2008-01-18 17:48:51 +0000235Please report any bugs at
Stefan Reinauer22ea8cd2009-07-30 13:32:26 +0000236.BR http://www.flashrom.org/trac/flashrom/newticket ","
237or on the flashrom mailing list
238.RB "(" http://www.flashrom.org/mailman/listinfo/flashrom ")."
Stefan Reinauer261144c2006-07-27 23:29:02 +0000239.SH LICENCE
240.B flashrom
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000241is covered by the GNU General Public License (GPL), version 2. Some files are
242additionally available under the GPL (version 2, or any later version).
Stefan Reinauer261144c2006-07-27 23:29:02 +0000243.SH COPYRIGHT
Stefan Reinauer261144c2006-07-27 23:29:02 +0000244.br
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000245Please see the individual files.
Stefan Reinauer261144c2006-07-27 23:29:02 +0000246.SH AUTHORS
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000247Carl-Daniel Hailfinger
248.br
249Claus Gindhart <claus.gindhart@kontron.com>
250.br
251Dominik Geyer <dominik.geyer@kontron.com>
252.br
253Eric Biederman <ebiederman@lnxi.com>
254.br
255Giampiero Giancipoli <gianci@email.it>
256.br
257Joe Bao <Zheng.Bao@amd.com>
258.br
259Luc Verhaegen <libv@skynet.be>
260.br
Carl-Daniel Hailfinger451dc802009-05-01 11:00:39 +0000261Li-Ta Lo
262.br
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000263Markus Boas <ryven@ryven.de>
264.br
265Nikolay Petukhov <nikolay.petukhov@gmail.com>
266.br
267Peter Stuge <peter@stuge.se>
268.br
269Reinder E.N. de Haan <lb_reha@mveas.com>
270.br
271Ronald G. Minnich <rminnich@gmail.com>
272.br
273Ronald Hoogenboom <ronald@zonnet.nl>
Stefan Reinauer261144c2006-07-27 23:29:02 +0000274.br
275Stefan Reinauer <stepan@coresystems.de>
276.br
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000277Stefan Wildemann <stefan.wildemann@kontron.com>
278.br
279Steven James <pyro@linuxlabs.com>
280.br
281Uwe Hermann <uwe@hermann-uwe.de>
282.br
283Wang Qingpei <Qingpei.Wang@amd.com>
284.br
285Yinghai Lu <yinghai.lu@amd.com>
Stefan Reinauerf8337dd2006-08-03 10:49:09 +0000286.br
287some others
Stefan Reinauer261144c2006-07-27 23:29:02 +0000288.PP
Stefan Reinauerde063bf2006-09-21 13:09:22 +0000289This manual page was written by Uwe Hermann <uwe@hermann-uwe.de>.
Uwe Hermann42eb17f2008-01-18 17:48:51 +0000290It is licensed under the terms of the GNU GPL (version 2 or later).