Uwe Hermann | e8ba538 | 2009-05-22 11:37:27 +0000 | [diff] [blame] | 1 | .TH FLASHROM 8 "May 21, 2009" |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 2 | .SH NAME |
Uwe Hermann | 530cb2d | 2009-05-14 22:58:21 +0000 | [diff] [blame] | 3 | flashrom \- detect, read, write, verify and erase flash chips |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 4 | .SH SYNOPSIS |
Uwe Hermann | 530cb2d | 2009-05-14 22:58:21 +0000 | [diff] [blame] | 5 | .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 Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 8 | .SH DESCRIPTION |
| 9 | .B flashrom |
Uwe Hermann | e8ba538 | 2009-05-22 11:37:27 +0000 | [diff] [blame] | 10 | is a utility for detecting, reading, writing, verifying and erasing flash |
Uwe Hermann | 530cb2d | 2009-05-14 22:58:21 +0000 | [diff] [blame] | 11 | chips. It's often used to flash BIOS/EFI/coreboot/firmware images in-system |
| 12 | using a supported mainboard, but it also supports flashing of network cards |
| 13 | (NICs), SATA controller cards, and other external devices which can program |
| 14 | flash chips. |
Uwe Hermann | e74b9f8 | 2009-04-10 14:41:29 +0000 | [diff] [blame] | 15 | .PP |
Uwe Hermann | d42009c | 2009-04-11 13:59:00 +0000 | [diff] [blame] | 16 | It supports a wide range of DIP32, PLCC32, DIP8, SO8/SOIC8, TSOP32, and |
| 17 | TSOP40 chips, which use various protocols such as LPC, FWH, parallel flash, |
| 18 | or SPI. |
Uwe Hermann | e74b9f8 | 2009-04-10 14:41:29 +0000 | [diff] [blame] | 19 | .PP |
Uwe Hermann | 42eb17f | 2008-01-18 17:48:51 +0000 | [diff] [blame] | 20 | (see |
| 21 | .B http://coreboot.org |
| 22 | for details on coreboot) |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 23 | .SH OPTIONS |
Carl-Daniel Hailfinger | 5de9341 | 2009-05-01 10:53:49 +0000 | [diff] [blame] | 24 | Please note that the command line interface for flashrom will change before |
| 25 | flashrom 1.0. Do not use flashrom in scripts or other automated tools without |
Uwe Hermann | e8ba538 | 2009-05-22 11:37:27 +0000 | [diff] [blame] | 26 | checking that your flashrom version won't interpret options in a different way. |
Carl-Daniel Hailfinger | 5de9341 | 2009-05-01 10:53:49 +0000 | [diff] [blame] | 27 | .PP |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 28 | If no file is specified, then all that happens |
| 29 | is that flash info is dumped and the flash chip is set to writable. |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 30 | .TP |
Uwe Hermann | e74b9f8 | 2009-04-10 14:41:29 +0000 | [diff] [blame] | 31 | .B "\-r, \-\-read <file>" |
| 32 | Read flash ROM contents and save them into the given |
| 33 | .BR <file> . |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 34 | .TP |
Uwe Hermann | e74b9f8 | 2009-04-10 14:41:29 +0000 | [diff] [blame] | 35 | .B "\-w, \-\-write <file>" |
| 36 | Write file into flash ROM (default when |
| 37 | .B <file> |
| 38 | is specified). |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 39 | .TP |
Uwe Hermann | e74b9f8 | 2009-04-10 14:41:29 +0000 | [diff] [blame] | 40 | .B "\-v, \-\-verify <file>" |
| 41 | Verify the flash ROM contents against the given |
| 42 | .BR <file> . |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 43 | .TP |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 44 | .B "\-E, \-\-erase" |
Uwe Hermann | e74b9f8 | 2009-04-10 14:41:29 +0000 | [diff] [blame] | 45 | Erase the flash ROM chip. |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 46 | .TP |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 47 | .B "\-V, \-\-verbose" |
| 48 | More verbose output. |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 49 | .TP |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 50 | .B "\-c, \-\-chip" <chipname> |
Uwe Hermann | 42eb17f | 2008-01-18 17:48:51 +0000 | [diff] [blame] | 51 | Probe only for specified flash ROM chip. |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 52 | .TP |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 53 | .B "\-s, \-\-estart" <addr> |
Uwe Hermann | 42eb17f | 2008-01-18 17:48:51 +0000 | [diff] [blame] | 54 | Exclude start position (obsolete). |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 55 | .sp |
| 56 | flashrom supports ROM layouts. This allows you to flash certain parts of |
| 57 | the 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 |
| 66 | All addresses are offsets within the file, not absolute addresses! |
| 67 | If 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 |
| 71 | To 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 |
| 77 | Currently overlapping sections are not supported. |
| 78 | .sp |
Uwe Hermann | e8ba538 | 2009-05-22 11:37:27 +0000 | [diff] [blame] | 79 | ROM layouts should replace the \-s and \-e option since they are more |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 80 | flexible and they should lead to a ROM update file format with the |
| 81 | ROM layout and the ROM image in one file (cpio, zip or something?). |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 82 | .TP |
Stefan Reinauer | f8337dd | 2006-08-03 10:49:09 +0000 | [diff] [blame] | 83 | .B "\-e, \-\-eend" <addr> |
Uwe Hermann | 42eb17f | 2008-01-18 17:48:51 +0000 | [diff] [blame] | 84 | Exclude end postion (obsolete). |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 85 | .TP |
Peter Stuge | 6b53fed | 2008-01-27 16:21:21 +0000 | [diff] [blame] | 86 | .B "\-m, \-\-mainboard" <[vendor:]part> |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 87 | Override mainboard settings. |
| 88 | .sp |
| 89 | flashrom reads the coreboot table to determine the current mainboard. If no |
| 90 | coreboot table could be read or if you want to override these values, you can |
Uwe Hermann | e8ba538 | 2009-05-22 11:37:27 +0000 | [diff] [blame] | 91 | specify \-m, e.g.: |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 92 | .sp |
| 93 | .B " flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom" |
| 94 | .sp |
Uwe Hermann | e8ba538 | 2009-05-22 11:37:27 +0000 | [diff] [blame] | 95 | See the 'Supported mainboards' section in the output of 'flashrom \-L' for |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 96 | a list of boards which require the specification of the board name, if no |
| 97 | coreboot table is found. |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 98 | .TP |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 99 | .B "\-f, \-\-force" |
Uwe Hermann | 67808fe | 2007-10-18 00:29:05 +0000 | [diff] [blame] | 100 | Force write without checking whether the ROM image file is really meant |
| 101 | to be used on this board. |
| 102 | .sp |
Stefan Reinauer | e3f3e2e | 2008-01-18 15:33:10 +0000 | [diff] [blame] | 103 | Note: This check only works while coreboot is running, and only for those |
| 104 | boards where the coreboot code supports it. |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 105 | .TP |
Uwe Hermann | e74b9f8 | 2009-04-10 14:41:29 +0000 | [diff] [blame] | 106 | .B "\-l, \-\-layout <file>" |
| 107 | Read ROM layout from |
| 108 | .BR <file> . |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 109 | .TP |
Uwe Hermann | e74b9f8 | 2009-04-10 14:41:29 +0000 | [diff] [blame] | 110 | .B "\-i, \-\-image <name>" |
Uwe Hermann | 67808fe | 2007-10-18 00:29:05 +0000 | [diff] [blame] | 111 | Only flash image |
| 112 | .B <name> |
| 113 | from flash layout. |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 114 | .TP |
Uwe Hermann | e5ac164 | 2008-03-12 11:54:51 +0000 | [diff] [blame] | 115 | .B "\-L, \-\-list\-supported" |
Uwe Hermann | e8ba538 | 2009-05-22 11:37:27 +0000 | [diff] [blame] | 116 | List the flash chips, chipsets, mainboards, and PCI card "programmers" |
| 117 | supported by flashrom. |
Uwe Hermann | e5ac164 | 2008-03-12 11:54:51 +0000 | [diff] [blame] | 118 | .sp |
Uwe Hermann | e8ba538 | 2009-05-22 11:37:27 +0000 | [diff] [blame] | 119 | There are many unlisted boards which will work out of the box, without |
| 120 | special support in flashrom. Please let us know if you can verify that |
| 121 | other boards work or do not work out of the box. For verification you have |
| 122 | to test an ERASE and/or WRITE operation, so make sure you only do that |
| 123 | if you have proper means to recover from failure! |
Uwe Hermann | e5ac164 | 2008-03-12 11:54:51 +0000 | [diff] [blame] | 124 | .TP |
Carl-Daniel Hailfinger | ce98677 | 2009-05-09 00:27:07 +0000 | [diff] [blame] | 125 | .B "\-p, \-\-programmer <name>" |
| 126 | Specify the programmer device. Currently supported are: |
| 127 | .sp |
Uwe Hermann | 530cb2d | 2009-05-14 22:58:21 +0000 | [diff] [blame] | 128 | .BR "* internal" " (default, for in-system flashing in the mainboard)" |
| 129 | .sp |
Uwe Hermann | c7e8a0c | 2009-05-19 14:14:21 +0000 | [diff] [blame] | 130 | .BR "* dummy" " (just prints all operations and accesses)" |
| 131 | .sp |
Uwe Hermann | 530cb2d | 2009-05-14 22:58:21 +0000 | [diff] [blame] | 132 | .BR "* nic3com" " (for flash ROMs on 3COM network cards)" |
| 133 | .sp |
Uwe Hermann | c7e8a0c | 2009-05-19 14:14:21 +0000 | [diff] [blame] | 134 | .BR "* satasii" " (for flash ROMs on Silicon Image SATA/IDE controllers)" |
| 135 | .sp |
Carl-Daniel Hailfinger | b8afecd | 2009-05-31 18:00:57 +0000 | [diff] [blame] | 136 | .BR "* it87spi" " (for flash ROMs behind a IT87xx SuperI/O LPC/SPI translation unit)" |
| 137 | .sp |
Carl-Daniel Hailfinger | 3504b53 | 2009-06-01 00:02:11 +0000 | [diff] [blame^] | 138 | The dummy programmer has an optional parameter specifying the bus types it |
| 139 | should support. For that you have to use the |
| 140 | .B "flashrom -p dummy=type" |
| 141 | syntax where |
| 142 | .B type |
| 143 | can be any comma-separated combination of |
| 144 | .B parallel lpc fwh spi all |
| 145 | in any order. |
| 146 | .sp |
| 147 | Example: |
| 148 | .B "flashrom -p dummy=lpc,fwh" |
| 149 | .sp |
Uwe Hermann | c7e8a0c | 2009-05-19 14:14:21 +0000 | [diff] [blame] | 150 | If you have multiple supported PCI cards which can program flash chips |
| 151 | (NICs, SATA/IDE controllers, etc.) in your system, you must use the |
| 152 | .B "flashrom -p xxxx=bb:dd.f" |
| 153 | syntax to explicitly select one of them, where |
| 154 | .B xxxx |
| 155 | is the name of the programmer |
Uwe Hermann | 530cb2d | 2009-05-14 22:58:21 +0000 | [diff] [blame] | 156 | .B bb |
| 157 | is the PCI bus number, |
| 158 | .B dd |
| 159 | is the PCI device number, and |
| 160 | .B f |
| 161 | is the PCI function number of the desired NIC. |
| 162 | .sp |
| 163 | Example: |
| 164 | .B "flashrom -p nic3com=05:04.0" |
| 165 | .sp |
Uwe Hermann | c7e8a0c | 2009-05-19 14:14:21 +0000 | [diff] [blame] | 166 | Currently the following programmers support this mechanism: |
| 167 | .BR nic3com , |
| 168 | .BR satasii . |
Carl-Daniel Hailfinger | ce98677 | 2009-05-09 00:27:07 +0000 | [diff] [blame] | 169 | .TP |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 170 | .B "\-h, \-\-help" |
| 171 | Show a help text and exit. |
Bernhard Walle | 201bde3 | 2008-01-21 15:24:22 +0000 | [diff] [blame] | 172 | .TP |
| 173 | .B "\-R, \-\-version" |
| 174 | Show version information and exit. |
Peter Stuge | 42688e5 | 2009-01-26 02:20:56 +0000 | [diff] [blame] | 175 | .SH EXIT STATUS |
| 176 | flashrom exits with 0 on success, 1 on most failures but with 2 if /dev/mem |
| 177 | (/dev/xsvc on Solaris) can not be opened and with 3 if a call to mmap() fails. |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 178 | .SH BUGS |
Uwe Hermann | 42eb17f | 2008-01-18 17:48:51 +0000 | [diff] [blame] | 179 | Please report any bugs at |
| 180 | .BR http://tracker.coreboot.org/trac/coreboot/newticket "," |
| 181 | or on the coreboot mailing list |
| 182 | .RB "(" http://coreboot.org/Mailinglist ")." |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 183 | .SH LICENCE |
| 184 | .B flashrom |
Carl-Daniel Hailfinger | 851ecf2 | 2009-01-08 04:56:59 +0000 | [diff] [blame] | 185 | is covered by the GNU General Public License (GPL), version 2. Some files are |
| 186 | additionally available under the GPL (version 2, or any later version). |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 187 | .SH COPYRIGHT |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 188 | .br |
Carl-Daniel Hailfinger | 851ecf2 | 2009-01-08 04:56:59 +0000 | [diff] [blame] | 189 | Please see the individual files. |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 190 | .SH AUTHORS |
Carl-Daniel Hailfinger | 851ecf2 | 2009-01-08 04:56:59 +0000 | [diff] [blame] | 191 | Carl-Daniel Hailfinger |
| 192 | .br |
| 193 | Claus Gindhart <claus.gindhart@kontron.com> |
| 194 | .br |
| 195 | Dominik Geyer <dominik.geyer@kontron.com> |
| 196 | .br |
| 197 | Eric Biederman <ebiederman@lnxi.com> |
| 198 | .br |
| 199 | Giampiero Giancipoli <gianci@email.it> |
| 200 | .br |
| 201 | Joe Bao <Zheng.Bao@amd.com> |
| 202 | .br |
| 203 | Luc Verhaegen <libv@skynet.be> |
| 204 | .br |
Carl-Daniel Hailfinger | 451dc80 | 2009-05-01 11:00:39 +0000 | [diff] [blame] | 205 | Li-Ta Lo |
| 206 | .br |
Carl-Daniel Hailfinger | 851ecf2 | 2009-01-08 04:56:59 +0000 | [diff] [blame] | 207 | Markus Boas <ryven@ryven.de> |
| 208 | .br |
| 209 | Nikolay Petukhov <nikolay.petukhov@gmail.com> |
| 210 | .br |
| 211 | Peter Stuge <peter@stuge.se> |
| 212 | .br |
| 213 | Reinder E.N. de Haan <lb_reha@mveas.com> |
| 214 | .br |
| 215 | Ronald G. Minnich <rminnich@gmail.com> |
| 216 | .br |
| 217 | Ronald Hoogenboom <ronald@zonnet.nl> |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 218 | .br |
| 219 | Stefan Reinauer <stepan@coresystems.de> |
| 220 | .br |
Carl-Daniel Hailfinger | 851ecf2 | 2009-01-08 04:56:59 +0000 | [diff] [blame] | 221 | Stefan Wildemann <stefan.wildemann@kontron.com> |
| 222 | .br |
| 223 | Steven James <pyro@linuxlabs.com> |
| 224 | .br |
| 225 | Uwe Hermann <uwe@hermann-uwe.de> |
| 226 | .br |
| 227 | Wang Qingpei <Qingpei.Wang@amd.com> |
| 228 | .br |
| 229 | Yinghai Lu <yinghai.lu@amd.com> |
Stefan Reinauer | f8337dd | 2006-08-03 10:49:09 +0000 | [diff] [blame] | 230 | .br |
| 231 | some others |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 232 | .PP |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 233 | This manual page was written by Uwe Hermann <uwe@hermann-uwe.de>. |
Uwe Hermann | 42eb17f | 2008-01-18 17:48:51 +0000 | [diff] [blame] | 234 | It is licensed under the terms of the GNU GPL (version 2 or later). |