blob: 47e77d65b5e7b308ebc9f2b4b7b7fcd10546ba27 [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
Uwe Hermann4e3d0b32010-03-25 23:18:41 +0000177parameters. These parameters are separated from the programmer name by a
Michael Karchere5eafb22010-03-07 12:11:08 +0000178colon. 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
Carl-Daniel Hailfinger01f3ef42010-03-25 02:50:40 +0000223If your mainboard uses an ITE IT87 series Super I/O for LPC<->SPI flash bus
224translation, flashrom should autodetect that configuration. You can use
225.B "flashrom -p internal:it87spiport=portnum"
226syntax as explained in the
227.B it87spi
228programmer section to use a non-default port for controlling the IT87 series
229Super I/O. In the unlikely case flashrom doesn't detect an active IT87 LPC<->SPI
230bridge, you can try to force recognition by using the it87spi programmer.
231.TP
Michael Karchere5eafb22010-03-07 12:11:08 +0000232.BR "dummy " programmer
233An optional parameter specifies the bus types it
Carl-Daniel Hailfinger3504b532009-06-01 00:02:11 +0000234should support. For that you have to use the
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000235.B "flashrom -p dummy:type"
Carl-Daniel Hailfinger3504b532009-06-01 00:02:11 +0000236syntax where
237.B type
238can be any comma-separated combination of
239.B parallel lpc fwh spi all
240in any order.
241.sp
242Example:
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000243.B "flashrom -p dummy:lpc,fwh"
Michael Karchere5eafb22010-03-07 12:11:08 +0000244.TP
Carl-Daniel Hailfinger01f3ef42010-03-25 02:50:40 +0000245.BR "nic3com" , " gfxnvidia" , " satasii " and " atahpt " programmers
Michael Karchere5eafb22010-03-07 12:11:08 +0000246These programmers have an option to specify the PCI address of the card
247your want to use, which must be specified if more than one card supported
248by the selected programmer is installed in your system. The syntax is
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000249.B "flashrom -p xxxx:bb:dd.f"
Michael Karchere5eafb22010-03-07 12:11:08 +0000250, where
Uwe Hermannc7e8a0c2009-05-19 14:14:21 +0000251.B xxxx
252is the name of the programmer
Uwe Hermann530cb2d2009-05-14 22:58:21 +0000253.B bb
254is the PCI bus number,
255.B dd
256is the PCI device number, and
257.B f
258is the PCI function number of the desired NIC.
259.sp
260Example:
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000261.B "flashrom -p nic3com:05:04.0"
Michael Karchere5eafb22010-03-07 12:11:08 +0000262.TP
263.BR "it87spi " programmer
264An optional parameter sets the I/O base port of the IT87* SPI controller
265interface to the port specified in the parameter instead of using the port
266address set by the BIOS. For that you have to use the
Carl-Daniel Hailfinger01f3ef42010-03-25 02:50:40 +0000267.B "flashrom -p it87spi:it87spiport=portnum"
Carl-Daniel Hailfingerbb297f72009-07-11 18:05:42 +0000268syntax where
269.B portnum
270is an I/O port number which must be a multiple of 8.
Michael Karchere5eafb22010-03-07 12:11:08 +0000271.TP
272.BR "ft2232spi " programmer
273An optional parameter species the controller
Carl-Daniel Hailfingerdfade102009-08-18 23:51:22 +0000274type and interface/port it should support. For that you have to use the
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000275.B "flashrom -p ft2232spi:model,port=interface"
Carl-Daniel Hailfingerfeea2722009-07-01 00:02:23 +0000276syntax where
277.B model
278can be any of
279.B 2232H 4232H
280and
281.B interface
282can be any of
Michael Karchere5eafb22010-03-07 12:11:08 +0000283.BR "A B" .
Carl-Daniel Hailfingerfeea2722009-07-01 00:02:23 +0000284The default model is
285.B 4232H
286and the default interface is
287.BR B .
Michael Karchere5eafb22010-03-07 12:11:08 +0000288.TP
289.BR "serprog " programmer
290A mandatory parameter specifies either a serial
Carl-Daniel Hailfingerdfade102009-08-18 23:51:22 +0000291device/baud combination or an IP/port combination for communication with the
Michael Karchere5eafb22010-03-07 12:11:08 +0000292programmer. In the device/baud combination, the device has to start with a
293slash. For serial, you have to use the
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000294.B "flashrom -p serprog:/dev/device:baud"
Carl-Daniel Hailfingerdfade102009-08-18 23:51:22 +0000295syntax and for IP, you have to use
Carl-Daniel Hailfinger664e7ad2009-08-19 15:03:28 +0000296.B "flashrom -p serprog:ip:port"
Carl-Daniel Hailfingerdfade102009-08-18 23:51:22 +0000297instead. More information about serprog is available in serprog-protocol.txt in
298the source distribution.
Michael Karchere5eafb22010-03-07 12:11:08 +0000299.TP
300.BR "buspiratespi " programmer
Uwe Hermann4e3d0b32010-03-25 23:18:41 +0000301A required dev parameter specifies the Bus Pirate device node and an optional
302spispeed parameter specifies the frequency of the SPI bus. The parameter
Michael Karchere5eafb22010-03-07 12:11:08 +0000303delimiter is a comma. Syntax is
Carl-Daniel Hailfingerdfade102009-08-18 23:51:22 +0000304.sp
Carl-Daniel Hailfingerd5b28fa2009-11-24 18:27:10 +0000305.B "flashrom -p buspiratespi:dev=/dev/device,spispeed=frequency"
Michael Karchere5eafb22010-03-07 12:11:08 +0000306.sp
Carl-Daniel Hailfingerd5b28fa2009-11-24 18:27:10 +0000307where
308.B frequency
309can be any of
310.B 30k 125k 250k 1M 2M 2.6M 4M 8M
Michael Karchere5eafb22010-03-07 12:11:08 +0000311(in Hz). The default is the maximum frequency of 8 MHz.
Peter Stuge42688e52009-01-26 02:20:56 +0000312.SH EXIT STATUS
313flashrom exits with 0 on success, 1 on most failures but with 2 if /dev/mem
314(/dev/xsvc on Solaris) can not be opened and with 3 if a call to mmap() fails.
Stefan Reinauer261144c2006-07-27 23:29:02 +0000315.SH BUGS
Uwe Hermann42eb17f2008-01-18 17:48:51 +0000316Please report any bugs at
Stefan Reinauer22ea8cd2009-07-30 13:32:26 +0000317.BR http://www.flashrom.org/trac/flashrom/newticket ","
318or on the flashrom mailing list
319.RB "(" http://www.flashrom.org/mailman/listinfo/flashrom ")."
Stefan Reinauer261144c2006-07-27 23:29:02 +0000320.SH LICENCE
321.B flashrom
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000322is covered by the GNU General Public License (GPL), version 2. Some files are
323additionally available under the GPL (version 2, or any later version).
Stefan Reinauer261144c2006-07-27 23:29:02 +0000324.SH COPYRIGHT
Stefan Reinauer261144c2006-07-27 23:29:02 +0000325.br
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000326Please see the individual files.
Stefan Reinauer261144c2006-07-27 23:29:02 +0000327.SH AUTHORS
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000328Carl-Daniel Hailfinger
329.br
330Claus Gindhart <claus.gindhart@kontron.com>
331.br
332Dominik Geyer <dominik.geyer@kontron.com>
333.br
Stefan Reinaueredc61882010-01-03 14:40:30 +0000334Eric Biederman
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000335.br
336Giampiero Giancipoli <gianci@email.it>
337.br
338Joe Bao <Zheng.Bao@amd.com>
339.br
340Luc Verhaegen <libv@skynet.be>
341.br
Carl-Daniel Hailfinger451dc802009-05-01 11:00:39 +0000342Li-Ta Lo
343.br
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000344Markus Boas <ryven@ryven.de>
345.br
346Nikolay Petukhov <nikolay.petukhov@gmail.com>
347.br
348Peter Stuge <peter@stuge.se>
349.br
350Reinder E.N. de Haan <lb_reha@mveas.com>
351.br
352Ronald G. Minnich <rminnich@gmail.com>
353.br
354Ronald Hoogenboom <ronald@zonnet.nl>
Stefan Reinauer261144c2006-07-27 23:29:02 +0000355.br
356Stefan Reinauer <stepan@coresystems.de>
357.br
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000358Stefan Wildemann <stefan.wildemann@kontron.com>
359.br
360Steven James <pyro@linuxlabs.com>
361.br
362Uwe Hermann <uwe@hermann-uwe.de>
363.br
Stefan Reinaueredc61882010-01-03 14:40:30 +0000364Wang Qingpei
Carl-Daniel Hailfinger851ecf22009-01-08 04:56:59 +0000365.br
Stefan Reinaueredc61882010-01-03 14:40:30 +0000366Yinghai Lu
Stefan Reinauerf8337dd2006-08-03 10:49:09 +0000367.br
368some others
Stefan Reinauer261144c2006-07-27 23:29:02 +0000369.PP
Stefan Reinauerde063bf2006-09-21 13:09:22 +0000370This manual page was written by Uwe Hermann <uwe@hermann-uwe.de>.
Uwe Hermann42eb17f2008-01-18 17:48:51 +0000371It is licensed under the terms of the GNU GPL (version 2 or later).