1FLASHROM(8)                 System Manager's Manual                FLASHROM(8)
2
3
4

NAME

6       flashrom - detect, read, write, verify and erase flash chips
7

SYNOPSIS

9       flashrom [-n] [-V] [-f] [-h|-R|-L|-z|-E|-r <file>|-w <file>|-v <file>]
10                [-c <chipname>] [-m [<vendor>:]<board>] [-l <file>]
11                [-i <image>] [-p <programmername>[:<parameters>]]
12

DESCRIPTION

14       flashrom  is  a  utility for detecting, reading, writing, verifying and
15       erasing  flash  chips.  It's  often  used   to   flash   BIOS/EFI/core‐
16       boot/firmware images in-system using a supported mainboard. However, it
17       also supports various external PCI/USB/parallel-port/serial-port  based
18       devices  which  can  program  flash chips, including some network cards
19       (NICs), SATA/IDE controller  cards,  graphics  cards,  the  Bus  Pirate
20       device, various FTDI FT2232/FT4232H based USB devices, and more.
21
22       It  supports  a  wide  range of DIP32, PLCC32, DIP8, SO8/SOIC8, TSOP32,
23       TSOP40, TSOP48, and BGA chips, which use various protocols such as LPC,
24       FWH, parallel flash, or SPI.
25

OPTIONS

27       IMPORTANT:  Please  note  that  the command line interface for flashrom
28       will change before flashrom 1.0. Do not  use  flashrom  in  scripts  or
29       other automated tools without checking that your flashrom version won't
30       interpret options in a different way.
31
32       You can specify one of -h, -R, -L, -z, -E, -r, -w, -v or no  operation.
33       If no operation is specified, flashrom will only probe for flash chips.
34       It is recommended that if you try flashrom the first time on a  system,
35       you  run  it  in  probe-only  mode  and  check the output. Also you are
36       advised to make a backup of your current ROM contents  with  -r  before
37       you try to write a new image.
38
39       -r, --read <file>
40              Read flash ROM contents and save them into the given <file>.  If
41              the file already exists, it will be overwritten.
42
43       -w, --write <file>
44              Write <file> into flash ROM. This will first automatically erase
45              the chip, then write to it.
46
47              In the process the chip is also read several times. First an in-
48              memory backup is made for disaster recovery and to  be  able  to
49              skip regions that are already equal to the image file. This copy
50              is updated along with the write  operation.  In  case  of  erase
51              errors it is even re-read completely. After writing has finished
52              and if verification is enabled, the whole flash chip is read out
53              and compared with the input image.
54
55       -n, --noverify
56              Skip  the  automatic  verification  of  flash ROM contents after
57              writing. Using this option is not recommended, you  should  only
58              use  it  if you know what you are doing and if you feel that the
59              time for verification takes too long.
60
61              Typical usage is: flashrom -n -w <file>
62
63              This option is only useful in combination with --write.
64
65       -v, --verify <file>
66              Verify the flash ROM contents against the given <file>.
67
68       -E, --erase
69              Erase the flash ROM chip.
70
71       -V, --verbose
72              More verbose output. This option can be supplied multiple  times
73              (max. 3 times, i.e.  -VVV) for even more debug output.
74
75       -c, --chip <chipname>
76              Probe  only  for the specified flash ROM chip. This option takes
77              the chip name as printed by flashrom -L without the vendor  name
78              as parameter. Please note that the chip name is case sensitive.
79
80       -m, --mainboard [<vendor>:]<board>
81              Override mainboard settings.
82
83              flashrom reads the coreboot table to determine the current main‐
84              board. If no coreboot table could be read  or  if  you  want  to
85              override these values, you can specify -m, e.g.:
86
87                flashrom --mainboard AGAMI:ARUMA -w agami_aruma.rom
88
89              See  the 'Known boards' or 'Known laptops' section in the output
90              of 'flashrom -L' for a list of boards which require the specifi‐
91              cation of the board name, if no coreboot table is found.
92
93       -f, --force
94              Force one or more of the following actions:
95
96              * Force chip read and pretend the chip is there.
97
98              *  Force chip access even if the chip is bigger than the maximum
99              supported size for the flash bus.
100
101              * Force erase even if erase is known bad.
102
103              * Force write even if write is known bad.
104
105       -l, --layout <file>
106              Read ROM layout from <file>.
107
108              flashrom supports ROM layouts. This allows you to flash  certain
109              parts  of the flash chip only. A ROM layout file looks like fol‐
110              lows:
111
112                00000000:00008fff gfxrom
113                00009000:0003ffff normal
114                00040000:0007ffff fallback
115
116                i.e.:
117                startaddr:endaddr name
118
119              All  addresses  are  offsets  within  the  file,  not   absolute
120              addresses!  If you only want to update the normal image in a ROM
121              you can say:
122
123                flashrom --layout rom.layout --image normal -w agami_aruma.rom
124
125              To update normal and fallback but leave the VGA BIOS alone, say:
126
127                flashrom -l rom.layout -i normal
128                         -i fallback -w agami_aruma.rom
129
130              Currently overlapping sections are not supported.
131
132       -i, --image <name>
133              Only flash image <name> from flash layout.
134
135       -L, --list-supported
136              List the flash chips, chipsets, mainboards,  and  external  pro‐
137              grammers  (including  PCI,  USB,  parallel port, and serial port
138              based devices) supported by flashrom.
139
140              There are many unlisted boards which will work out of  the  box,
141              without  special  support in flashrom. Please let us know if you
142              can verify that other boards work or do not work out of the box.
143
144              IMPORTANT: For verification you have to  test  an  ERASE  and/or
145              WRITE  operation,  so  make  sure  you  only do that if you have
146              proper means to recover from failure!
147
148       -z, --list-supported-wiki
149              Same as --list-supported, but outputs the supported hardware  in
150              MediaWiki  syntax, so that it can be easily pasted into the wiki
151              page at http://www.flashrom.org/.  Please  note  that  MediaWiki
152              output is not compiled in by default.
153
154       -p, --programmer <name>[:parameter[,parameter[,parameter]]]
155              Specify the programmer device. Currently supported are:
156
157              * internal (default, for in-system flashing in the mainboard)
158
159              * dummy (virtual programmer for testing flashrom)
160
161              * nic3com (for flash ROMs on 3COM network cards)
162
163              * nicrealtek (for flash ROMs on Realtek network cards)
164
165              *  nicsmc1211 (for flash ROMs on RTL8139-compatible SMC2 network
166              cards)
167
168              * nicnatsemi (for flash ROMs on  National  Semiconductor  DP838*
169              network cards)
170
171              *  nicintel (for parallel flash ROMs on Intel 10/100Mbit network
172              cards)
173
174              * gfxnvidia (for flash ROMs on NVIDIA graphics cards)
175
176              * drkaiser (for flash ROMs on Dr. Kaiser PC-Waechter PCI cards)
177
178              * satasii (for flash ROMs on Silicon Image SATA/IDE controllers)
179
180              * satamv (for flash ROMs on Marvell SATA controllers)
181
182              * atahpt (for flash ROMs on Highpoint ATA/RAID controllers)
183
184              * ft2232_spi (for SPI flash ROMs attached to  an  FT2232/FT4232H
185              family  based USB SPI programmer), including the DLP Design DLP-
186              USB1232H, FTDI FT2232H Mini-Module,  FTDI  FT4232H  Mini-Module,
187              openbiosprog-spi,  Amontec  JTAGkey/JTAGkey-tiny/JTAGkey-2, Dan‐
188              gerous Prototypes Bus Blaster,  Olimex  ARM-USB-TINY/-H,  Olimex
189              ARM-USB-OCD/-H,   TIAO/DIYGADGET   USB   Multi-Protocol  Adapter
190              (TUMPA), and GOEPEL PicoTAP.
191
192              * serprog (for flash ROMs attached to a programmer speaking ser‐
193              prog),  including  AVR  flasher by Urja Rannikko, AVR flasher by
194              eightdot, Arduino Mega  flasher  by  fritz,  InSystemFlasher  by
195              Juhana Helovuo, and atmegaXXu2-flasher by Stefan Tauner.
196
197              * buspirate_spi (for SPI flash ROMs attached to a Bus Pirate)
198
199              * dediprog (for SPI flash ROMs attached to a Dediprog SF100)
200
201              *  rayer_spi  (for SPI flash ROMs attached to a RayeR parport or
202              Xilinx DLC5 compatible cable)
203
204              * nicintel_spi (for SPI flash  ROMs  on  Intel  Gigabit  network
205              cards)
206
207              *  ogp_spi (for SPI flash ROMs on Open Graphics Project graphics
208              card)
209
210              Some programmers have optional or mandatory parameters which are
211              described  in  detail  in  the PROGRAMMER SPECIFIC INFO section.
212              Support for some programmers can be disabled  at  compile  time.
213              flashrom -h lists all supported programmers.
214
215       -h, --help
216              Show a help text and exit.
217
218       -R, --version
219              Show version information and exit.
220

PROGRAMMER SPECIFIC INFO

222       Some  programmer  drivers  accept further parameters to set programmer-
223       specific parameters. These parameters are separated from the programmer
224       name  by  a colon. While some programmers take arguments at fixed posi‐
225       tions, other programmers use a key/value interface in which the key and
226       value  is  separated by an equal sign and different pairs are separated
227       by a comma or a colon.
228
229       internal programmer
230              Some mainboards require to run mainboard specific code to enable
231              flash  erase and write support (and probe support on old systems
232              with parallel flash).  The mainboard  brand  and  model  (if  it
233              requires specific code) is usually autodetected using one of the
234              following mechanisms: If your system is  running  coreboot,  the
235              mainboard  type  is  determined from the coreboot table.  Other‐
236              wise, the mainboard is detected by  examining  the  onboard  PCI
237              devices  and  possibly  DMI  info. If PCI and DMI do not contain
238              information to uniquely identify the  mainboard  (which  is  the
239              exception), it might be necessary to specify the mainboard using
240              the -m switch (see above).
241
242              Some of these board-specific flash  enabling  functions  (called
243              board  enables)  in  flashrom  have not yet been tested. If your
244              mainboard is detected needing an untested board enable function,
245              a  warning  message  is printed and the board enable is not exe‐
246              cuted, because a wrong board enable  function  might  cause  the
247              system  to  behave  erratically, as board enable functions touch
248              the low-level internals of a mainboard. Not  executing  a  board
249              enable  function  (if  one  is  needed) might cause detection or
250              erasing failure. If your board protects only part of  the  flash
251              (commonly  the  top  end,  called  boot  block),  flashrom might
252              encounter an error only after erasing the unprotected  part,  so
253              running without the board-enable function might be dangerous for
254              erase and write (which includes erase).
255
256              The suggested procedure for a mainboard with untested board spe‐
257              cific  code  is  to  first  try  to  probe  the ROM (just invoke
258              flashrom and check that it detects your flash chip type) without
259              running the board enable code (i.e.  without any parameters). If
260              it finds your chip, fine. Otherwise,  retry  probing  your  chip
261              with the board-enable code running, using
262
263                flashrom -p internal:boardenable=force
264
265              If  your chip is still not detected, the board enable code seems
266              to be broken or the flash chip unsupported.  Otherwise,  make  a
267              backup of your current ROM contents (using -r) and store it to a
268              medium outside of your computer, like a USB drive or  a  network
269              share.  If  you  needed to run the board enable code already for
270              probing, use it for reading too. Now you can try  to  write  the
271              new  image.  You should enable the board enable code in any case
272              now, as it has been written  because  it  is  known  that  writ‐
273              ing/erasing  without  the  board enable is going to fail. In any
274              case (success or failure), please report to the flashrom mailing
275              list, see below.
276
277              On systems running coreboot, flashrom checks whether the desired
278              image matches your mainboard. This needs some special  board  ID
279              to  be present in the image.  If flashrom detects that the image
280              you want to write and the current board do not  match,  it  will
281              refuse to write the image unless you specify
282
283                flashrom -p internal:boardmismatch=force
284
285              If  your  mainboard  uses  an  ITE  IT87  series  Super  I/O for
286              LPC<->SPI flash bus translation, flashrom should autodetect that
287              configuration.  If you want to set the I/O base port of the IT87
288              series SPI controller manually instead of using the  value  pro‐
289              vided by the BIOS, use the
290
291                flashrom -p internal:it87spiport=portnum
292
293              syntax  where portnum is the I/O port number (must be a multiple
294              of 8). In the unlikely case flashrom doesn't  detect  an  active
295              IT87  LPC<->SPI bridge, please send a bug report so we can diag‐
296              nose the problem.
297
298              If you have an Intel chipset with an ICH6 or  later  southbridge
299              and  if  you want to set specific IDSEL values for a non-default
300              flash chip or an embedded controller (EC), you can use the
301
302                flashrom -p internal:fwh_idsel=value
303
304              syntax where value is the 48-bit hexadecimal  raw  value  to  be
305              written  in  the  IDSEL  registers of the Intel southbridge. The
306              upper 32 bits use one hex digit each per 512  kB  range  between
307              0xffc00000  and  0xffffffff,  and  the lower 16 bits use one hex
308              digit each per 1024 kB range between 0xff400000 and  0xff7fffff.
309              The  rightmost  hex  digit  corresponds  with the lowest address
310              range. All address ranges have a corresponding sister range 4 MB
311              below  with identical IDSEL settings. The default value for ICH7
312              is given in the example below.
313
314              Example: flashrom -p internal:fwh_idsel=0x001122334567
315
316              Using flashrom on laptops is dangerous and may easily make  your
317              hardware unusable (see also the BUGS section). The embedded con‐
318              troller (EC) in these machines often interacts badly with flash‐
319              ing.   http://www.flashrom.org/Laptops  has more information. If
320              flash is shared with the EC, erase is guaranteed to  brick  your
321              laptop and write is very likely to brick your laptop.  Chip read
322              and probe may irritate your EC and cause fan failure,  backlight
323              failure,  sudden  poweroff,  and  other nasty effects.  flashrom
324              will attempt to detect laptops and abort immediately for  safety
325              reasons.  If you want to proceed anyway at your own risk, use
326
327                flashrom -p internal:laptop=force_I_want_a_brick
328
329              You have been warned.
330
331              We  will  not help you if you force flashing on a laptop because
332              this is a really dumb idea.
333
334       dummy programmer
335              The dummy programmer operates on a buffer  in  memory  only.  It
336              provides a safe and fast way to test various aspects of flashrom
337              and is mainly used in development and while debugging.
338
339              It is able to emulate some chips  to  a  certain  degree  (basic
340              identify/read/erase/write operations work).
341
342              An optional parameter specifies the bus types it should support.
343              For that you have to use the
344
345                flashrom -p dummy:bus=[type[+type[+type]]]
346
347              syntax where type can be parallel, lpc, fwh, spi in  any  order.
348              If you specify bus without type, all buses will be disabled.  If
349              you do not specify bus, all buses will be enabled.
350
351              Example: flashrom -p dummy:bus=lpc+fwh
352
353              The dummy programmer supports flash chip emulation for automated
354              self-tests  without  hardware  access.  If you want to emulate a
355              flash chip, use the
356
357                flashrom -p dummy:emulate=chip
358
359              syntax where chip is one of the following chips (please  specify
360              only the chip name, not the vendor):
361
362              * ST M25P10.RES SPI flash chip (RES, page write)
363
364              * SST SST25VF040.REMS SPI flash chip (REMS, byte write)
365
366              * SST SST25VF032B SPI flash chip (RDID, AAI write)
367
368              Example: flashrom -p dummy:emulate=SST25VF040.REMS
369
370              If  you  use  flash  chip  emulation, flash image persistence is
371              available as well by using the
372
373                flashrom -p dummy:emulate=chip,image=image.rom
374
375              syntax where image.rom is the file where the simulated chip con‐
376              tents  are  read on flashrom startup and where the chip contents
377              on flashrom shutdown are written to.
378
379              Example: flashrom -p dummy:emulate=M25P10.RES,image=dummy.bin
380
381              If you use SPI flash chip emulation for a  chip  which  supports
382              SPI  page write with the default opcode, you can set the maximum
383              allowed write chunk size with the
384
385                flashrom -p dummy:emulate=chip,spi_write_256_chunksize=size
386
387              syntax where size is the number of bytes (min. 1, max. 256).
388
389              Example:
390
391                flashrom -p dummy:emulate=M25P10.RES,spi_write_256_chunksize=5
392
393       nic3com, nicrealtek, nicsmc1211,  nicnatsemi,  nicintel,  nicintel_spi,
394       gfxnvidia, ogp_spi, drkaiser, satasii, satamv, and atahpt programmers
395              These  programmers  have an option to specify the PCI address of
396              the card your want to use, which must be specified if more  than
397              one  card  supported  by the selected programmer is installed in
398              your system. The syntax is
399
400                flashrom -p xxxx:pci=bb:dd.f,
401
402              where xxxx is the name of the programmer bb is the PCI bus  num‐
403              ber, dd is the PCI device number, and f is the PCI function num‐
404              ber of the desired device.
405
406              Example: flashrom -p nic3com:pci=05:04.0
407
408       ft2232_spi programmer
409              An optional parameter specifies the controller type  and  inter‐
410              face/port it should support. For that you have to use the
411
412                flashrom -p ft2232_spi:type=model,port=interface
413
414              syntax  where  model  can  be 2232H, 4232H, jtagkey, busblaster,
415              openmoko, arm-usb-tiny,  arm-usb-tiny-h,  arm-usb-ocd,  arm-usb-
416              ocd-h,  tumpa,  or  picotap  and  interface can be A, or B.  The
417              default model is 4232H and the default interface is B.
418
419       serprog programmer
420              A mandatory parameter specifies either a serial device/baud com‐
421              bination  or  an  IP/port combination for communication with the
422              programmer. In the device/baud combination, the  device  has  to
423              start with a slash. For serial, you have to use the
424
425                flashrom -p serprog:dev=/dev/device:baud
426
427              syntax and for IP, you have to use
428
429                flashrom -p serprog:ip=ipaddr:port
430
431              instead. More information about serprog is available in serprog-
432              protocol.txt in the source distribution.
433
434       buspirate_spi programmer
435              A required dev parameter specifies the Bus  Pirate  device  node
436              and  an  optional  spispeed parameter specifies the frequency of
437              the SPI bus. The parameter delimiter is a comma. Syntax is
438
439                flashrom -p buspirate_spi:dev=/dev/device,spispeed=frequency
440
441              where frequency can be 30k, 125k, 250k, 1M, 2M, 2.6M, 4M  or  8M
442              (in Hz). The default is the maximum frequency of 8 MHz.
443
444       dediprog programmer
445              An optional voltage parameter specifies the voltage the Dediprog
446              should use. The default unit is Volt if no  unit  is  specified.
447              You  can  use mV, milliVolt, V or Volt as unit specifier. Syntax
448              is
449
450                flashrom -p dediprog:voltage=value
451
452              where value can be 0V, 1.8V, 2.5V, 3.5V or the equivalent in mV.
453
454       rayer_spi programmer
455              The default I/O base address used for the parallel port is 0x378
456              and  you  can  use  the  optional iobase parameter to specify an
457              alternate base I/O address with the
458
459                flashrom -p rayer_spi:iobase=baseaddr
460
461              syntax where baseaddr is base I/O port address of  the  parallel
462              port,  which must be a multiple of four. Make sure to not forget
463              the "0x" prefix for hexadecimal port addresses.
464
465              The default cable type is the  RayeR  cable.  You  can  use  the
466              optional type parameter to specify the cable type with the
467
468                flashrom -p rayer_spi:type=model
469
470              syntax  where  model  can be rayer for the RayeR cable or xilinx
471              for the Xilinx Parallel Cable III (DLC 5).
472
473              More information  about  the  RayeR  hardware  is  available  at
474              http://rayer.ic.cz/elektro/spipgm.htm  .   The  schematic of the
475              Xilinx DLC 5  was  published  at  http://www.xilinx.com/itp/xil
476              inx4/data/docs/pac/appendixb.html .
477
478       ogp_spi programmer
479              The  flash  ROM  chip  to  access must be specified with the rom
480              parameter.
481
482                flashrom -p ogp_spi:rom=name
483
484              Where name is either cprom or s3 for the configuration  ROM  and
485              bprom  or bios for the BIOS ROM. If more than one card supported
486              by the ogp_spi programmer is installed in your system, you  have
487              to  specify the PCI address of the card you want to use with the
488              pci= parameter as explained in the nic3com section above.
489
490              More  information   about   the   hardware   is   available   at
491              http://wiki.opengraphics.org.
492

EXIT STATUS

494       flashrom  exits  with  0  on  success, 1 on most failures but with 2 if
495       /dev/mem (/dev/xsvc on Solaris) can not be opened and with 3 if a  call
496       to mmap() fails.
497

REQUIREMENTS

499       flashrom needs different access permissions for different programmers.
500
501       internal  needs  raw memory access, PCI configuration space access, raw
502       I/O port access (x86) and MSR access (x86).
503
504       nic3com, nicrealtek, nicsmc1211 and nicnatsemi need  PCI  configuration
505       space read access and raw I/O port access.
506
507       atahpt needs PCI configuration space access and raw I/O port access.
508
509       gfxnvidia and drkaiser need PCI configuration space access and raw mem‐
510       ory access.
511
512       rayer_spi needs raw I/O port access.
513
514       satasii needs PCI  configuration  space  read  access  and  raw  memory
515       access.
516
517       satamv  needs  PCI configuration space read access, raw I/O port access
518       and raw memory access.
519
520       serprog needs TCP access to the network or userspace access to a serial
521       port.
522
523       buspirate_spi needs userspace access to a serial port.
524
525       dediprog and ft2232_spi need access to the USB device via libusb.
526
527       dummy needs no access permissions at all.
528
529       internal,   nic3com,  nicrealtek,  nicsmc1211,  nicnatsemi,  gfxnvidia,
530       drkaiser, satasii, satamv and atahpt have to be run as  superuser/root,
531       and need additional raw access permission.
532
533       serprog,  buspirate_spi,  dediprog  and ft2232_spi can be run as normal
534       user on most operating systems if appropriate  device  permissions  are
535       set.
536
537       ogp needs PCI configuration space read access and raw memory access.
538
539       On   OpenBSD,   you   can  obtain  raw  access  permission  by  setting
540       securelevel=-1 in /etc/rc.securelevel and rebooting, or rebooting  into
541       single user mode.
542

BUGS

544       Please report any bugs at
545
546         http://www.flashrom.org/trac/flashrom/newticket
547
548       or on the flashrom mailing list at <flashrom@flashrom.org>
549
550       We recommend to subscribe first at
551
552         http://www.flashrom.org/mailman/listinfo/flashrom
553
554       Using  flashrom  on laptops is dangerous and may easily make your hard‐
555       ware unusable unless you can desolder the flash chip and  have  a  full
556       flash  chip  backup.  This  is  caused  by the embedded controller (EC)
557       present in many laptops, which interacts badly with any flash attempts.
558       This  is  a  hardware limitation and flashrom will attempt to detect it
559       and abort immediately for safety reasons.
560
561       More information about flashrom on laptops is available from
562
563         http://www.flashrom.org/Laptops
564

LICENSE

566       flashrom is covered by the GNU General Public License (GPL), version 2.
567       Some  files are additionally available under the GPL (version 2, or any
568       later version).
569
571       Please see the individual files.
572

AUTHORS

574       Andrew Morgan
575       Carl-Daniel Hailfinger
576       Claus Gindhart
577       David Borg
578       David Hendricks
579       Dominik Geyer
580       Eric Biederman
581       Giampiero Giancipoli
582       Helge Wagner
583       Idwer Vollering
584       Joe Bao
585       Joerg Fischer
586       Joshua Roys
587       Luc Verhaegen
588       Li-Ta Lo
589       Mark Marshall
590       Markus Boas
591       Mattias Mattsson
592       Michael Karcher
593       Nikolay Petukhov
594       Patrick Georgi
595       Peter Lemenkov
596       Peter Stuge
597       Reinder E.N. de Haan
598       Ronald G. Minnich
599       Ronald Hoogenboom
600       Sean Nelson
601       Stefan Reinauer
602       Stefan Tauner
603       Stefan Wildemann
604       Stephan Guilloux
605       Steven James
606       Uwe Hermann
607       Wang Qingpei
608       Yinghai Lu
609       some others, please see the flashrom svn changelog for details.
610       All authors can be reached via email at <flashrom@flashrom.org>.
611
612       This manual page was written by Uwe Hermann <uwe@hermann-uwe.de>, Carl-
613       Daniel  Hailfinger  and  others.  It is licensed under the terms of the
614       GNU GPL (version 2 or later).
615
616
617
618                                 Jul 25, 2011                      FLASHROM(8)
Impressum