blob: b13d1a734fd6c311bddf7e1b4553d2cd06289724 [file] [log] [blame]
Uwe Hermann2dc5f422006-11-20 20:32:35 +00001-------------------------------------------------------------------------------
Peter Stuge44dd3042009-04-20 12:34:30 +00002flashrom README
Uwe Hermann2dc5f422006-11-20 20:32:35 +00003-------------------------------------------------------------------------------
Ronald G. Minnich1e5003f2002-04-10 18:02:07 +00004
Peter Stuge44dd3042009-04-20 12:34:30 +00005flashrom is a utility for reading, writing, and erasing flash ROM chips.
Uwe Hermanne74b9f82009-04-10 14:41:29 +00006It's often used to flash BIOS/coreboot/firmware images.
7
Uwe Hermannd42009c2009-04-11 13:59:00 +00008It supports a wide range of DIP32, PLCC32, DIP8, SO8/SOIC8, TSOP32, and
9TSOP40 chips, which use various protocols such as LPC, FWH, parallel flash,
10or SPI.
Uwe Hermann42eb17f2008-01-18 17:48:51 +000011
12(see http://coreboot.org for details on coreboot)
13
Uwe Hermann2dc5f422006-11-20 20:32:35 +000014
15Build Requirements
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000016------------------
17
Uwe Hermannf8a49fe2008-06-22 18:50:25 +000018To build the flashrom utility you need to install the following packages:
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000019
20* pciutils
Uwe Hermannf8a49fe2008-06-22 18:50:25 +000021* pciutils-devel / pciutils-dev / libpci-dev
Uwe Hermann83f0db22006-12-20 14:53:22 +000022* zlib-devel / zlib1g-dev
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000023
24
Uwe Hermann2dc5f422006-11-20 20:32:35 +000025Usage
Stefan Reinauer06b2c4d2005-12-01 10:51:08 +000026-----
27
Idwer Vollering4cf3eef2009-01-11 03:31:02 +000028 $ flashrom [-rwvEVfLhR] [-c chipname] [-s exclude_start] [-e exclude_end]
Peter Stuge6b53fed2008-01-27 16:21:21 +000029 [-m [vendor:]part] [-l file.layout] [-i imagename] [file]
30 -r | --read: read flash and save into file
31 -w | --write: write file into flash (default when
32 file is specified)
33 -v | --verify: verify flash against file
34 -E | --erase: erase flash device
35 -V | --verbose: more verbose output
36 -c | --chip <chipname>: probe only for specified flash chip
37 -s | --estart <addr>: exclude start position
38 -e | --eend <addr>: exclude end postion
39 -m | --mainboard <[vendor:]part>: override mainboard settings
40 -f | --force: force write without checking image
41 -l | --layout <file.layout>: read rom layout from file
42 -i | --image <name>: only flash image name from flash layout
Idwer Vollering4cf3eef2009-01-11 03:31:02 +000043 -L | --list-supported: print supported devices
44 -h | --help: print this help text
45 -R | --version: print the version (release)
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000046
Ollie Lho184a4042005-11-26 21:55:36 +000047 If no file is specified, then all that happens
48 is that flash info is dumped and the flash chip is set to writable.
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000049
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000050
Peter Stuge42688e52009-01-26 02:20:56 +000051Exit status
52-----------
Uwe Hermanne74b9f82009-04-10 14:41:29 +000053
Peter Stuge44dd3042009-04-20 12:34:30 +000054flashrom exits with 0 on success, 1 on most failures but with 2 if /dev/mem
Peter Stuge42688e52009-01-26 02:20:56 +000055(/dev/xsvc on Solaris) can not be opened and with 3 if a call to mmap() fails.
56
57
Stefan Reinauere3f3e2e2008-01-18 15:33:10 +000058coreboot Table and Mainboard Identification
Ollie Lho184a4042005-11-26 21:55:36 +000059--------------------------------------------
Ronald G. Minnich5e5f75e2002-01-29 18:21:41 +000060
Peter Stuge44dd3042009-04-20 12:34:30 +000061flashrom reads the coreboot table to determine the current mainboard. If no
Uwe Hermanne74b9f82009-04-10 14:41:29 +000062coreboot table could be read or if you want to override these values, you can
63specify -m, e.g.:
Ollie Lho184a4042005-11-26 21:55:36 +000064
Uwe Hermannf8a49fe2008-06-22 18:50:25 +000065 $ flashrom -w --mainboard AGAMI:ARUMA agami_aruma.rom
Ollie Lho184a4042005-11-26 21:55:36 +000066
Uwe Hermannf8a49fe2008-06-22 18:50:25 +000067See the 'Supported mainboards' section in the output of 'flashrom -L' for
68a list of boards which require the specification of the board name, if no
69coreboot table is found.
Uwe Hermann67808fe2007-10-18 00:29:05 +000070
Ollie Lho184a4042005-11-26 21:55:36 +000071
Uwe Hermann2dc5f422006-11-20 20:32:35 +000072ROM Layout Support
Ollie Lho184a4042005-11-26 21:55:36 +000073------------------
74
Peter Stuge44dd3042009-04-20 12:34:30 +000075flashrom supports ROM layouts. This allows you to flash certain parts of
Uwe Hermann2dc5f422006-11-20 20:32:35 +000076the flash chip only. A ROM layout file looks like follows:
Ollie Lho184a4042005-11-26 21:55:36 +000077
78 00000000:00008fff gfxrom
79 00009000:0003ffff normal
80 00040000:0007ffff fallback
81
82 i.e.:
83 startaddr:endaddr name
84
Uwe Hermann67808fe2007-10-18 00:29:05 +000085 All addresses are offsets within the file, not absolute addresses!
Ollie Lho184a4042005-11-26 21:55:36 +000086
Uwe Hermann2dc5f422006-11-20 20:32:35 +000087If you only want to update the normal image in a ROM you can say:
Ollie Lho184a4042005-11-26 21:55:36 +000088
Uwe Hermann67808fe2007-10-18 00:29:05 +000089 flashrom -w --layout rom.layout --image normal agami_aruma.rom
Ollie Lho184a4042005-11-26 21:55:36 +000090
Uwe Hermann2dc5f422006-11-20 20:32:35 +000091To update normal and fallback but leave the VGA BIOS alone, say:
Ollie Lho184a4042005-11-26 21:55:36 +000092
Uwe Hermann67808fe2007-10-18 00:29:05 +000093 flashrom -w -l rom.layout -i normal -i fallback agami_aruma.rom
Ollie Lho184a4042005-11-26 21:55:36 +000094
Uwe Hermann2dc5f422006-11-20 20:32:35 +000095Currently overlapping sections are not supported.
Ollie Lho184a4042005-11-26 21:55:36 +000096
Uwe Hermann2dc5f422006-11-20 20:32:35 +000097ROM layouts should replace the -s and -e option since they are more
98flexible and they should lead to a ROM update file format with the
Uwe Hermann67808fe2007-10-18 00:29:05 +000099ROM layout and the ROM image in one file (cpio, zip or something?).
Ollie Lho184a4042005-11-26 21:55:36 +0000100
101
Uwe Hermannf8a49fe2008-06-22 18:50:25 +0000102Supported Flash Chips / Chipsets / Mainboards
103---------------------------------------------
Uwe Hermannb6d28322006-12-04 08:15:47 +0000104
Uwe Hermannf8a49fe2008-06-22 18:50:25 +0000105Please check the output of 'flashrom -L' for the list of supported
106flash chips, chipsets/southbridges, and mainboards.
Uwe Hermannb6d28322006-12-04 08:15:47 +0000107
Uwe Hermannf8a49fe2008-06-22 18:50:25 +0000108See also http://coreboot.org/Flashrom for more details.
Uwe Hermannb6d28322006-12-04 08:15:47 +0000109