blob: d3cf4d86a7056ecff38a7ff41b150a7071eec816 [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
Michael Karcher31fd8252010-03-12 06:41:39 +000025is that flash info is dumped and the flash chip is set to writable. It is
26recommended that if you try flashrom the first time on a system, you run it
27in probe only mode and check the output. Also you are advised to make a
28backup of your current ROM contents with \-r before you try to write a new
29image.
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>"
Uwe Hermann9d680802009-07-11 22:17:28 +000036Write file into flash ROM.
Stefan Reinauerde063bf2006-09-21 13:09:22 +000037.TP
Uwe Hermannea07f622009-06-24 17:31:08 +000038.B "\-n, \-\-noverify"
39Do
40.B not
41verify the flash ROM contents after writing them to the chip. Using this
42option is
43.B not
44recommended, you should only use it if you know what you are doing and you
45feel that the time for verification takes too long.
46.sp
47Typical usage is:
48.B "flashrom -wn file"
49.sp
50This option is only useful in combination with
51.BR \-\-write .
52.TP
Uwe Hermanne74b9f82009-04-10 14:41:29 +000053.B "\-v, \-\-verify <file>"
54Verify the flash ROM contents against the given
55.BR <file> .
Stefan Reinauerde063bf2006-09-21 13:09:22 +000056.TP
Stefan Reinauer261144c2006-07-27 23:29:02 +000057.B "\-E, \-\-erase"
Uwe Hermanne74b9f82009-04-10 14:41:29 +000058Erase the flash ROM chip.
Stefan Reinauerde063bf2006-09-21 13:09:22 +000059.TP
Stefan Reinauer261144c2006-07-27 23:29:02 +000060.B "\-V, \-\-verbose"
61More verbose output.
Stefan Reinauerde063bf2006-09-21 13:09:22 +000062.TP
Stefan Reinauer261144c2006-07-27 23:29:02 +000063.B "\-c, \-\-chip" <chipname>
Uwe Hermann42eb17f2008-01-18 17:48:51 +000064Probe only for specified flash ROM chip.
Joerg Mayer645c6df2010-03-13 14:47:48 +000065.TP
66.B "\-m, \-\-mainboard" <[vendor:]part>
67Override mainboard settings.
68.sp
69flashrom reads the coreboot table to determine the current mainboard. If no
70coreboot table could be read or if you want to override these values, you can
71specify \-m, e.g.:
72.sp
73.B " flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom"
74.sp
75See the 'Supported mainboards' section in the output of 'flashrom \-L' for
76a list of boards which require the specification of the board name, if no
77coreboot table is found.
78.TP
79.B "\-f, \-\-force"
80Force write without checking whether the ROM image file is really meant
81to be used on this board.
82.sp
83Note: This check only works while coreboot is running, and only for those
84boards where the coreboot code supports it.
85.TP
86.B "\-l, \-\-layout <file>"
87Read ROM layout from
88.BR <file> .
Uwe Hermann87c07932009-05-05 16:15:46 +000089.sp
90flashrom supports ROM layouts. This allows you to flash certain parts of
91the flash chip only. A ROM layout file looks like follows:
92.sp
93 00000000:00008fff gfxrom
94 00009000:0003ffff normal
95 00040000:0007ffff fallback
96.sp
97 i.e.:
98 startaddr:endaddr name
99.sp
100All addresses are offsets within the file, not absolute addresses!
101If you only want to update the normal image in a ROM you can say:
102.sp
103.B " flashrom -w --layout rom.layout --image normal agami_aruma.rom"
104.sp
105To update normal and fallback but leave the VGA BIOS alone, say:
106.sp
107.B " flashrom -w -l rom.layout -i normal \"
108.br
109.B " -i fallback agami_aruma.rom"
110.sp
111Currently overlapping sections are not supported.
112.sp
Uwe Hermanne8ba5382009-05-22 11:37:27 +0000113ROM layouts should replace the \-s and \-e option since they are more
Uwe Hermann87c07932009-05-05 16:15:46 +0000114flexible and they should lead to a ROM update file format with the
115ROM layout and the ROM image in one file (cpio, zip or something?).
Stefan Reinauerde063bf2006-09-21 13:09:22 +0000116.TP
Uwe Hermanne74b9f82009-04-10 14:41:29 +0000117.B "\-i, \-\-image <name>"
Uwe Hermann67808fe2007-10-18 00:29:05 +0000118Only flash image
119.B <name>
120from flash layout.
Stefan Reinauerde063bf2006-09-21 13:09:22 +0000121.TP
Uwe Hermanne5ac1642008-03-12 11:54:51 +0000122.B "\-L, \-\-list\-supported"
Uwe Hermanne8ba5382009-05-22 11:37:27 +0000123List the flash chips, chipsets, mainboards, and PCI card "programmers"
124supported by flashrom.
Uwe Hermanne5ac1642008-03-12 11:54:51 +0000125.sp
Uwe Hermanne8ba5382009-05-22 11:37:27 +0000126There are many unlisted boards which will work out of the box, without
127special support in flashrom. Please let us know if you can verify that
128other boards work or do not work out of the box. For verification you have
129to test an ERASE and/or WRITE operation, so make sure you only do that
130if you have proper means to recover from failure!
Uwe Hermanne5ac1642008-03-12 11:54:51 +0000131.TP
Uwe Hermann20a293f2009-06-19 10:42:43 +0000132.B "\-z, \-\-list\-supported-wiki"
133Same as
134.BR \-\-list\-supported ,
135but outputs the supported hardware in MediaWiki syntax, so that it can be
Stefan Reinauer22ea8cd2009-07-30 13:32:26 +0000136easily pasted into the wiki page at http://www.flashrom.org/.
Uwe Hermann20a293f2009-06-19 10:42:43 +0000137.TP
Michael Karchere5eafb22010-03-07 12:11:08 +0000138.B "\-p, \-\-programmer <name>[:parameters]"
Carl-Daniel Hailfingerce986772009-05-09 00:27:07 +0000139Specify the programmer device. Currently supported are:
140.sp
Uwe Hermann530cb2d2009-05-14 22:58:21 +0000141.BR "* internal" " (default, for in-system flashing in the mainboard)"
142.sp
Uwe Hermannc7e8a0c2009-05-19 14:14:21 +0000143.BR "* dummy" " (just prints all operations and accesses)"
144.sp
Uwe Hermann530cb2d2009-05-14 22:58:21 +0000145.BR "* nic3com" " (for flash ROMs on 3COM network cards)"
146.sp
Uwe Hermann2bc98f62009-09-30 18:29:55 +0000147.BR "* gfxnvidia" " (for flash ROMs on NVIDIA graphics cards)"
148.sp
TURBO Jb0912c02009-09-02 23:00:46 +0000149.BR "* drkaiser" " (for flash ROMs on Dr. Kaiser PC-Waechter PCI cards)"
150.sp
Uwe Hermannc7e8a0c2009-05-19 14:14:21 +0000151.BR "* satasii" " (for flash ROMs on Silicon Image SATA/IDE controllers)"
152.sp
Uwe Hermannddd5c9e2010-02-21 21:17:00 +0000153.BR "* atahpt" " (for flash ROMs on Highpoint ATA/RAID controllers)"
154.sp
Uwe Hermanne9d04d42009-06-02 19:54:22 +0000155.BR "* it87spi" " (for flash ROMs behind an ITE IT87xx Super I/O LPC/SPI translation unit)"
Carl-Daniel Hailfingerb8afecd2009-05-31 18:00:57 +0000156.sp
Paul Fox05dfbe62009-06-16 21:08:06 +0000157.BR "* ft2232spi" " (for flash ROMs attached to a FT2232H/FT4232H based USB SPI programmer)"
158.sp
Carl-Daniel Hailfingerdfade102009-08-18 23:51:22 +0000159.BR "* serprog" " (for flash ROMs attached to Urja's AVR programmer)"
160.sp
Carl-Daniel Hailfingerd5b28fa2009-11-24 18:27:10 +0000161.BR "* buspiratespi" " (for flash ROMs attached to a Bus Pirate)"
162.sp
Michael Karchere5eafb22010-03-07 12:11:08 +0000163Some programmers have optional or mandatory parameters which are described
164in detail in the
165.B PROGRAMMER SPECIFIC INFO
166section. Support for some programmers can be disabled at compile time.
167.B "flashrom -h"
168lists all supported programmers.
169.TP
170.B "\-h, \-\-help"
171Show a help text and exit.
172.TP
173.B "\-R, \-\-version"
174Show version information and exit.
175.SH PROGRAMMER SPECIFIC INFO
176Some programmer drivers accept further parameters to set programmer-specific
177parameters. These parameters are seperated from the programmer name by a
178colon. While some programmers take arguments at fixed positions, other
179programmers use a key/value interface in which the key and value is separated
180by an equal sign and different pairs are separated by a comma or a colon.
181.TP
Michael Karcher7f0c3ec2010-03-07 22:29:28 +0000182.BR "internal " programmer
183Some mainboards require to run mainboard specific code to enable flash erase
184and write support (and probe support on old systems with parallel flash).
185The mainboard brand and model (if it requires specific code) is usually
186autodetected using one of the following mechanisms: If your system is
187running coreboot, the mainboard type is determined from the coreboot table,
188otherwise, the mainboard is detected by examining the onboard PCI devices
189and possibly DMI info. If PCI and DMI do not contain information to uniquely
190identify the mainboard (which is the exception), it might be necessary to
191specify the mainboard using the \-m switch (see above).
192.sp
193Some of these board-specific flash enabling functions (called board enables)
194in flashrom have not yet been tested. If your mainboard is detected needing
195an untested board enable function, a warning message is printed and the
196board enable is not executed, because a wrong board enable function might
197cause the system to behave erratically, as board enable functions touch the
198low-level internals of a mainboard. Not executing a board enable function
199(if one is needed) might cause detection or erasing failure. If your board
200protects only part of the flash (commonly the top end, called boot block),
201flashrom might encounter an error only after erasing the unprotected part,
202so running without the board-enable function might be dangerous for erase
203and write (which includes erase).
204.sp
205The suggested procedure for a mainboard with untested board specific code is
206to first try to probe the ROM (just invoke flashrom and check that it
207detects your flash chip type) without running the board enable code (i.e.
208without any parameters). If it finds your chip, fine, otherwise, retry
209probing your chip with the board-enable code running, using
210.sp
211.B "flashrom -p internal:boardenable=force"
212.sp
213If your chip is still not detected, the board enable code seems to be broken
214or the flash chip unsupported. Otherwise, make a backup of your current ROM
215contents (using \-r) and store it to a medium outside of your computer, like
216an USB drive or a network share. If you needed to run the board enable code
217already for probing, use it for reading too. Now you can try to write the
218new image. You should enable the board enable code in any case now, as it
219has been written because it is known that writing/erasing without the board
220enable is going to fail. In any case (success or failure), please report to
221the flashrom mailing list, see below.
222.sp
Michael Karchere5eafb22010-03-07 12:11:08 +0000223.BR "dummy " programmer
224An optional parameter specifies the bus types it
Carl-Daniel Hailfinger3504b532009-06-01 00:02:11 +0000225should support. For that you have to use the
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000226.B "flashrom -p dummy:type"
Carl-Daniel Hailfinger3504b532009-06-01 00:02:11 +0000227syntax where
228.B type
229can be any comma-separated combination of
230.B parallel lpc fwh spi all
231in any order.
232.sp
233Example:
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000234.B "flashrom -p dummy:lpc,fwh"
Michael Karchere5eafb22010-03-07 12:11:08 +0000235.TP
236.BR "nic3com" , " gfxnvidia" , " satasii" and " atahpt " programmers
237These programmers have an option to specify the PCI address of the card
238your want to use, which must be specified if more than one card supported
239by the selected programmer is installed in your system. The syntax is
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000240.B "flashrom -p xxxx:bb:dd.f"
Michael Karchere5eafb22010-03-07 12:11:08 +0000241, where
Uwe Hermannc7e8a0c2009-05-19 14:14:21 +0000242.B xxxx
243is the name of the programmer
Uwe Hermann530cb2d2009-05-14 22:58:21 +0000244.B bb
245is the PCI bus number,
246.B dd
247is the PCI device number, and
248.B f
249is the PCI function number of the desired NIC.
250.sp
251Example:
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000252.B "flashrom -p nic3com:05:04.0"
Michael Karchere5eafb22010-03-07 12:11:08 +0000253.TP
254.BR "it87spi " programmer
255An optional parameter sets the I/O base port of the IT87* SPI controller
256interface to the port specified in the parameter instead of using the port
257address set by the BIOS. For that you have to use the
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000258.B "flashrom -p it87spi:port=portnum"
Carl-Daniel Hailfingerbb297f72009-07-11 18:05:42 +0000259syntax where
260.B portnum
261is an I/O port number which must be a multiple of 8.
Michael Karchere5eafb22010-03-07 12:11:08 +0000262.TP
263.BR "ft2232spi " programmer
264An optional parameter species the controller
Carl-Daniel Hailfingerdfade102009-08-18 23:51:22 +0000265type and interface/port it should support. For that you have to use the
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000266.B "flashrom -p ft2232spi:model,port=interface"
Carl-Daniel Hailfingerfeea2722009-07-01 00:02:23 +0000267syntax where
268.B model
269can be any of
270.B 2232H 4232H
271and
272.B interface
273can be any of
Michael Karchere5eafb22010-03-07 12:11:08 +0000274.BR "A B" .
Carl-Daniel Hailfingerfeea2722009-07-01 00:02:23 +0000275The default model is
276.B 4232H
277and the default interface is
278.BR B .
Michael Karchere5eafb22010-03-07 12:11:08 +0000279.TP
280.BR "serprog " programmer
281A mandatory parameter specifies either a serial
Carl-Daniel Hailfingerdfade102009-08-18 23:51:22 +0000282device/baud combination or an IP/port combination for communication with the
Michael Karchere5eafb22010-03-07 12:11:08 +0000283programmer. In the device/baud combination, the device has to start with a
284slash. For serial, you have to use the
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000285.B "flashrom -p serprog:/dev/device:baud"
Carl-Daniel Hailfingerdfade102009-08-18 23:51:22 +0000286syntax and for IP, you have to use
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000287.B "flashrom -p serprog:ip:port"
Carl-Daniel Hailfingerdfade102009-08-18 23:51:22 +0000288instead. More information about serprog is available in serprog-protocol.txt in
289the source distribution.
Michael Karchere5eafb22010-03-07 12:11:08 +0000290.TP
291.BR "buspiratespi " programmer
292A required dev parameter specifyies the Bus Pirate device node and an optional
293spispeed parameter specifyies the frequency of the SPI bus. The parameter
294delimiter is a comma. Syntax is
Carl-Daniel Hailfingerdfade102009-08-18 23:51:22 +0000295.sp
Carl-Daniel Hailfingerd5b28fa2009-11-24 18:27:10 +0000296.B "flashrom -p buspiratespi:dev=/dev/device,spispeed=frequency"
Michael Karchere5eafb22010-03-07 12:11:08 +0000297.sp
Carl-Daniel Hailfingerd5b28fa2009-11-24 18:27:10 +0000298where
299.B frequency
300can be any of
301.B 30k 125k 250k 1M 2M 2.6M 4M 8M
Michael Karchere5eafb22010-03-07 12:11:08 +0000302(in Hz). The default is the maximum frequency of 8 MHz.
Peter Stuge42688e52009-01-26 02:20:56 +0000303.SH EXIT STATUS
304flashrom exits with 0 on success, 1 on most failures but with 2 if /dev/mem
305(/dev/xsvc on Solaris) can not be opened and with 3 if a call to mmap() fails.
Stefan Reinauer261144c2006-07-27 23:29:02 +0000306.SH BUGS
Uwe Hermann42eb17f2008-01-18 17:48:51 +0000307Please report any bugs at
Stefan Reinauer22ea8cd2009-07-30 13:32:26 +0000308.BR http://www.flashrom.org/trac/flashrom/newticket ","
309or on the flashrom mailing list
310.RB "(" http://www.flashrom.org/mailman/listinfo/flashrom ")."
Stefan Reinauer261144c2006-07-27 23:29:02 +0000311.SH LICENCE
312.B flashrom
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000313is covered by the GNU General Public License (GPL), version 2. Some files are
314additionally available under the GPL (version 2, or any later version).
Stefan Reinauer261144c2006-07-27 23:29:02 +0000315.SH COPYRIGHT
Stefan Reinauer261144c2006-07-27 23:29:02 +0000316.br
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000317Please see the individual files.
Stefan Reinauer261144c2006-07-27 23:29:02 +0000318.SH AUTHORS
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000319Carl-Daniel Hailfinger
320.br
321Claus Gindhart <claus.gindhart@kontron.com>
322.br
323Dominik Geyer <dominik.geyer@kontron.com>
324.br
Stefan Reinaueredc61882010-01-03 14:40:30 +0000325Eric Biederman
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000326.br
327Giampiero Giancipoli <gianci@email.it>
328.br
329Joe Bao <Zheng.Bao@amd.com>
330.br
331Luc Verhaegen <libv@skynet.be>
332.br
Carl-Daniel Hailfinger451dc802009-05-01 11:00:39 +0000333Li-Ta Lo
334.br
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000335Markus Boas <ryven@ryven.de>
336.br
337Nikolay Petukhov <nikolay.petukhov@gmail.com>
338.br
339Peter Stuge <peter@stuge.se>
340.br
341Reinder E.N. de Haan <lb_reha@mveas.com>
342.br
343Ronald G. Minnich <rminnich@gmail.com>
344.br
345Ronald Hoogenboom <ronald@zonnet.nl>
Stefan Reinauer261144c2006-07-27 23:29:02 +0000346.br
347Stefan Reinauer <stepan@coresystems.de>
348.br
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000349Stefan Wildemann <stefan.wildemann@kontron.com>
350.br
351Steven James <pyro@linuxlabs.com>
352.br
353Uwe Hermann <uwe@hermann-uwe.de>
354.br
Stefan Reinaueredc61882010-01-03 14:40:30 +0000355Wang Qingpei
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000356.br
Stefan Reinaueredc61882010-01-03 14:40:30 +0000357Yinghai Lu
Stefan Reinauerf8337dd2006-08-03 10:49:09 +0000358.br
359some others
Stefan Reinauer261144c2006-07-27 23:29:02 +0000360.PP
Stefan Reinauerde063bf2006-09-21 13:09:22 +0000361This manual page was written by Uwe Hermann <uwe@hermann-uwe.de>.
Uwe Hermann42eb17f2008-01-18 17:48:51 +0000362It is licensed under the terms of the GNU GPL (version 2 or later).