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 | ea07f62 | 2009-06-24 17:31:08 +0000 | [diff] [blame] | 5 | .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 Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 7 | .SH DESCRIPTION |
| 8 | .B flashrom |
Uwe Hermann | e8ba538 | 2009-05-22 11:37:27 +0000 | [diff] [blame] | 9 | is a utility for detecting, reading, writing, verifying and erasing flash |
Uwe Hermann | 530cb2d | 2009-05-14 22:58:21 +0000 | [diff] [blame] | 10 | chips. It's often used to flash BIOS/EFI/coreboot/firmware images in-system |
| 11 | using a supported mainboard, but it also supports flashing of network cards |
| 12 | (NICs), SATA controller cards, and other external devices which can program |
| 13 | flash chips. |
Uwe Hermann | e74b9f8 | 2009-04-10 14:41:29 +0000 | [diff] [blame] | 14 | .PP |
Uwe Hermann | d42009c | 2009-04-11 13:59:00 +0000 | [diff] [blame] | 15 | It supports a wide range of DIP32, PLCC32, DIP8, SO8/SOIC8, TSOP32, and |
| 16 | TSOP40 chips, which use various protocols such as LPC, FWH, parallel flash, |
| 17 | or SPI. |
Uwe Hermann | e74b9f8 | 2009-04-10 14:41:29 +0000 | [diff] [blame] | 18 | .PP |
Uwe Hermann | 42eb17f | 2008-01-18 17:48:51 +0000 | [diff] [blame] | 19 | (see |
| 20 | .B http://coreboot.org |
| 21 | for details on coreboot) |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 22 | .SH OPTIONS |
Carl-Daniel Hailfinger | 5de9341 | 2009-05-01 10:53:49 +0000 | [diff] [blame] | 23 | Please note that the command line interface for flashrom will change before |
| 24 | 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] | 25 | 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] | 26 | .PP |
Uwe Hermann | 1432a60 | 2009-06-28 23:26:37 +0000 | [diff] [blame] | 27 | You can specify one of \-E, \-r, \-w, \-v or no operation. |
Carl-Daniel Hailfinger | 01d6aba | 2009-06-12 14:02:07 +0000 | [diff] [blame] | 28 | If no operation is specified, then all that happens |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 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>" |
Uwe Hermann | 9d68080 | 2009-07-11 22:17:28 +0000 | [diff] [blame] | 36 | Write file into flash ROM. |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 37 | .TP |
Uwe Hermann | ea07f62 | 2009-06-24 17:31:08 +0000 | [diff] [blame] | 38 | .B "\-n, \-\-noverify" |
| 39 | Do |
| 40 | .B not |
| 41 | verify the flash ROM contents after writing them to the chip. Using this |
| 42 | option is |
| 43 | .B not |
| 44 | recommended, you should only use it if you know what you are doing and you |
| 45 | feel that the time for verification takes too long. |
| 46 | .sp |
| 47 | Typical usage is: |
| 48 | .B "flashrom -wn file" |
| 49 | .sp |
| 50 | This option is only useful in combination with |
| 51 | .BR \-\-write . |
| 52 | .TP |
Uwe Hermann | e74b9f8 | 2009-04-10 14:41:29 +0000 | [diff] [blame] | 53 | .B "\-v, \-\-verify <file>" |
| 54 | Verify the flash ROM contents against the given |
| 55 | .BR <file> . |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 56 | .TP |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 57 | .B "\-E, \-\-erase" |
Uwe Hermann | e74b9f8 | 2009-04-10 14:41:29 +0000 | [diff] [blame] | 58 | Erase the flash ROM chip. |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 59 | .TP |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 60 | .B "\-V, \-\-verbose" |
| 61 | More verbose output. |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 62 | .TP |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 63 | .B "\-c, \-\-chip" <chipname> |
Uwe Hermann | 42eb17f | 2008-01-18 17:48:51 +0000 | [diff] [blame] | 64 | Probe only for specified flash ROM chip. |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 65 | .sp |
| 66 | flashrom supports ROM layouts. This allows you to flash certain parts of |
| 67 | the flash chip only. A ROM layout file looks like follows: |
| 68 | .sp |
| 69 | 00000000:00008fff gfxrom |
| 70 | 00009000:0003ffff normal |
| 71 | 00040000:0007ffff fallback |
| 72 | .sp |
| 73 | i.e.: |
| 74 | startaddr:endaddr name |
| 75 | .sp |
| 76 | All addresses are offsets within the file, not absolute addresses! |
| 77 | If you only want to update the normal image in a ROM you can say: |
| 78 | .sp |
| 79 | .B " flashrom -w --layout rom.layout --image normal agami_aruma.rom" |
| 80 | .sp |
| 81 | To update normal and fallback but leave the VGA BIOS alone, say: |
| 82 | .sp |
| 83 | .B " flashrom -w -l rom.layout -i normal \" |
| 84 | .br |
| 85 | .B " -i fallback agami_aruma.rom" |
| 86 | .sp |
| 87 | Currently overlapping sections are not supported. |
| 88 | .sp |
Uwe Hermann | e8ba538 | 2009-05-22 11:37:27 +0000 | [diff] [blame] | 89 | 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] | 90 | flexible and they should lead to a ROM update file format with the |
| 91 | 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] | 92 | .TP |
Peter Stuge | 6b53fed | 2008-01-27 16:21:21 +0000 | [diff] [blame] | 93 | .B "\-m, \-\-mainboard" <[vendor:]part> |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 94 | Override mainboard settings. |
| 95 | .sp |
| 96 | flashrom reads the coreboot table to determine the current mainboard. If no |
| 97 | 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] | 98 | specify \-m, e.g.: |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 99 | .sp |
| 100 | .B " flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom" |
| 101 | .sp |
Uwe Hermann | e8ba538 | 2009-05-22 11:37:27 +0000 | [diff] [blame] | 102 | See the 'Supported mainboards' section in the output of 'flashrom \-L' for |
Uwe Hermann | 87c0793 | 2009-05-05 16:15:46 +0000 | [diff] [blame] | 103 | a list of boards which require the specification of the board name, if no |
| 104 | coreboot table is found. |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 105 | .TP |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 106 | .B "\-f, \-\-force" |
Uwe Hermann | 67808fe | 2007-10-18 00:29:05 +0000 | [diff] [blame] | 107 | Force write without checking whether the ROM image file is really meant |
| 108 | to be used on this board. |
| 109 | .sp |
Stefan Reinauer | e3f3e2e | 2008-01-18 15:33:10 +0000 | [diff] [blame] | 110 | Note: This check only works while coreboot is running, and only for those |
| 111 | boards where the coreboot code supports it. |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 112 | .TP |
Uwe Hermann | e74b9f8 | 2009-04-10 14:41:29 +0000 | [diff] [blame] | 113 | .B "\-l, \-\-layout <file>" |
| 114 | Read ROM layout from |
| 115 | .BR <file> . |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 116 | .TP |
Uwe Hermann | e74b9f8 | 2009-04-10 14:41:29 +0000 | [diff] [blame] | 117 | .B "\-i, \-\-image <name>" |
Uwe Hermann | 67808fe | 2007-10-18 00:29:05 +0000 | [diff] [blame] | 118 | Only flash image |
| 119 | .B <name> |
| 120 | from flash layout. |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 121 | .TP |
Uwe Hermann | e5ac164 | 2008-03-12 11:54:51 +0000 | [diff] [blame] | 122 | .B "\-L, \-\-list\-supported" |
Uwe Hermann | e8ba538 | 2009-05-22 11:37:27 +0000 | [diff] [blame] | 123 | List the flash chips, chipsets, mainboards, and PCI card "programmers" |
| 124 | supported by flashrom. |
Uwe Hermann | e5ac164 | 2008-03-12 11:54:51 +0000 | [diff] [blame] | 125 | .sp |
Uwe Hermann | e8ba538 | 2009-05-22 11:37:27 +0000 | [diff] [blame] | 126 | There are many unlisted boards which will work out of the box, without |
| 127 | special support in flashrom. Please let us know if you can verify that |
| 128 | other boards work or do not work out of the box. For verification you have |
| 129 | to test an ERASE and/or WRITE operation, so make sure you only do that |
| 130 | if you have proper means to recover from failure! |
Uwe Hermann | e5ac164 | 2008-03-12 11:54:51 +0000 | [diff] [blame] | 131 | .TP |
Uwe Hermann | 20a293f | 2009-06-19 10:42:43 +0000 | [diff] [blame] | 132 | .B "\-z, \-\-list\-supported-wiki" |
| 133 | Same as |
| 134 | .BR \-\-list\-supported , |
| 135 | but outputs the supported hardware in MediaWiki syntax, so that it can be |
| 136 | easily pasted into the wiki page at http://coreboot.org/Flashrom. |
| 137 | .TP |
Carl-Daniel Hailfinger | ce98677 | 2009-05-09 00:27:07 +0000 | [diff] [blame] | 138 | .B "\-p, \-\-programmer <name>" |
| 139 | Specify the programmer device. Currently supported are: |
| 140 | .sp |
Uwe Hermann | 530cb2d | 2009-05-14 22:58:21 +0000 | [diff] [blame] | 141 | .BR "* internal" " (default, for in-system flashing in the mainboard)" |
| 142 | .sp |
Uwe Hermann | c7e8a0c | 2009-05-19 14:14:21 +0000 | [diff] [blame] | 143 | .BR "* dummy" " (just prints all operations and accesses)" |
| 144 | .sp |
Uwe Hermann | 530cb2d | 2009-05-14 22:58:21 +0000 | [diff] [blame] | 145 | .BR "* nic3com" " (for flash ROMs on 3COM network cards)" |
| 146 | .sp |
Uwe Hermann | c7e8a0c | 2009-05-19 14:14:21 +0000 | [diff] [blame] | 147 | .BR "* satasii" " (for flash ROMs on Silicon Image SATA/IDE controllers)" |
| 148 | .sp |
Uwe Hermann | e9d04d4 | 2009-06-02 19:54:22 +0000 | [diff] [blame] | 149 | .BR "* it87spi" " (for flash ROMs behind an ITE IT87xx Super I/O LPC/SPI translation unit)" |
Carl-Daniel Hailfinger | b8afecd | 2009-05-31 18:00:57 +0000 | [diff] [blame] | 150 | .sp |
Paul Fox | 05dfbe6 | 2009-06-16 21:08:06 +0000 | [diff] [blame] | 151 | .BR "* ft2232spi" " (for flash ROMs attached to a FT2232H/FT4232H based USB SPI programmer)" |
| 152 | .sp |
Carl-Daniel Hailfinger | 3504b53 | 2009-06-01 00:02:11 +0000 | [diff] [blame] | 153 | The dummy programmer has an optional parameter specifying the bus types it |
| 154 | should support. For that you have to use the |
| 155 | .B "flashrom -p dummy=type" |
| 156 | syntax where |
| 157 | .B type |
| 158 | can be any comma-separated combination of |
| 159 | .B parallel lpc fwh spi all |
| 160 | in any order. |
| 161 | .sp |
| 162 | Example: |
| 163 | .B "flashrom -p dummy=lpc,fwh" |
| 164 | .sp |
Uwe Hermann | c7e8a0c | 2009-05-19 14:14:21 +0000 | [diff] [blame] | 165 | If you have multiple supported PCI cards which can program flash chips |
| 166 | (NICs, SATA/IDE controllers, etc.) in your system, you must use the |
| 167 | .B "flashrom -p xxxx=bb:dd.f" |
| 168 | syntax to explicitly select one of them, where |
| 169 | .B xxxx |
| 170 | is the name of the programmer |
Uwe Hermann | 530cb2d | 2009-05-14 22:58:21 +0000 | [diff] [blame] | 171 | .B bb |
| 172 | is the PCI bus number, |
| 173 | .B dd |
| 174 | is the PCI device number, and |
| 175 | .B f |
| 176 | is the PCI function number of the desired NIC. |
| 177 | .sp |
| 178 | Example: |
| 179 | .B "flashrom -p nic3com=05:04.0" |
| 180 | .sp |
Uwe Hermann | c7e8a0c | 2009-05-19 14:14:21 +0000 | [diff] [blame] | 181 | Currently the following programmers support this mechanism: |
| 182 | .BR nic3com , |
| 183 | .BR satasii . |
Carl-Daniel Hailfinger | feea272 | 2009-07-01 00:02:23 +0000 | [diff] [blame] | 184 | .sp |
Carl-Daniel Hailfinger | bb297f7 | 2009-07-11 18:05:42 +0000 | [diff] [blame] | 185 | The it87spi has an optional parameter which will set the I/O base port of the |
| 186 | IT87* SPI controller interface to the port specified in the parameter. |
| 187 | For that you have to use the |
| 188 | .B "flashrom -p it87spi=port=portnum" |
| 189 | syntax where |
| 190 | .B portnum |
| 191 | is an I/O port number which must be a multiple of 8. |
| 192 | .sp |
Carl-Daniel Hailfinger | feea272 | 2009-07-01 00:02:23 +0000 | [diff] [blame] | 193 | The ft2232spi has an optional parameter specifying the controller type and |
| 194 | interface/port it should support. For that you have to use the |
| 195 | .B "flashrom -p ft2232spi=model,port=interface" |
| 196 | syntax where |
| 197 | .B model |
| 198 | can be any of |
| 199 | .B 2232H 4232H |
| 200 | and |
| 201 | .B interface |
| 202 | can be any of |
| 203 | .B A |
| 204 | .BR B . |
| 205 | The default model is |
| 206 | .B 4232H |
| 207 | and the default interface is |
| 208 | .BR B . |
Carl-Daniel Hailfinger | ce98677 | 2009-05-09 00:27:07 +0000 | [diff] [blame] | 209 | .TP |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 210 | .B "\-h, \-\-help" |
| 211 | Show a help text and exit. |
Bernhard Walle | 201bde3 | 2008-01-21 15:24:22 +0000 | [diff] [blame] | 212 | .TP |
| 213 | .B "\-R, \-\-version" |
| 214 | Show version information and exit. |
Peter Stuge | 42688e5 | 2009-01-26 02:20:56 +0000 | [diff] [blame] | 215 | .SH EXIT STATUS |
| 216 | flashrom exits with 0 on success, 1 on most failures but with 2 if /dev/mem |
| 217 | (/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] | 218 | .SH BUGS |
Uwe Hermann | 42eb17f | 2008-01-18 17:48:51 +0000 | [diff] [blame] | 219 | Please report any bugs at |
| 220 | .BR http://tracker.coreboot.org/trac/coreboot/newticket "," |
| 221 | or on the coreboot mailing list |
| 222 | .RB "(" http://coreboot.org/Mailinglist ")." |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 223 | .SH LICENCE |
| 224 | .B flashrom |
Carl-Daniel Hailfinger | 851ecf2 | 2009-01-08 04:56:59 +0000 | [diff] [blame] | 225 | is covered by the GNU General Public License (GPL), version 2. Some files are |
| 226 | additionally available under the GPL (version 2, or any later version). |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 227 | .SH COPYRIGHT |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 228 | .br |
Carl-Daniel Hailfinger | 851ecf2 | 2009-01-08 04:56:59 +0000 | [diff] [blame] | 229 | Please see the individual files. |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 230 | .SH AUTHORS |
Carl-Daniel Hailfinger | 851ecf2 | 2009-01-08 04:56:59 +0000 | [diff] [blame] | 231 | Carl-Daniel Hailfinger |
| 232 | .br |
| 233 | Claus Gindhart <claus.gindhart@kontron.com> |
| 234 | .br |
| 235 | Dominik Geyer <dominik.geyer@kontron.com> |
| 236 | .br |
| 237 | Eric Biederman <ebiederman@lnxi.com> |
| 238 | .br |
| 239 | Giampiero Giancipoli <gianci@email.it> |
| 240 | .br |
| 241 | Joe Bao <Zheng.Bao@amd.com> |
| 242 | .br |
| 243 | Luc Verhaegen <libv@skynet.be> |
| 244 | .br |
Carl-Daniel Hailfinger | 451dc80 | 2009-05-01 11:00:39 +0000 | [diff] [blame] | 245 | Li-Ta Lo |
| 246 | .br |
Carl-Daniel Hailfinger | 851ecf2 | 2009-01-08 04:56:59 +0000 | [diff] [blame] | 247 | Markus Boas <ryven@ryven.de> |
| 248 | .br |
| 249 | Nikolay Petukhov <nikolay.petukhov@gmail.com> |
| 250 | .br |
| 251 | Peter Stuge <peter@stuge.se> |
| 252 | .br |
| 253 | Reinder E.N. de Haan <lb_reha@mveas.com> |
| 254 | .br |
| 255 | Ronald G. Minnich <rminnich@gmail.com> |
| 256 | .br |
| 257 | Ronald Hoogenboom <ronald@zonnet.nl> |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 258 | .br |
| 259 | Stefan Reinauer <stepan@coresystems.de> |
| 260 | .br |
Carl-Daniel Hailfinger | 851ecf2 | 2009-01-08 04:56:59 +0000 | [diff] [blame] | 261 | Stefan Wildemann <stefan.wildemann@kontron.com> |
| 262 | .br |
| 263 | Steven James <pyro@linuxlabs.com> |
| 264 | .br |
| 265 | Uwe Hermann <uwe@hermann-uwe.de> |
| 266 | .br |
| 267 | Wang Qingpei <Qingpei.Wang@amd.com> |
| 268 | .br |
| 269 | Yinghai Lu <yinghai.lu@amd.com> |
Stefan Reinauer | f8337dd | 2006-08-03 10:49:09 +0000 | [diff] [blame] | 270 | .br |
| 271 | some others |
Stefan Reinauer | 261144c | 2006-07-27 23:29:02 +0000 | [diff] [blame] | 272 | .PP |
Stefan Reinauer | de063bf | 2006-09-21 13:09:22 +0000 | [diff] [blame] | 273 | This manual page was written by Uwe Hermann <uwe@hermann-uwe.de>. |
Uwe Hermann | 42eb17f | 2008-01-18 17:48:51 +0000 | [diff] [blame] | 274 | It is licensed under the terms of the GNU GPL (version 2 or later). |